Skip to content

Commit f7da3e3

Browse files
authored
chore(tr): add option to resolve rpc to install dep source (#360)
Adds an option to the `ResolveDependencies` RPC to instruct the resolver to download dependency source code. - [x] I ran `make setup && make` to update the generated code after editing a `.atd` file (TODO: have a CI check) - [x] I made sure we're still backward compatible with old versions of the CLI. For example, the Semgrep backend need to still be able to *consume* data generated by Semgrep 1.50.0. See https://atd.readthedocs.io/en/latest/atdgen-tutorial.html#smooth-protocol-upgrades Note that the types related to the semgrep-core JSON output or the semgrep-core RPC do not need to be backward compatible!
1 parent 908e8c1 commit f7da3e3

7 files changed

+268
-15
lines changed

semgrep_output_v1.atd

+6-1
Original file line numberDiff line numberDiff line change
@@ -2385,6 +2385,11 @@ type unresolved_subproject
23852385
errors: sca_error list;
23862386
}
23872387

2388+
type resolve_dependencies_params <python decorator="dataclass(frozen=True)"> = {
2389+
dependency_sources: dependency_source list;
2390+
download_dependency_source_code: bool;
2391+
}
2392+
23882393
(* Resolution can either succeed or fail, but in either case errors can be
23892394
* produced (e.g. one resolution method might fail while a worse one succeeds,
23902395
* lockfile parsing might partially fail but recover and still produce results).
@@ -2466,7 +2471,7 @@ type function_call <python decorator="dataclass(frozen=True)"> = [
24662471
the RPC pipe.
24672472
*)
24682473
| CallValidate of fpath
2469-
| CallResolveDependencies of dependency_source list
2474+
| CallResolveDependencies of resolve_dependencies_params
24702475
| CallUploadSymbolAnalysis of ((* token *) string * (* scan_id *) int * symbol_analysis)
24712476
| CallDumpRulePartitions of dump_rule_partitions_params
24722477
| CallGetTargets of scanning_roots

semgrep_output_v1.jsonschema

+12-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

semgrep_output_v1.proto

+6-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

semgrep_output_v1.py

+34-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

semgrep_output_v1.ts

+22-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

semgrep_output_v1_j.ml

+162-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)