DataDog / datadog-static-analyzer

Datadog Static Analyzer
https://docs.datadoghq.com/static_analysis/
Apache License 2.0
100 stars 12 forks source link

[STAL-1960] Implement ddsa JsRuntime rule execution #402

Closed jasonforal closed 3 months ago

jasonforal commented 4 months ago

What problem are you trying to solve?

From all the other STAL-1960 PRs, we've implemented all the ddsa JsRuntime's core logic and plumbing, but the components aren't yet connected in a way that can execute a rule.

What is your solution?

Several lightweight commits follow the exact same pattern: add some boilerplate to expose a "bridge" via the v8 global object, and then add any relevant tests if there were interlinked components that depending on that bridge.

From there, we implement execute_rule_internal (and the friendly, public version: execute_rule).

Sidenote: execute_rule_internal could probably use a slightly nicer function signature. There are a number of things I would like to do here, but they should be handled in a future PR. For example, source_text, source_tree, and language should really all be bundled into a single struct.

Notable technical details

Alternatives considered

What the reviewer should know