From 49431919a6d36e71dc4a039d9188983b31c2ae1b Mon Sep 17 00:00:00 2001 From: pad Date: Wed, 4 Dec 2024 17:40:20 +0100 Subject: [PATCH 1/6] Make project_metadata mandatory in scan_request (try 2) try2 of https://github.com/semgrep/semgrep-interfaces/pull/316 Step1 towards getting rid of meta. test plan: see related PR in semgrep-pro --- semgrep_output_v1.atd | 15 ++- semgrep_output_v1.jsonschema | 6 +- semgrep_output_v1.proto | 6 +- semgrep_output_v1.py | 21 ++-- semgrep_output_v1.ts | 18 +-- semgrep_output_v1_j.ml | 222 ++++++++--------------------------- semgrep_output_v1_j.mli | 6 +- 7 files changed, 89 insertions(+), 205 deletions(-) diff --git a/semgrep_output_v1.atd b/semgrep_output_v1.atd index 2995768f..6b6f8040 100644 --- a/semgrep_output_v1.atd +++ b/semgrep_output_v1.atd @@ -1357,12 +1357,17 @@ type scan_metadata = { (* Sent by the CLI to the POST /api/cli/scans to create a scan. *) type scan_request = { - (* until 1.43ish, was 'meta: project_metadata;' before *) - meta: raw_json; - (* from 1.43 *) - ?project_metadata: project_metadata option; (* replacing meta *) + (* added in 1.43 as options, and mandatory since 1.99.0 (replacing meta) *) + project_metadata: project_metadata; + scan_metadata: scan_metadata; + + (* added in 1.43 (used to be in meta) *) ?project_config: ci_config_from_repo option; - ?scan_metadata: scan_metadata option; + + (* deprecated: moved as an option in 1.98.0 and was used until 1.43ish + * old: 'meta: project_metadata;' before 1.43 + *) + ?meta: raw_json option; } (* Response from the backend to the CLI to the POST /api/cli/scans *) diff --git a/semgrep_output_v1.jsonschema b/semgrep_output_v1.jsonschema index 7e3ab501..8c432b0c 100644 --- a/semgrep_output_v1.jsonschema +++ b/semgrep_output_v1.jsonschema @@ -1015,12 +1015,12 @@ }, "scan_request": { "type": "object", - "required": [ "meta" ], + "required": [ "project_metadata", "scan_metadata" ], "properties": { - "meta": { "$ref": "#/definitions/raw_json" }, "project_metadata": { "$ref": "#/definitions/project_metadata" }, + "scan_metadata": { "$ref": "#/definitions/scan_metadata" }, "project_config": { "$ref": "#/definitions/ci_config_from_repo" }, - "scan_metadata": { "$ref": "#/definitions/scan_metadata" } + "meta": { "$ref": "#/definitions/raw_json" } } }, "scan_response": { diff --git a/semgrep_output_v1.proto b/semgrep_output_v1.proto index b1937edd..95a1d7a7 100644 --- a/semgrep_output_v1.proto +++ b/semgrep_output_v1.proto @@ -1,6 +1,6 @@ // Generated by jsonschema2protobuf. DO NOT EDIT! // Source file: semgrep_output_v1.jsonschema -// Source file sha256 digest: 25e0e40433e3ae6acc541edaf39cff2ad383ceb1e71630e89b6baa0b8346d465 +// Source file sha256 digest: 115cf8e6df759e041099013e293fe5bb11a079fe0ca09c24d447f786d95fc587 syntax = "proto3"; @@ -383,10 +383,10 @@ message ScanMetadata { } message ScanRequest { - google.protobuf.Any meta = 3004443; ProjectMetadata project_metadata = 24255885; - CiConfigFromRepo project_config = 317758767; ScanMetadata scan_metadata = 76122041; + CiConfigFromRepo project_config = 317758767; + google.protobuf.Any meta = 3004443; } message ScanResponse { diff --git a/semgrep_output_v1.py b/semgrep_output_v1.py index 9a88ea07..ce6f04de 100644 --- a/semgrep_output_v1.py +++ b/semgrep_output_v1.py @@ -4904,32 +4904,31 @@ def to_json_string(self, **kw: Any) -> str: class ScanRequest: """Original type: scan_request = { ... }""" - meta: RawJson - project_metadata: Optional[ProjectMetadata] = None + project_metadata: ProjectMetadata + scan_metadata: ScanMetadata project_config: Optional[CiConfigFromRepo] = None - scan_metadata: Optional[ScanMetadata] = None + meta: Optional[RawJson] = None @classmethod def from_json(cls, x: Any) -> 'ScanRequest': if isinstance(x, dict): return cls( - meta=RawJson.from_json(x['meta']) if 'meta' in x else _atd_missing_json_field('ScanRequest', 'meta'), - project_metadata=ProjectMetadata.from_json(x['project_metadata']) if 'project_metadata' in x else None, + project_metadata=ProjectMetadata.from_json(x['project_metadata']) if 'project_metadata' in x else _atd_missing_json_field('ScanRequest', 'project_metadata'), + scan_metadata=ScanMetadata.from_json(x['scan_metadata']) if 'scan_metadata' in x else _atd_missing_json_field('ScanRequest', 'scan_metadata'), project_config=CiConfigFromRepo.from_json(x['project_config']) if 'project_config' in x else None, - scan_metadata=ScanMetadata.from_json(x['scan_metadata']) if 'scan_metadata' in x else None, + meta=RawJson.from_json(x['meta']) if 'meta' in x else None, ) else: _atd_bad_json('ScanRequest', x) def to_json(self) -> Any: res: Dict[str, Any] = {} - res['meta'] = (lambda x: x.to_json())(self.meta) - if self.project_metadata is not None: - res['project_metadata'] = (lambda x: x.to_json())(self.project_metadata) + res['project_metadata'] = (lambda x: x.to_json())(self.project_metadata) + res['scan_metadata'] = (lambda x: x.to_json())(self.scan_metadata) if self.project_config is not None: res['project_config'] = (lambda x: x.to_json())(self.project_config) - if self.scan_metadata is not None: - res['scan_metadata'] = (lambda x: x.to_json())(self.scan_metadata) + if self.meta is not None: + res['meta'] = (lambda x: x.to_json())(self.meta) return res @classmethod diff --git a/semgrep_output_v1.ts b/semgrep_output_v1.ts index 2d2eca58..b8fd9e55 100644 --- a/semgrep_output_v1.ts +++ b/semgrep_output_v1.ts @@ -558,10 +558,10 @@ export type ScanMetadata = { } export type ScanRequest = { - meta: RawJson; - project_metadata?: ProjectMetadata; + project_metadata: ProjectMetadata; + scan_metadata: ScanMetadata; project_config?: CiConfigFromRepo; - scan_metadata?: ScanMetadata; + meta?: RawJson; } export type ScanResponse = { @@ -2755,19 +2755,19 @@ export function readScanMetadata(x: any, context: any = x): ScanMetadata { export function writeScanRequest(x: ScanRequest, context: any = x): any { return { - 'meta': _atd_write_required_field('ScanRequest', 'meta', writeRawJson, x.meta, x), - 'project_metadata': _atd_write_optional_field(writeProjectMetadata, x.project_metadata, x), + 'project_metadata': _atd_write_required_field('ScanRequest', 'project_metadata', writeProjectMetadata, x.project_metadata, x), + 'scan_metadata': _atd_write_required_field('ScanRequest', 'scan_metadata', writeScanMetadata, x.scan_metadata, x), 'project_config': _atd_write_optional_field(writeCiConfigFromRepo, x.project_config, x), - 'scan_metadata': _atd_write_optional_field(writeScanMetadata, x.scan_metadata, x), + 'meta': _atd_write_optional_field(writeRawJson, x.meta, x), }; } export function readScanRequest(x: any, context: any = x): ScanRequest { return { - meta: _atd_read_required_field('ScanRequest', 'meta', readRawJson, x['meta'], x), - project_metadata: _atd_read_optional_field(readProjectMetadata, x['project_metadata'], x), + project_metadata: _atd_read_required_field('ScanRequest', 'project_metadata', readProjectMetadata, x['project_metadata'], x), + scan_metadata: _atd_read_required_field('ScanRequest', 'scan_metadata', readScanMetadata, x['scan_metadata'], x), project_config: _atd_read_optional_field(readCiConfigFromRepo, x['project_config'], x), - scan_metadata: _atd_read_optional_field(readScanMetadata, x['scan_metadata'], x), + meta: _atd_read_optional_field(readRawJson, x['meta'], x), }; } diff --git a/semgrep_output_v1_j.ml b/semgrep_output_v1_j.ml index b478df55..cfdb7280 100644 --- a/semgrep_output_v1_j.ml +++ b/semgrep_output_v1_j.ml @@ -404,10 +404,10 @@ type ci_config_from_repo = Semgrep_output_v1_t.ci_config_from_repo = { } type scan_request = Semgrep_output_v1_t.scan_request = { - meta: raw_json; - project_metadata: project_metadata option; + project_metadata: project_metadata; + scan_metadata: scan_metadata; project_config: ci_config_from_repo option; - scan_metadata: scan_metadata option + meta: raw_json option } type ci_env = Semgrep_output_v1_t.ci_env @@ -15144,120 +15144,6 @@ let read_ci_config_from_repo = ( ) let ci_config_from_repo_of_string s = read_ci_config_from_repo (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -let write__scan_metadata_option = ( - Atdgen_runtime.Oj_run.write_std_option ( - write_scan_metadata - ) -) -let string_of__scan_metadata_option ?(len = 1024) x = - let ob = Buffer.create len in - write__scan_metadata_option ob x; - Buffer.contents ob -let read__scan_metadata_option = ( - fun p lb -> - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> ( - match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = ( - read_scan_metadata - ) p lb - in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> - Atdgen_runtime.Oj_run.invalid_variant_tag p x - ) - | `Double_quote -> ( - match Yojson.Safe.finish_string p lb with - | "None" -> - (None : _ option) - | x -> - Atdgen_runtime.Oj_run.invalid_variant_tag p x - ) - | `Square_bracket -> ( - match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = ( - read_scan_metadata - ) p lb - in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> - Atdgen_runtime.Oj_run.invalid_variant_tag p x - ) -) -let _scan_metadata_option_of_string s = - read__scan_metadata_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -let write__project_metadata_option = ( - Atdgen_runtime.Oj_run.write_std_option ( - write_project_metadata - ) -) -let string_of__project_metadata_option ?(len = 1024) x = - let ob = Buffer.create len in - write__project_metadata_option ob x; - Buffer.contents ob -let read__project_metadata_option = ( - fun p lb -> - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> ( - match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = ( - read_project_metadata - ) p lb - in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> - Atdgen_runtime.Oj_run.invalid_variant_tag p x - ) - | `Double_quote -> ( - match Yojson.Safe.finish_string p lb with - | "None" -> - (None : _ option) - | x -> - Atdgen_runtime.Oj_run.invalid_variant_tag p x - ) - | `Square_bracket -> ( - match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = ( - read_project_metadata - ) p lb - in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> - Atdgen_runtime.Oj_run.invalid_variant_tag p x - ) -) -let _project_metadata_option_of_string s = - read__project_metadata_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) let write__ci_config_from_repo_option = ( Atdgen_runtime.Oj_run.write_std_option ( write_ci_config_from_repo @@ -15323,22 +15209,20 @@ let write_scan_request : _ -> scan_request -> _ = ( is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"meta\":"; + Buffer.add_string ob "\"project_metadata\":"; ( - write_raw_json + write_project_metadata ) - ob x.meta; - (match x.project_metadata with None -> () | Some x -> - if !is_first then - is_first := false - else - Buffer.add_char ob ','; - Buffer.add_string ob "\"project_metadata\":"; - ( - write_project_metadata - ) - ob x; - ); + ob x.project_metadata; + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"scan_metadata\":"; + ( + write_scan_metadata + ) + ob x.scan_metadata; (match x.project_config with None -> () | Some x -> if !is_first then is_first := false @@ -15350,14 +15234,14 @@ let write_scan_request : _ -> scan_request -> _ = ( ) ob x; ); - (match x.scan_metadata with None -> () | Some x -> + (match x.meta with None -> () | Some x -> if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"scan_metadata\":"; + Buffer.add_string ob "\"meta\":"; ( - write_scan_metadata + write_raw_json ) ob x; ); @@ -15371,10 +15255,10 @@ let read_scan_request = ( fun p lb -> Yojson.Safe.read_space p lb; Yojson.Safe.read_lcurl p lb; - let field_meta = ref (None) in let field_project_metadata = ref (None) in - let field_project_config = ref (None) in let field_scan_metadata = ref (None) in + let field_project_config = ref (None) in + let field_meta = ref (None) in try Yojson.Safe.read_space p lb; Yojson.Safe.read_object_end lb; @@ -15386,7 +15270,7 @@ let read_scan_request = ( match len with | 4 -> ( if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'a' then ( - 0 + 3 ) else ( -1 @@ -15394,7 +15278,7 @@ let read_scan_request = ( ) | 13 -> ( if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'c' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'm' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'a' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'a' then ( - 3 + 1 ) else ( -1 @@ -15410,7 +15294,7 @@ let read_scan_request = ( ) | 16 -> ( if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'j' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 'm' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 'd' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 't' && String.unsafe_get s (pos+15) = 'a' then ( - 1 + 0 ) else ( -1 @@ -15425,23 +15309,21 @@ let read_scan_request = ( ( match i with | 0 -> - field_meta := ( + field_project_metadata := ( Some ( ( - read_raw_json + read_project_metadata ) p lb ) ); | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) then ( - field_project_metadata := ( - Some ( - ( - read_project_metadata - ) p lb - ) - ); - ) + field_scan_metadata := ( + Some ( + ( + read_scan_metadata + ) p lb + ) + ); | 2 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_project_config := ( @@ -15454,10 +15336,10 @@ let read_scan_request = ( ) | 3 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( - field_scan_metadata := ( + field_meta := ( Some ( ( - read_scan_metadata + read_raw_json ) p lb ) ); @@ -15477,7 +15359,7 @@ let read_scan_request = ( match len with | 4 -> ( if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'a' then ( - 0 + 3 ) else ( -1 @@ -15485,7 +15367,7 @@ let read_scan_request = ( ) | 13 -> ( if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'c' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'm' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'a' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'a' then ( - 3 + 1 ) else ( -1 @@ -15501,7 +15383,7 @@ let read_scan_request = ( ) | 16 -> ( if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'j' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 'm' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 'd' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 't' && String.unsafe_get s (pos+15) = 'a' then ( - 1 + 0 ) else ( -1 @@ -15516,23 +15398,21 @@ let read_scan_request = ( ( match i with | 0 -> - field_meta := ( + field_project_metadata := ( Some ( ( - read_raw_json + read_project_metadata ) p lb ) ); | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) then ( - field_project_metadata := ( - Some ( - ( - read_project_metadata - ) p lb - ) - ); - ) + field_scan_metadata := ( + Some ( + ( + read_scan_metadata + ) p lb + ) + ); | 2 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_project_config := ( @@ -15545,10 +15425,10 @@ let read_scan_request = ( ) | 3 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( - field_scan_metadata := ( + field_meta := ( Some ( ( - read_scan_metadata + read_raw_json ) p lb ) ); @@ -15562,10 +15442,10 @@ let read_scan_request = ( with Yojson.End_of_object -> ( ( { - meta = (match !field_meta with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "meta"); - project_metadata = !field_project_metadata; + project_metadata = (match !field_project_metadata with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "project_metadata"); + scan_metadata = (match !field_scan_metadata with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "scan_metadata"); project_config = !field_project_config; - scan_metadata = !field_scan_metadata; + meta = !field_meta; } : scan_request) ) diff --git a/semgrep_output_v1_j.mli b/semgrep_output_v1_j.mli index 05d3c553..4c0317ea 100644 --- a/semgrep_output_v1_j.mli +++ b/semgrep_output_v1_j.mli @@ -404,10 +404,10 @@ type ci_config_from_repo = Semgrep_output_v1_t.ci_config_from_repo = { } type scan_request = Semgrep_output_v1_t.scan_request = { - meta: raw_json; - project_metadata: project_metadata option; + project_metadata: project_metadata; + scan_metadata: scan_metadata; project_config: ci_config_from_repo option; - scan_metadata: scan_metadata option + meta: raw_json option } type ci_env = Semgrep_output_v1_t.ci_env From f205a1ac2ea3e7a25d2f072d01c750b0f77635f2 Mon Sep 17 00:00:00 2001 From: Yoann Padioleau Date: Wed, 4 Dec 2024 21:08:29 +0100 Subject: [PATCH 2/6] Update semgrep_output_v1.atd Co-authored-by: Clara McCreery --- semgrep_output_v1.atd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/semgrep_output_v1.atd b/semgrep_output_v1.atd index 6b6f8040..69d23944 100644 --- a/semgrep_output_v1.atd +++ b/semgrep_output_v1.atd @@ -1364,7 +1364,7 @@ type scan_request = { (* added in 1.43 (used to be in meta) *) ?project_config: ci_config_from_repo option; - (* deprecated: moved as an option in 1.98.0 and was used until 1.43ish + (* deprecated: moved as an option in 1.99.0 and was duplicative of information in project_metadata and scan_metadata since 1.43.0 * old: 'meta: project_metadata;' before 1.43 *) ?meta: raw_json option; From b7f18e85dd2e2d06551050f9fa108d09c6895e04 Mon Sep 17 00:00:00 2001 From: pad Date: Thu, 5 Dec 2024 17:00:59 +0100 Subject: [PATCH 3/6] clara's review --- semgrep_output_v1.atd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/semgrep_output_v1.atd b/semgrep_output_v1.atd index 69d23944..e31bbbf9 100644 --- a/semgrep_output_v1.atd +++ b/semgrep_output_v1.atd @@ -1361,7 +1361,7 @@ type scan_request = { project_metadata: project_metadata; scan_metadata: scan_metadata; - (* added in 1.43 (used to be in meta) *) + (* added in 1.43 *) ?project_config: ci_config_from_repo option; (* deprecated: moved as an option in 1.99.0 and was duplicative of information in project_metadata and scan_metadata since 1.43.0 From 9bf3db75c496ebd2aa428aa1bd36dc2786c5fa9a Mon Sep 17 00:00:00 2001 From: pad Date: Fri, 6 Dec 2024 13:34:42 +0100 Subject: [PATCH 4/6] misc --- semgrep_output_v1.atd | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/semgrep_output_v1.atd b/semgrep_output_v1.atd index e31bbbf9..f6811d76 100644 --- a/semgrep_output_v1.atd +++ b/semgrep_output_v1.atd @@ -831,7 +831,8 @@ type skipped_rule = { (* coupling: with semgrep_metrics.atd performance section *) (* coupling: if you change the JSON schema below, you probably need to - * also modify perf/run-benchmarks. Run locally $ ./run-benchmarks --dummy --upload + * also modify perf/run-benchmarks. + * Run locally $ ./run-benchmarks --dummy --upload *) type profile = { (* List of rules, including the one read but not run on any target. @@ -1364,7 +1365,8 @@ type scan_request = { (* added in 1.43 *) ?project_config: ci_config_from_repo option; - (* deprecated: moved as an option in 1.99.0 and was duplicative of information in project_metadata and scan_metadata since 1.43.0 + (* deprecated: moved as an option in 1.99.0 and was duplicative of + * information in project_metadata and scan_metadata since 1.43.0 * old: 'meta: project_metadata;' before 1.43 *) ?meta: raw_json option; @@ -1942,7 +1944,6 @@ type apply_fixes_return = { fixed_lines: (int * string list) list; } -(* The parameters here pretty much match what's needed by Sarif_output.sarif_output. *) type sarif_format_params = { hide_nudge: bool; engine_label: string; From 3265a18cafa630c2db07bcfe37c67077168524a2 Mon Sep 17 00:00:00 2001 From: pad Date: Fri, 6 Dec 2024 13:36:51 +0100 Subject: [PATCH 5/6] more --- semgrep_output_v1.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/semgrep_output_v1.proto b/semgrep_output_v1.proto index 95a1d7a7..cee2e1cd 100644 --- a/semgrep_output_v1.proto +++ b/semgrep_output_v1.proto @@ -1,6 +1,6 @@ // Generated by jsonschema2protobuf. DO NOT EDIT! // Source file: semgrep_output_v1.jsonschema -// Source file sha256 digest: 115cf8e6df759e041099013e293fe5bb11a079fe0ca09c24d447f786d95fc587 +// Source file sha256 digest: 3c5ed14031f0dd72ed2f739c26ab80f76a94337b5caa1da7e9a04d0facae95da syntax = "proto3"; From 7e196741b1c9c6c96b6c5065beb46a58aac07e6e Mon Sep 17 00:00:00 2001 From: pad Date: Fri, 6 Dec 2024 13:38:15 +0100 Subject: [PATCH 6/6] 1.100.0 now --- semgrep_output_v1.atd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/semgrep_output_v1.atd b/semgrep_output_v1.atd index 64ab5ff6..d7090d1a 100644 --- a/semgrep_output_v1.atd +++ b/semgrep_output_v1.atd @@ -1358,14 +1358,14 @@ type scan_metadata = { (* Sent by the CLI to the POST /api/cli/scans to create a scan. *) type scan_request = { - (* added in 1.43 as options, and mandatory since 1.99.0 (replacing meta) *) + (* added in 1.43 as options, and mandatory since 1.100.0 (replacing meta) *) project_metadata: project_metadata; scan_metadata: scan_metadata; (* added in 1.43 *) ?project_config: ci_config_from_repo option; - (* deprecated: moved as an option in 1.99.0 and was duplicative of + (* deprecated: moved as an option in 1.100.0 and was duplicative of * information in project_metadata and scan_metadata since 1.43.0 * old: 'meta: project_metadata;' before 1.43 *)