Skip to content

Commit 5184a33

Browse files
authored
Upload symbol analysis per subproject (#429)
- [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! - [ ] Any accompanying changes in `semgrep-proprietary` are approved and ready to merge once this PR is merged
1 parent 533177d commit 5184a33

9 files changed

+1415
-504
lines changed

semgrep_output_v1.atd

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3364,6 +3364,21 @@ type symbol_usage
33643364

33653365
type symbol_analysis <ocaml attr="deriving show"> = symbol_usage list
33663366

3367+
type upload_subproject_symbol_analysis_params = {
3368+
token: string;
3369+
scan_id: int;
3370+
manifest: fpath option;
3371+
lockfile: fpath option;
3372+
symbol_analysis: symbol_analysis;
3373+
}
3374+
3375+
type subproject_symbol_analysis_url_request
3376+
<doc text="Sent by the CLI to the POST /api/agent/scans/{scan_id}/subproject_symbols_upload_url/">
3377+
= {
3378+
manifest_path: fpath option;
3379+
lockfile_path: fpath option;
3380+
}
3381+
33673382
(* ----------------------------- *)
33683383
(* The call *)
33693384
(* ----------------------------- *)
@@ -3398,6 +3413,7 @@ type function_call <python decorator="dataclass(frozen=True)"> = [
33983413
| CallMatchSubprojects of fpath list
33993414
(* run symbol analysis for the project rooted in the given directory *)
34003415
| CallRunSymbolAnalysis of symbol_analysis_params
3416+
| CallUploadSubprojectSymbolAnalysis of upload_subproject_symbol_analysis_params
34013417
(*************************************************************************)
34023418
(* Text output formatting *)
34033419
(*************************************************************************)
@@ -3432,6 +3448,9 @@ type function_return <python decorator="dataclass(frozen=True)"> = [
34323448
| RetGetTargets of target_discovery_result
34333449
| RetMatchSubprojects of subproject list
34343450
| RetRunSymbolAnalysis of symbol_analysis
3451+
| RetUploadSubprojectSymbolAnalysis
3452+
<doc text="success msg">
3453+
of string
34353454
(*************************************************************************)
34363455
(* Text output formatting *)
34373456
(*************************************************************************)

semgrep_output_v1.jsonschema

Lines changed: 93 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

semgrep_output_v1.proto

Lines changed: 14 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)