From 147dcdedd67fa57abd220e50b3395f98fb3dd6c8 Mon Sep 17 00:00:00 2001 From: Ben Kettle Date: Wed, 15 Jan 2025 14:27:33 -0800 Subject: [PATCH] chore(sca): add flag to disable subproject change detection (#335) Adds a new flag to pass from the app to the CLI that forces the CLI to resolve dependencies for all subprojects, all the time (even for diff scans). Some customers want this so that we get a full picture of their dependencies for every branch. - [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! --- ast_generic_v1.py | 74 +++++++++- ast_generic_v1_j.ml | 275 +++++++++++++++++++++++++---------- ast_generic_v1_j.mli | 22 +++ semgrep_output_v1.atd | 3 + semgrep_output_v1.jsonschema | 8 +- semgrep_output_v1.proto | 6 +- semgrep_output_v1.py | 12 ++ semgrep_output_v1.ts | 12 ++ semgrep_output_v1_j.ml | 260 +++++++++++++++++++++++++++------ semgrep_output_v1_j.mli | 8 +- 10 files changed, 555 insertions(+), 125 deletions(-) diff --git a/ast_generic_v1.py b/ast_generic_v1.py index 6a307e3..1a69cbd 100644 --- a/ast_generic_v1.py +++ b/ast_generic_v1.py @@ -5807,7 +5807,7 @@ def to_json_string(self, **kw: Any) -> str: class ImportFrom: """Original type: directive = [ ... | ImportFrom of ... | ... ]""" - value: Tuple[Tok, ModuleName, List[Tuple[Alias, Optional[Alias]]]] + value: Tuple[Tok, ModuleName, List[ImportFromKind]] @property def kind(self) -> str: @@ -5815,7 +5815,7 @@ def kind(self) -> str: return 'ImportFrom' def to_json(self) -> Any: - return ['ImportFrom', (lambda x: [(lambda x: x.to_json())(x[0]), (lambda x: x.to_json())(x[1]), _atd_write_list((lambda x: [(lambda x: x.to_json())(x[0]), _atd_write_nullable((lambda x: x.to_json()))(x[1])] if isinstance(x, tuple) and len(x) == 2 else _atd_bad_python('tuple of length 2', x)))(x[2])] if isinstance(x, tuple) and len(x) == 3 else _atd_bad_python('tuple of length 3', x))(self.value)] + return ['ImportFrom', (lambda x: [(lambda x: x.to_json())(x[0]), (lambda x: x.to_json())(x[1]), _atd_write_list((lambda x: x.to_json()))(x[2])] if isinstance(x, tuple) and len(x) == 3 else _atd_bad_python('tuple of length 3', x))(self.value)] def to_json_string(self, **kw: Any) -> str: return json.dumps(self.to_json(), **kw) @@ -5945,7 +5945,7 @@ def from_json(cls, x: Any) -> 'Directive': if isinstance(x, List) and len(x) == 2: cons = x[0] if cons == 'ImportFrom': - return cls(ImportFrom((lambda x: (Tok.from_json(x[0]), ModuleName.from_json(x[1]), _atd_read_list((lambda x: (Alias.from_json(x[0]), _atd_read_nullable(Alias.from_json)(x[1])) if isinstance(x, list) and len(x) == 2 else _atd_bad_json('array of length 2', x)))(x[2])) if isinstance(x, list) and len(x) == 3 else _atd_bad_json('array of length 3', x))(x[1]))) + return cls(ImportFrom((lambda x: (Tok.from_json(x[0]), ModuleName.from_json(x[1]), _atd_read_list(ImportFromKind.from_json)(x[2])) if isinstance(x, list) and len(x) == 3 else _atd_bad_json('array of length 3', x))(x[1]))) if cons == 'ImportAs': return cls(ImportAs((lambda x: (Tok.from_json(x[0]), ModuleName.from_json(x[1]), _atd_read_nullable(Alias.from_json)(x[2])) if isinstance(x, list) and len(x) == 3 else _atd_bad_json('array of length 3', x))(x[1]))) if cons == 'ImportAll': @@ -7331,6 +7331,74 @@ def from_json_string(cls, x: str) -> 'IdInfo': def to_json_string(self, **kw: Any) -> str: return json.dumps(self.to_json(), **kw) +@dataclass +class Direct: + """Original type: import_from_kind = [ ... | Direct of ... | ... ]""" + + value: Alias + + @property + def kind(self) -> str: + """Name of the class representing this variant.""" + return 'Direct' + + def to_json(self) -> Any: + return ['Direct', (lambda x: x.to_json())(self.value)] + + def to_json_string(self, **kw: Any) -> str: + return json.dumps(self.to_json(), **kw) + + +@dataclass +class Aliased: + """Original type: import_from_kind = [ ... | Aliased of ... | ... ]""" + + value: Tuple[Ident, Alias] + + @property + def kind(self) -> str: + """Name of the class representing this variant.""" + return 'Aliased' + + def to_json(self) -> Any: + return ['Aliased', (lambda x: [(lambda x: x.to_json())(x[0]), (lambda x: x.to_json())(x[1])] if isinstance(x, tuple) and len(x) == 2 else _atd_bad_python('tuple of length 2', x))(self.value)] + + def to_json_string(self, **kw: Any) -> str: + return json.dumps(self.to_json(), **kw) + + +@dataclass +class ImportFromKind: + """Original type: import_from_kind = [ ... ]""" + + value: Union[Direct, Aliased] + + @property + def kind(self) -> str: + """Name of the class representing this variant.""" + return self.value.kind + + @classmethod + def from_json(cls, x: Any) -> 'ImportFromKind': + if isinstance(x, List) and len(x) == 2: + cons = x[0] + if cons == 'Direct': + return cls(Direct(Alias.from_json(x[1]))) + if cons == 'Aliased': + return cls(Aliased((lambda x: (Ident.from_json(x[0]), Alias.from_json(x[1])) if isinstance(x, list) and len(x) == 2 else _atd_bad_json('array of length 2', x))(x[1]))) + _atd_bad_json('ImportFromKind', x) + _atd_bad_json('ImportFromKind', x) + + def to_json(self) -> Any: + return self.value.to_json() + + @classmethod + def from_json_string(cls, x: str) -> 'ImportFromKind': + return cls.from_json(json.loads(x)) + + def to_json_string(self, **kw: Any) -> str: + return json.dumps(self.to_json(), **kw) + @dataclass class Item: """Original type: item""" diff --git a/ast_generic_v1_j.ml b/ast_generic_v1_j.ml index c4f5adc..040de46 100644 --- a/ast_generic_v1_j.ml +++ b/ast_generic_v1_j.ml @@ -144,6 +144,8 @@ and id_info = Ast_generic_v1_t.id_info = { id_svalue: svalue option } +and import_from_kind = Ast_generic_v1_t.import_from_kind + and item = Ast_generic_v1_t.item and label_ident = Ast_generic_v1_t.label_ident @@ -4497,29 +4499,7 @@ let read_xml_kind = ( ) let xml_kind_of_string s = read_xml_kind (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -let rec write__alias_alias_nullable_list ob x = ( - Atdgen_runtime.Oj_run.write_list ( - fun ob x -> - Buffer.add_char ob '['; - (let x, _ = x in - ( - write_alias - ) ob x - ); - Buffer.add_char ob ','; - (let _, x = x in - ( - write__alias_nullable - ) ob x - ); - Buffer.add_char ob ']'; - ) -) ob x -and string_of__alias_alias_nullable_list ?(len = 1024) x = - let ob = Buffer.create len in - write__alias_alias_nullable_list ob x; - Buffer.contents ob -and write__alias_nullable ob x = ( +let rec write__alias_nullable ob x = ( Atdgen_runtime.Oj_run.write_nullable ( write_alias ) @@ -4974,6 +4954,15 @@ and string_of__ident_type_arguments_nullable_list ?(len = 1024) x = let ob = Buffer.create len in write__ident_type_arguments_nullable_list ob x; Buffer.contents ob +and write__import_from_kind_list ob x = ( + Atdgen_runtime.Oj_run.write_list ( + write_import_from_kind + ) +) ob x +and string_of__import_from_kind_list ?(len = 1024) x = + let ob = Buffer.create len in + write__import_from_kind_list ob x; + Buffer.contents ob and write__item_list ob x = ( Atdgen_runtime.Oj_run.write_list ( write_item @@ -5963,7 +5952,7 @@ and write_directive = ( Buffer.add_char ob ','; (let _, _, x = x in ( - write__alias_alias_nullable_list + write__import_from_kind_list ) ob x ); Buffer.add_char ob ']'; @@ -7000,6 +6989,39 @@ and string_of_id_info ?(len = 1024) x = let ob = Buffer.create len in write_id_info ob x; Buffer.contents ob +and write_import_from_kind = ( + fun ob x -> + match x with + | `Direct x -> + Buffer.add_string ob "[\"Direct\","; + ( + write_alias + ) ob x; + Buffer.add_char ob ']' + | `Aliased x -> + Buffer.add_string ob "[\"Aliased\","; + ( + fun ob x -> + Buffer.add_char ob '['; + (let x, _ = x in + ( + write_ident + ) ob x + ); + Buffer.add_char ob ','; + (let _, x = x in + ( + write_alias + ) ob x + ); + Buffer.add_char ob ']'; + ) ob x; + Buffer.add_char ob ']' +) +and string_of_import_from_kind ?(len = 1024) x = + let ob = Buffer.create len in + write_import_from_kind ob x; + Buffer.contents ob and write_item ob x = ( write_stmt ) ob x @@ -8829,55 +8851,7 @@ and string_of_xml_body ?(len = 1024) x = let ob = Buffer.create len in write_xml_body ob x; Buffer.contents ob -let rec read__alias_alias_nullable_list p lb = ( - Atdgen_runtime.Oj_run.read_list ( - fun p lb -> - Yojson.Safe.read_space p lb; - let std_tuple = Yojson.Safe.start_any_tuple p lb in - let len = ref 0 in - let end_of_tuple = ref false in - (try - let x0 = - let x = - ( - read_alias - ) p lb - in - incr len; - Yojson.Safe.read_space p lb; - Yojson.Safe.read_tuple_sep2 p std_tuple lb; - x - in - let x1 = - let x = - ( - read__alias_nullable - ) p lb - in - incr len; - (try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_tuple_sep2 p std_tuple lb; - with Yojson.End_of_tuple -> end_of_tuple := true); - x - in - if not !end_of_tuple then ( - try - while true do - Yojson.Safe.skip_json p lb; - Yojson.Safe.read_space p lb; - Yojson.Safe.read_tuple_sep2 p std_tuple lb; - done - with Yojson.End_of_tuple -> () - ); - (x0, x1) - with Yojson.End_of_tuple -> - Atdgen_runtime.Oj_run.missing_tuple_fields p !len [ 0; 1 ]); - ) -) p lb -and _alias_alias_nullable_list_of_string s = - read__alias_alias_nullable_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -and read__alias_nullable p lb = ( +let rec read__alias_nullable p lb = ( fun p lb -> Yojson.Safe.read_space p lb; (if Yojson.Safe.read_null_if_possible p lb then None @@ -9717,6 +9691,13 @@ and read__ident_type_arguments_nullable_list p lb = ( ) p lb and _ident_type_arguments_nullable_list_of_string s = read__ident_type_arguments_nullable_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +and read__import_from_kind_list p lb = ( + Atdgen_runtime.Oj_run.read_list ( + read_import_from_kind + ) +) p lb +and _import_from_kind_list_of_string s = + read__import_from_kind_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) and read__item_list p lb = ( Atdgen_runtime.Oj_run.read_list ( read_item @@ -13029,7 +13010,7 @@ and read_directive = ( let x2 = let x = ( - read__alias_alias_nullable_list + read__import_from_kind_list ) p lb in incr len; @@ -13383,7 +13364,7 @@ and read_directive = ( let x2 = let x = ( - read__alias_alias_nullable_list + read__import_from_kind_list ) p lb in incr len; @@ -17780,6 +17761,150 @@ and read_id_info = ( ) and id_info_of_string s = read_id_info (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +and read_import_from_kind = ( + 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 + | "Direct" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_alias + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Direct x + | "Aliased" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + fun p lb -> + Yojson.Safe.read_space p lb; + let std_tuple = Yojson.Safe.start_any_tuple p lb in + let len = ref 0 in + let end_of_tuple = ref false in + (try + let x0 = + let x = + ( + read_ident + ) p lb + in + incr len; + Yojson.Safe.read_space p lb; + Yojson.Safe.read_tuple_sep2 p std_tuple lb; + x + in + let x1 = + let x = + ( + read_alias + ) p lb + in + incr len; + (try + Yojson.Safe.read_space p lb; + Yojson.Safe.read_tuple_sep2 p std_tuple lb; + with Yojson.End_of_tuple -> end_of_tuple := true); + x + in + if not !end_of_tuple then ( + try + while true do + Yojson.Safe.skip_json p lb; + Yojson.Safe.read_space p lb; + Yojson.Safe.read_tuple_sep2 p std_tuple lb; + done + with Yojson.End_of_tuple -> () + ); + (x0, x1) + with Yojson.End_of_tuple -> + Atdgen_runtime.Oj_run.missing_tuple_fields p !len [ 0; 1 ]); + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Aliased x + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Direct" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_alias + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + `Direct x + | "Aliased" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + fun p lb -> + Yojson.Safe.read_space p lb; + let std_tuple = Yojson.Safe.start_any_tuple p lb in + let len = ref 0 in + let end_of_tuple = ref false in + (try + let x0 = + let x = + ( + read_ident + ) p lb + in + incr len; + Yojson.Safe.read_space p lb; + Yojson.Safe.read_tuple_sep2 p std_tuple lb; + x + in + let x1 = + let x = + ( + read_alias + ) p lb + in + incr len; + (try + Yojson.Safe.read_space p lb; + Yojson.Safe.read_tuple_sep2 p std_tuple lb; + with Yojson.End_of_tuple -> end_of_tuple := true); + x + in + if not !end_of_tuple then ( + try + while true do + Yojson.Safe.skip_json p lb; + Yojson.Safe.read_space p lb; + Yojson.Safe.read_tuple_sep2 p std_tuple lb; + done + with Yojson.End_of_tuple -> () + ); + (x0, x1) + with Yojson.End_of_tuple -> + Atdgen_runtime.Oj_run.missing_tuple_fields p !len [ 0; 1 ]); + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + `Aliased x + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) +and import_from_kind_of_string s = + read_import_from_kind (Yojson.Safe.init_lexer ()) (Lexing.from_string s) and read_item p lb = ( read_stmt ) p lb diff --git a/ast_generic_v1_j.mli b/ast_generic_v1_j.mli index b1e7904..503d739 100644 --- a/ast_generic_v1_j.mli +++ b/ast_generic_v1_j.mli @@ -144,6 +144,8 @@ and id_info = Ast_generic_v1_t.id_info = { id_svalue: svalue option } +and import_from_kind = Ast_generic_v1_t.import_from_kind + and item = Ast_generic_v1_t.item and label_ident = Ast_generic_v1_t.label_ident @@ -1383,6 +1385,26 @@ val id_info_of_string : string -> id_info (** Deserialize JSON data of type {!type:id_info}. *) +val write_import_from_kind : + Buffer.t -> import_from_kind -> unit + (** Output a JSON value of type {!type:import_from_kind}. *) + +val string_of_import_from_kind : + ?len:int -> import_from_kind -> string + (** Serialize a value of type {!type:import_from_kind} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_import_from_kind : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> import_from_kind + (** Input JSON data of type {!type:import_from_kind}. *) + +val import_from_kind_of_string : + string -> import_from_kind + (** Deserialize JSON data of type {!type:import_from_kind}. *) + val write_item : Buffer.t -> item -> unit (** Output a JSON value of type {!type:item}. *) diff --git a/semgrep_output_v1.atd b/semgrep_output_v1.atd index 0d25c95..a270d8e 100644 --- a/semgrep_output_v1.atd +++ b/semgrep_output_v1.atd @@ -1152,6 +1152,9 @@ type features = { ~deepsemgrep: bool; ~dependency_query: bool; ~path_to_transitivity: bool; + (* normally we resolve dependencies for changed subprojects only in diff scans. This flag + * causes all subprojects to be resolved in diff scans *) + ~scan_all_deps_in_diff_scan: bool; } type triage_ignored = { diff --git a/semgrep_output_v1.jsonschema b/semgrep_output_v1.jsonschema index e3ebc7a..f21105a 100644 --- a/semgrep_output_v1.jsonschema +++ b/semgrep_output_v1.jsonschema @@ -852,7 +852,8 @@ "autofix": { "type": "boolean" }, "deepsemgrep": { "type": "boolean" }, "dependency_query": { "type": "boolean" }, - "path_to_transitivity": { "type": "boolean" } + "path_to_transitivity": { "type": "boolean" }, + "scan_all_deps_in_diff_scan": { "type": "boolean" } } }, "triage_ignored": { @@ -932,6 +933,7 @@ "deepsemgrep": { "type": "boolean" }, "dependency_query": { "type": "boolean" }, "path_to_transitivity": { "type": "boolean" }, + "scan_all_deps_in_diff_scan": { "type": "boolean" }, "triage_ignored_syntactic_ids": { "type": "array", "items": { "type": "string" } @@ -999,6 +1001,7 @@ "deepsemgrep": { "type": "boolean" }, "dependency_query": { "type": "boolean" }, "path_to_transitivity": { "type": "boolean" }, + "scan_all_deps_in_diff_scan": { "type": "boolean" }, "ignored_files": { "type": "array", "items": { "type": "string" } }, "product_ignored_files": { "$ref": "#/definitions/product_ignored_files" @@ -1444,7 +1447,8 @@ "autofix": { "type": "boolean" }, "deepsemgrep": { "type": "boolean" }, "dependency_query": { "type": "boolean" }, - "path_to_transitivity": { "type": "boolean" } + "path_to_transitivity": { "type": "boolean" }, + "scan_all_deps_in_diff_scan": { "type": "boolean" } } }, "ci_env": { diff --git a/semgrep_output_v1.proto b/semgrep_output_v1.proto index 9a47fa5..548ef31 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: 4c4133c7adab129a370e0fb7a071620321e181412c14609d09e81f0865d39b6e +// Source file sha256 digest: 9133678c7f6d6a5ba2337316cb0777b2f614ef5781f6c940f49ed654c7d31172 syntax = "proto3"; @@ -296,6 +296,7 @@ message Features { bool deepsemgrep = 444846865; bool dependency_query = 471197362; bool path_to_transitivity = 52910370; + bool scan_all_deps_in_diff_scan = 261708029; } message TriageIgnored { @@ -332,6 +333,7 @@ message ScanConfig { bool deepsemgrep = 444846865; bool dependency_query = 471197362; bool path_to_transitivity = 52910370; + bool scan_all_deps_in_diff_scan = 261708029; repeated string triage_ignored_syntactic_ids = 211590151; repeated string triage_ignored_match_based_ids = 327942260; repeated string ignored_files = 482076310; @@ -364,6 +366,7 @@ message EngineConfiguration { bool deepsemgrep = 444846865; bool dependency_query = 471197362; bool path_to_transitivity = 52910370; + bool scan_all_deps_in_diff_scan = 261708029; repeated string ignored_files = 482076310; repeated google.protobuf.Any product_ignored_files = 298217262; bool generic_slow_rollout = 78139686; @@ -572,6 +575,7 @@ message CiConfig { bool deepsemgrep = 444846865; bool dependency_query = 471197362; bool path_to_transitivity = 52910370; + bool scan_all_deps_in_diff_scan = 261708029; } message CoreOutput { diff --git a/semgrep_output_v1.py b/semgrep_output_v1.py index a84033b..efc765c 100644 --- a/semgrep_output_v1.py +++ b/semgrep_output_v1.py @@ -4912,6 +4912,7 @@ class EngineConfiguration: deepsemgrep: bool = field(default_factory=lambda: False) dependency_query: bool = field(default_factory=lambda: False) path_to_transitivity: bool = field(default_factory=lambda: False) + scan_all_deps_in_diff_scan: bool = field(default_factory=lambda: False) ignored_files: List[str] = field(default_factory=lambda: []) product_ignored_files: Optional[ProductIgnoredFiles] = None generic_slow_rollout: bool = field(default_factory=lambda: False) @@ -4926,6 +4927,7 @@ def from_json(cls, x: Any) -> 'EngineConfiguration': deepsemgrep=_atd_read_bool(x['deepsemgrep']) if 'deepsemgrep' in x else False, dependency_query=_atd_read_bool(x['dependency_query']) if 'dependency_query' in x else False, path_to_transitivity=_atd_read_bool(x['path_to_transitivity']) if 'path_to_transitivity' in x else False, + scan_all_deps_in_diff_scan=_atd_read_bool(x['scan_all_deps_in_diff_scan']) if 'scan_all_deps_in_diff_scan' in x else False, ignored_files=_atd_read_list(_atd_read_string)(x['ignored_files']) if 'ignored_files' in x else [], product_ignored_files=ProductIgnoredFiles.from_json(x['product_ignored_files']) if 'product_ignored_files' in x else None, generic_slow_rollout=_atd_read_bool(x['generic_slow_rollout']) if 'generic_slow_rollout' in x else False, @@ -4941,6 +4943,7 @@ def to_json(self) -> Any: res['deepsemgrep'] = _atd_write_bool(self.deepsemgrep) res['dependency_query'] = _atd_write_bool(self.dependency_query) res['path_to_transitivity'] = _atd_write_bool(self.path_to_transitivity) + res['scan_all_deps_in_diff_scan'] = _atd_write_bool(self.scan_all_deps_in_diff_scan) res['ignored_files'] = _atd_write_list(_atd_write_string)(self.ignored_files) if self.product_ignored_files is not None: res['product_ignored_files'] = (lambda x: x.to_json())(self.product_ignored_files) @@ -5251,6 +5254,7 @@ class CiConfig: deepsemgrep: bool = field(default_factory=lambda: False) dependency_query: bool = field(default_factory=lambda: False) path_to_transitivity: bool = field(default_factory=lambda: False) + scan_all_deps_in_diff_scan: bool = field(default_factory=lambda: False) @classmethod def from_json(cls, x: Any) -> 'CiConfig': @@ -5263,6 +5267,7 @@ def from_json(cls, x: Any) -> 'CiConfig': deepsemgrep=_atd_read_bool(x['deepsemgrep']) if 'deepsemgrep' in x else False, dependency_query=_atd_read_bool(x['dependency_query']) if 'dependency_query' in x else False, path_to_transitivity=_atd_read_bool(x['path_to_transitivity']) if 'path_to_transitivity' in x else False, + scan_all_deps_in_diff_scan=_atd_read_bool(x['scan_all_deps_in_diff_scan']) if 'scan_all_deps_in_diff_scan' in x else False, ) else: _atd_bad_json('CiConfig', x) @@ -5276,6 +5281,7 @@ def to_json(self) -> Any: res['deepsemgrep'] = _atd_write_bool(self.deepsemgrep) res['dependency_query'] = _atd_write_bool(self.dependency_query) res['path_to_transitivity'] = _atd_write_bool(self.path_to_transitivity) + res['scan_all_deps_in_diff_scan'] = _atd_write_bool(self.scan_all_deps_in_diff_scan) return res @classmethod @@ -5426,6 +5432,7 @@ class ScanConfig: deepsemgrep: bool = field(default_factory=lambda: False) dependency_query: bool = field(default_factory=lambda: False) path_to_transitivity: bool = field(default_factory=lambda: False) + scan_all_deps_in_diff_scan: bool = field(default_factory=lambda: False) triage_ignored_syntactic_ids: List[str] = field(default_factory=lambda: []) triage_ignored_match_based_ids: List[str] = field(default_factory=lambda: []) ignored_files: List[str] = field(default_factory=lambda: []) @@ -5445,6 +5452,7 @@ def from_json(cls, x: Any) -> 'ScanConfig': deepsemgrep=_atd_read_bool(x['deepsemgrep']) if 'deepsemgrep' in x else False, dependency_query=_atd_read_bool(x['dependency_query']) if 'dependency_query' in x else False, path_to_transitivity=_atd_read_bool(x['path_to_transitivity']) if 'path_to_transitivity' in x else False, + scan_all_deps_in_diff_scan=_atd_read_bool(x['scan_all_deps_in_diff_scan']) if 'scan_all_deps_in_diff_scan' in x else False, triage_ignored_syntactic_ids=_atd_read_list(_atd_read_string)(x['triage_ignored_syntactic_ids']) if 'triage_ignored_syntactic_ids' in x else [], triage_ignored_match_based_ids=_atd_read_list(_atd_read_string)(x['triage_ignored_match_based_ids']) if 'triage_ignored_match_based_ids' in x else [], ignored_files=_atd_read_list(_atd_read_string)(x['ignored_files']) if 'ignored_files' in x else [], @@ -5465,6 +5473,7 @@ def to_json(self) -> Any: res['deepsemgrep'] = _atd_write_bool(self.deepsemgrep) res['dependency_query'] = _atd_write_bool(self.dependency_query) res['path_to_transitivity'] = _atd_write_bool(self.path_to_transitivity) + res['scan_all_deps_in_diff_scan'] = _atd_write_bool(self.scan_all_deps_in_diff_scan) res['triage_ignored_syntactic_ids'] = _atd_write_list(_atd_write_string)(self.triage_ignored_syntactic_ids) res['triage_ignored_match_based_ids'] = _atd_write_list(_atd_write_string)(self.triage_ignored_match_based_ids) res['ignored_files'] = _atd_write_list(_atd_write_string)(self.ignored_files) @@ -8745,6 +8754,7 @@ class Features: deepsemgrep: bool = field(default_factory=lambda: False) dependency_query: bool = field(default_factory=lambda: False) path_to_transitivity: bool = field(default_factory=lambda: False) + scan_all_deps_in_diff_scan: bool = field(default_factory=lambda: False) @classmethod def from_json(cls, x: Any) -> 'Features': @@ -8754,6 +8764,7 @@ def from_json(cls, x: Any) -> 'Features': deepsemgrep=_atd_read_bool(x['deepsemgrep']) if 'deepsemgrep' in x else False, dependency_query=_atd_read_bool(x['dependency_query']) if 'dependency_query' in x else False, path_to_transitivity=_atd_read_bool(x['path_to_transitivity']) if 'path_to_transitivity' in x else False, + scan_all_deps_in_diff_scan=_atd_read_bool(x['scan_all_deps_in_diff_scan']) if 'scan_all_deps_in_diff_scan' in x else False, ) else: _atd_bad_json('Features', x) @@ -8764,6 +8775,7 @@ def to_json(self) -> Any: res['deepsemgrep'] = _atd_write_bool(self.deepsemgrep) res['dependency_query'] = _atd_write_bool(self.dependency_query) res['path_to_transitivity'] = _atd_write_bool(self.path_to_transitivity) + res['scan_all_deps_in_diff_scan'] = _atd_write_bool(self.scan_all_deps_in_diff_scan) return res @classmethod diff --git a/semgrep_output_v1.ts b/semgrep_output_v1.ts index 161a1cc..39b450a 100644 --- a/semgrep_output_v1.ts +++ b/semgrep_output_v1.ts @@ -467,6 +467,7 @@ export type Features = { deepsemgrep: boolean; dependency_query: boolean; path_to_transitivity: boolean; + scan_all_deps_in_diff_scan: boolean; } export type TriageIgnored = { @@ -510,6 +511,7 @@ export type ScanConfig = { deepsemgrep: boolean; dependency_query: boolean; path_to_transitivity: boolean; + scan_all_deps_in_diff_scan: boolean; triage_ignored_syntactic_ids: string[]; triage_ignored_match_based_ids: string[]; ignored_files: string[]; @@ -542,6 +544,7 @@ export type EngineConfiguration = { deepsemgrep: boolean; dependency_query: boolean; path_to_transitivity: boolean; + scan_all_deps_in_diff_scan: boolean; ignored_files: string[]; product_ignored_files?: ProductIgnoredFiles; generic_slow_rollout: boolean; @@ -789,6 +792,7 @@ export type CiConfig = { deepsemgrep: boolean; dependency_query: boolean; path_to_transitivity: boolean; + scan_all_deps_in_diff_scan: boolean; } export type CiEnv = Map @@ -2524,6 +2528,7 @@ export function writeFeatures(x: Features, context: any = x): any { 'deepsemgrep': _atd_write_field_with_default(_atd_write_bool, false, x.deepsemgrep, x), 'dependency_query': _atd_write_field_with_default(_atd_write_bool, false, x.dependency_query, x), 'path_to_transitivity': _atd_write_field_with_default(_atd_write_bool, false, x.path_to_transitivity, x), + 'scan_all_deps_in_diff_scan': _atd_write_field_with_default(_atd_write_bool, false, x.scan_all_deps_in_diff_scan, x), }; } @@ -2533,6 +2538,7 @@ export function readFeatures(x: any, context: any = x): Features { deepsemgrep: _atd_read_field_with_default(_atd_read_bool, false, x['deepsemgrep'], x), dependency_query: _atd_read_field_with_default(_atd_read_bool, false, x['dependency_query'], x), path_to_transitivity: _atd_read_field_with_default(_atd_read_bool, false, x['path_to_transitivity'], x), + scan_all_deps_in_diff_scan: _atd_read_field_with_default(_atd_read_bool, false, x['scan_all_deps_in_diff_scan'], x), }; } @@ -2642,6 +2648,7 @@ export function writeScanConfig(x: ScanConfig, context: any = x): any { 'deepsemgrep': _atd_write_field_with_default(_atd_write_bool, false, x.deepsemgrep, x), 'dependency_query': _atd_write_field_with_default(_atd_write_bool, false, x.dependency_query, x), 'path_to_transitivity': _atd_write_field_with_default(_atd_write_bool, false, x.path_to_transitivity, x), + 'scan_all_deps_in_diff_scan': _atd_write_field_with_default(_atd_write_bool, false, x.scan_all_deps_in_diff_scan, x), 'triage_ignored_syntactic_ids': _atd_write_field_with_default(_atd_write_array(_atd_write_string), [], x.triage_ignored_syntactic_ids, x), 'triage_ignored_match_based_ids': _atd_write_field_with_default(_atd_write_array(_atd_write_string), [], x.triage_ignored_match_based_ids, x), 'ignored_files': _atd_write_field_with_default(_atd_write_array(_atd_write_string), [], x.ignored_files, x), @@ -2661,6 +2668,7 @@ export function readScanConfig(x: any, context: any = x): ScanConfig { deepsemgrep: _atd_read_field_with_default(_atd_read_bool, false, x['deepsemgrep'], x), dependency_query: _atd_read_field_with_default(_atd_read_bool, false, x['dependency_query'], x), path_to_transitivity: _atd_read_field_with_default(_atd_read_bool, false, x['path_to_transitivity'], x), + scan_all_deps_in_diff_scan: _atd_read_field_with_default(_atd_read_bool, false, x['scan_all_deps_in_diff_scan'], x), triage_ignored_syntactic_ids: _atd_read_field_with_default(_atd_read_array(_atd_read_string), [], x['triage_ignored_syntactic_ids'], x), triage_ignored_match_based_ids: _atd_read_field_with_default(_atd_read_array(_atd_read_string), [], x['triage_ignored_match_based_ids'], x), ignored_files: _atd_read_field_with_default(_atd_read_array(_atd_read_string), [], x['ignored_files'], x), @@ -2726,6 +2734,7 @@ export function writeEngineConfiguration(x: EngineConfiguration, context: any = 'deepsemgrep': _atd_write_field_with_default(_atd_write_bool, false, x.deepsemgrep, x), 'dependency_query': _atd_write_field_with_default(_atd_write_bool, false, x.dependency_query, x), 'path_to_transitivity': _atd_write_field_with_default(_atd_write_bool, false, x.path_to_transitivity, x), + 'scan_all_deps_in_diff_scan': _atd_write_field_with_default(_atd_write_bool, false, x.scan_all_deps_in_diff_scan, x), 'ignored_files': _atd_write_field_with_default(_atd_write_array(_atd_write_string), [], x.ignored_files, x), 'product_ignored_files': _atd_write_optional_field(writeProductIgnoredFiles, x.product_ignored_files, x), 'generic_slow_rollout': _atd_write_field_with_default(_atd_write_bool, false, x.generic_slow_rollout, x), @@ -2740,6 +2749,7 @@ export function readEngineConfiguration(x: any, context: any = x): EngineConfigu deepsemgrep: _atd_read_field_with_default(_atd_read_bool, false, x['deepsemgrep'], x), dependency_query: _atd_read_field_with_default(_atd_read_bool, false, x['dependency_query'], x), path_to_transitivity: _atd_read_field_with_default(_atd_read_bool, false, x['path_to_transitivity'], x), + scan_all_deps_in_diff_scan: _atd_read_field_with_default(_atd_read_bool, false, x['scan_all_deps_in_diff_scan'], x), ignored_files: _atd_read_field_with_default(_atd_read_array(_atd_read_string), [], x['ignored_files'], x), product_ignored_files: _atd_read_optional_field(readProductIgnoredFiles, x['product_ignored_files'], x), generic_slow_rollout: _atd_read_field_with_default(_atd_read_bool, false, x['generic_slow_rollout'], x), @@ -3407,6 +3417,7 @@ export function writeCiConfig(x: CiConfig, context: any = x): any { 'deepsemgrep': _atd_write_field_with_default(_atd_write_bool, false, x.deepsemgrep, x), 'dependency_query': _atd_write_field_with_default(_atd_write_bool, false, x.dependency_query, x), 'path_to_transitivity': _atd_write_field_with_default(_atd_write_bool, false, x.path_to_transitivity, x), + 'scan_all_deps_in_diff_scan': _atd_write_field_with_default(_atd_write_bool, false, x.scan_all_deps_in_diff_scan, x), }; } @@ -3419,6 +3430,7 @@ export function readCiConfig(x: any, context: any = x): CiConfig { deepsemgrep: _atd_read_field_with_default(_atd_read_bool, false, x['deepsemgrep'], x), dependency_query: _atd_read_field_with_default(_atd_read_bool, false, x['dependency_query'], x), path_to_transitivity: _atd_read_field_with_default(_atd_read_bool, false, x['path_to_transitivity'], x), + scan_all_deps_in_diff_scan: _atd_read_field_with_default(_atd_read_bool, false, x['scan_all_deps_in_diff_scan'], x), }; } diff --git a/semgrep_output_v1_j.ml b/semgrep_output_v1_j.ml index e70c9eb..91e88ad 100644 --- a/semgrep_output_v1_j.ml +++ b/semgrep_output_v1_j.ml @@ -386,6 +386,7 @@ type engine_configuration = Semgrep_output_v1_t.engine_configuration = { deepsemgrep: bool; dependency_query: bool; path_to_transitivity: bool; + scan_all_deps_in_diff_scan: bool; ignored_files: string list; product_ignored_files: product_ignored_files option; generic_slow_rollout: bool; @@ -458,7 +459,8 @@ type ci_config = Semgrep_output_v1_t.ci_config = { autofix: bool; deepsemgrep: bool; dependency_query: bool; - path_to_transitivity: bool + path_to_transitivity: bool; + scan_all_deps_in_diff_scan: bool } type action = Semgrep_output_v1_t.action @@ -479,6 +481,7 @@ type scan_config = Semgrep_output_v1_t.scan_config = { deepsemgrep: bool; dependency_query: bool; path_to_transitivity: bool; + scan_all_deps_in_diff_scan: bool; triage_ignored_syntactic_ids: string list; triage_ignored_match_based_ids: string list; ignored_files: string list; @@ -793,7 +796,8 @@ type features = Semgrep_output_v1_t.features = { autofix: bool; deepsemgrep: bool; dependency_query: bool; - path_to_transitivity: bool + path_to_transitivity: bool; + scan_all_deps_in_diff_scan: bool } type diff_file = Semgrep_output_v1_t.diff_file = { @@ -14108,6 +14112,15 @@ let write_engine_configuration : _ -> engine_configuration -> _ = ( ob x.path_to_transitivity; if !is_first then is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"scan_all_deps_in_diff_scan\":"; + ( + Yojson.Safe.write_bool + ) + ob x.scan_all_deps_in_diff_scan; + if !is_first then + is_first := false else Buffer.add_char ob ','; Buffer.add_string ob "\"ignored_files\":"; @@ -14169,6 +14182,7 @@ let read_engine_configuration = ( let field_deepsemgrep = ref (false) in let field_dependency_query = ref (false) in let field_path_to_transitivity = ref (false) in + let field_scan_all_deps_in_diff_scan = ref (false) in let field_ignored_files = ref ([]) in let field_product_ignored_files = ref (None) in let field_generic_slow_rollout = ref (false) in @@ -14201,7 +14215,7 @@ let read_engine_configuration = ( ) | 13 -> ( if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'g' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'd' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 'f' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'l' && String.unsafe_get s (pos+11) = 'e' && String.unsafe_get s (pos+12) = 's' then ( - 4 + 5 ) else ( -1 @@ -14217,7 +14231,7 @@ let read_engine_configuration = ( ) | 17 -> ( if String.unsafe_get s pos = 'h' && String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'c' && String.unsafe_get s (pos+8) = 'a' && String.unsafe_get s (pos+9) = 'l' && String.unsafe_get s (pos+10) = '_' && String.unsafe_get s (pos+11) = 'c' && String.unsafe_get s (pos+12) = 'o' && String.unsafe_get s (pos+13) = 'n' && String.unsafe_get s (pos+14) = 'f' && String.unsafe_get s (pos+15) = 'i' && String.unsafe_get s (pos+16) = 'g' then ( - 7 + 8 ) else ( -1 @@ -14227,7 +14241,7 @@ let read_engine_configuration = ( match String.unsafe_get s pos with | 'g' -> ( if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'c' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 'l' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'w' && String.unsafe_get s (pos+12) = '_' && String.unsafe_get s (pos+13) = 'r' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'l' && String.unsafe_get s (pos+16) = 'l' && String.unsafe_get s (pos+17) = 'o' && String.unsafe_get s (pos+18) = 'u' && String.unsafe_get s (pos+19) = 't' then ( - 6 + 7 ) else ( -1 @@ -14247,7 +14261,7 @@ let read_engine_configuration = ( ) | 21 -> ( 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) = 'd' && String.unsafe_get s (pos+4) = 'u' && 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) = 'i' && String.unsafe_get s (pos+9) = 'g' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = 'e' && String.unsafe_get s (pos+14) = 'd' && String.unsafe_get s (pos+15) = '_' && String.unsafe_get s (pos+16) = 'f' && String.unsafe_get s (pos+17) = 'i' && String.unsafe_get s (pos+18) = 'l' && String.unsafe_get s (pos+19) = 'e' && String.unsafe_get s (pos+20) = 's' then ( - 5 + 6 ) else ( -1 @@ -14255,7 +14269,15 @@ let read_engine_configuration = ( ) | 22 -> ( if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 'l' && String.unsafe_get s (pos+2) = 'w' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'y' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 'p' && String.unsafe_get s (pos+10) = 'p' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 's' && String.unsafe_get s (pos+14) = 's' && String.unsafe_get s (pos+15) = '_' && String.unsafe_get s (pos+16) = 'e' && String.unsafe_get s (pos+17) = 'r' && String.unsafe_get s (pos+18) = 'r' && String.unsafe_get s (pos+19) = 'o' && String.unsafe_get s (pos+20) = 'r' && String.unsafe_get s (pos+21) = 's' then ( - 8 + 9 + ) + else ( + -1 + ) + ) + | 26 -> ( + 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) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = '_' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 's' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'n' && String.unsafe_get s (pos+16) = '_' && String.unsafe_get s (pos+17) = 'd' && String.unsafe_get s (pos+18) = 'i' && String.unsafe_get s (pos+19) = 'f' && String.unsafe_get s (pos+20) = 'f' && String.unsafe_get s (pos+21) = '_' && String.unsafe_get s (pos+22) = 's' && String.unsafe_get s (pos+23) = 'c' && String.unsafe_get s (pos+24) = 'a' && String.unsafe_get s (pos+25) = 'n' then ( + 4 ) else ( -1 @@ -14302,6 +14324,14 @@ let read_engine_configuration = ( ); ) | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_scan_all_deps_in_diff_scan := ( + ( + Atdgen_runtime.Oj_run.read_bool + ) p lb + ); + ) + | 5 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_ignored_files := ( ( @@ -14309,7 +14339,7 @@ let read_engine_configuration = ( ) p lb ); ) - | 5 -> + | 6 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_product_ignored_files := ( Some ( @@ -14319,7 +14349,7 @@ let read_engine_configuration = ( ) ); ) - | 6 -> + | 7 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_generic_slow_rollout := ( ( @@ -14327,7 +14357,7 @@ let read_engine_configuration = ( ) p lb ); ) - | 7 -> + | 8 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_historical_config := ( Some ( @@ -14337,7 +14367,7 @@ let read_engine_configuration = ( ) ); ) - | 8 -> + | 9 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_always_suppress_errors := ( ( @@ -14376,7 +14406,7 @@ let read_engine_configuration = ( ) | 13 -> ( if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'g' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'd' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 'f' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'l' && String.unsafe_get s (pos+11) = 'e' && String.unsafe_get s (pos+12) = 's' then ( - 4 + 5 ) else ( -1 @@ -14392,7 +14422,7 @@ let read_engine_configuration = ( ) | 17 -> ( if String.unsafe_get s pos = 'h' && String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'c' && String.unsafe_get s (pos+8) = 'a' && String.unsafe_get s (pos+9) = 'l' && String.unsafe_get s (pos+10) = '_' && String.unsafe_get s (pos+11) = 'c' && String.unsafe_get s (pos+12) = 'o' && String.unsafe_get s (pos+13) = 'n' && String.unsafe_get s (pos+14) = 'f' && String.unsafe_get s (pos+15) = 'i' && String.unsafe_get s (pos+16) = 'g' then ( - 7 + 8 ) else ( -1 @@ -14402,7 +14432,7 @@ let read_engine_configuration = ( match String.unsafe_get s pos with | 'g' -> ( if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'c' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 'l' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'w' && String.unsafe_get s (pos+12) = '_' && String.unsafe_get s (pos+13) = 'r' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'l' && String.unsafe_get s (pos+16) = 'l' && String.unsafe_get s (pos+17) = 'o' && String.unsafe_get s (pos+18) = 'u' && String.unsafe_get s (pos+19) = 't' then ( - 6 + 7 ) else ( -1 @@ -14422,7 +14452,7 @@ let read_engine_configuration = ( ) | 21 -> ( 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) = 'd' && String.unsafe_get s (pos+4) = 'u' && 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) = 'i' && String.unsafe_get s (pos+9) = 'g' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = 'e' && String.unsafe_get s (pos+14) = 'd' && String.unsafe_get s (pos+15) = '_' && String.unsafe_get s (pos+16) = 'f' && String.unsafe_get s (pos+17) = 'i' && String.unsafe_get s (pos+18) = 'l' && String.unsafe_get s (pos+19) = 'e' && String.unsafe_get s (pos+20) = 's' then ( - 5 + 6 ) else ( -1 @@ -14430,7 +14460,15 @@ let read_engine_configuration = ( ) | 22 -> ( if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 'l' && String.unsafe_get s (pos+2) = 'w' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'y' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 'p' && String.unsafe_get s (pos+10) = 'p' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 's' && String.unsafe_get s (pos+14) = 's' && String.unsafe_get s (pos+15) = '_' && String.unsafe_get s (pos+16) = 'e' && String.unsafe_get s (pos+17) = 'r' && String.unsafe_get s (pos+18) = 'r' && String.unsafe_get s (pos+19) = 'o' && String.unsafe_get s (pos+20) = 'r' && String.unsafe_get s (pos+21) = 's' then ( - 8 + 9 + ) + else ( + -1 + ) + ) + | 26 -> ( + 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) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = '_' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 's' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'n' && String.unsafe_get s (pos+16) = '_' && String.unsafe_get s (pos+17) = 'd' && String.unsafe_get s (pos+18) = 'i' && String.unsafe_get s (pos+19) = 'f' && String.unsafe_get s (pos+20) = 'f' && String.unsafe_get s (pos+21) = '_' && String.unsafe_get s (pos+22) = 's' && String.unsafe_get s (pos+23) = 'c' && String.unsafe_get s (pos+24) = 'a' && String.unsafe_get s (pos+25) = 'n' then ( + 4 ) else ( -1 @@ -14477,6 +14515,14 @@ let read_engine_configuration = ( ); ) | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_scan_all_deps_in_diff_scan := ( + ( + Atdgen_runtime.Oj_run.read_bool + ) p lb + ); + ) + | 5 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_ignored_files := ( ( @@ -14484,7 +14530,7 @@ let read_engine_configuration = ( ) p lb ); ) - | 5 -> + | 6 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_product_ignored_files := ( Some ( @@ -14494,7 +14540,7 @@ let read_engine_configuration = ( ) ); ) - | 6 -> + | 7 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_generic_slow_rollout := ( ( @@ -14502,7 +14548,7 @@ let read_engine_configuration = ( ) p lb ); ) - | 7 -> + | 8 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_historical_config := ( Some ( @@ -14512,7 +14558,7 @@ let read_engine_configuration = ( ) ); ) - | 8 -> + | 9 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_always_suppress_errors := ( ( @@ -14533,6 +14579,7 @@ let read_engine_configuration = ( deepsemgrep = !field_deepsemgrep; dependency_query = !field_dependency_query; path_to_transitivity = !field_path_to_transitivity; + scan_all_deps_in_diff_scan = !field_scan_all_deps_in_diff_scan; ignored_files = !field_ignored_files; product_ignored_files = !field_product_ignored_files; generic_slow_rollout = !field_generic_slow_rollout; @@ -17238,6 +17285,15 @@ let write_ci_config : _ -> ci_config -> _ = ( Yojson.Safe.write_bool ) ob x.path_to_transitivity; + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"scan_all_deps_in_diff_scan\":"; + ( + Yojson.Safe.write_bool + ) + ob x.scan_all_deps_in_diff_scan; Buffer.add_char ob '}'; ) let string_of_ci_config ?(len = 1024) x = @@ -17255,6 +17311,7 @@ let read_ci_config = ( let field_deepsemgrep = ref (false) in let field_dependency_query = ref (false) in let field_path_to_transitivity = ref (false) in + let field_scan_all_deps_in_diff_scan = ref (false) in try Yojson.Safe.read_space p lb; Yojson.Safe.read_object_end lb; @@ -17326,6 +17383,14 @@ let read_ci_config = ( -1 ) ) + | 26 -> ( + 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) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = '_' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 's' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'n' && String.unsafe_get s (pos+16) = '_' && String.unsafe_get s (pos+17) = 'd' && String.unsafe_get s (pos+18) = 'i' && String.unsafe_get s (pos+19) = 'f' && String.unsafe_get s (pos+20) = 'f' && String.unsafe_get s (pos+21) = '_' && String.unsafe_get s (pos+22) = 's' && String.unsafe_get s (pos+23) = 'c' && String.unsafe_get s (pos+24) = 'a' && String.unsafe_get s (pos+25) = 'n' then ( + 7 + ) + else ( + -1 + ) + ) | _ -> ( -1 ) @@ -17390,6 +17455,14 @@ let read_ci_config = ( ) p lb ); ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_scan_all_deps_in_diff_scan := ( + ( + Atdgen_runtime.Oj_run.read_bool + ) p lb + ); + ) | _ -> ( Yojson.Safe.skip_json p lb ) @@ -17465,6 +17538,14 @@ let read_ci_config = ( -1 ) ) + | 26 -> ( + 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) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = '_' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 's' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'n' && String.unsafe_get s (pos+16) = '_' && String.unsafe_get s (pos+17) = 'd' && String.unsafe_get s (pos+18) = 'i' && String.unsafe_get s (pos+19) = 'f' && String.unsafe_get s (pos+20) = 'f' && String.unsafe_get s (pos+21) = '_' && String.unsafe_get s (pos+22) = 's' && String.unsafe_get s (pos+23) = 'c' && String.unsafe_get s (pos+24) = 'a' && String.unsafe_get s (pos+25) = 'n' then ( + 7 + ) + else ( + -1 + ) + ) | _ -> ( -1 ) @@ -17529,6 +17610,14 @@ let read_ci_config = ( ) p lb ); ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_scan_all_deps_in_diff_scan := ( + ( + Atdgen_runtime.Oj_run.read_bool + ) p lb + ); + ) | _ -> ( Yojson.Safe.skip_json p lb ) @@ -17545,6 +17634,7 @@ let read_ci_config = ( deepsemgrep = !field_deepsemgrep; dependency_query = !field_dependency_query; path_to_transitivity = !field_path_to_transitivity; + scan_all_deps_in_diff_scan = !field_scan_all_deps_in_diff_scan; } : ci_config) ) @@ -18314,6 +18404,15 @@ let write_scan_config : _ -> scan_config -> _ = ( ob x.path_to_transitivity; if !is_first then is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"scan_all_deps_in_diff_scan\":"; + ( + Yojson.Safe.write_bool + ) + ob x.scan_all_deps_in_diff_scan; + if !is_first then + is_first := false else Buffer.add_char ob ','; Buffer.add_string ob "\"triage_ignored_syntactic_ids\":"; @@ -18388,6 +18487,7 @@ let read_scan_config = ( let field_deepsemgrep = ref (false) in let field_dependency_query = ref (false) in let field_path_to_transitivity = ref (false) in + let field_scan_all_deps_in_diff_scan = ref (false) in let field_triage_ignored_syntactic_ids = ref ([]) in let field_triage_ignored_match_based_ids = ref ([]) in let field_ignored_files = ref ([]) in @@ -18408,7 +18508,7 @@ let read_scan_config = ( match String.unsafe_get s (pos+1) with | 'c' -> ( if String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 's' then ( - 12 + 13 ) else ( -1 @@ -18472,7 +18572,7 @@ let read_scan_config = ( ) | 'i' -> ( if String.unsafe_get s (pos+1) = 'g' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'd' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 'f' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'l' && String.unsafe_get s (pos+11) = 'e' && String.unsafe_get s (pos+12) = 's' then ( - 10 + 11 ) else ( -1 @@ -18502,7 +18602,7 @@ let read_scan_config = ( ) | 'e' -> ( if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'b' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'd' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 'p' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'd' && String.unsafe_get s (pos+12) = 'u' && String.unsafe_get s (pos+13) = 'c' && String.unsafe_get s (pos+14) = 't' && String.unsafe_get s (pos+15) = 's' then ( - 11 + 12 ) else ( -1 @@ -18516,7 +18616,7 @@ let read_scan_config = ( match String.unsafe_get s pos with | 'c' -> ( if String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = '_' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'f' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'g' && String.unsafe_get s (pos+9) = '_' && String.unsafe_get s (pos+10) = 'f' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'o' && String.unsafe_get s (pos+13) = 'm' && String.unsafe_get s (pos+14) = '_' && String.unsafe_get s (pos+15) = 'c' && String.unsafe_get s (pos+16) = 'l' && String.unsafe_get s (pos+17) = 'o' && String.unsafe_get s (pos+18) = 'u' && String.unsafe_get s (pos+19) = 'd' then ( - 13 + 14 ) else ( -1 @@ -18534,9 +18634,17 @@ let read_scan_config = ( -1 ) ) + | 26 -> ( + 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) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = '_' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 's' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'n' && String.unsafe_get s (pos+16) = '_' && String.unsafe_get s (pos+17) = 'd' && String.unsafe_get s (pos+18) = 'i' && String.unsafe_get s (pos+19) = 'f' && String.unsafe_get s (pos+20) = 'f' && String.unsafe_get s (pos+21) = '_' && String.unsafe_get s (pos+22) = 's' && String.unsafe_get s (pos+23) = 'c' && String.unsafe_get s (pos+24) = 'a' && String.unsafe_get s (pos+25) = 'n' then ( + 8 + ) + else ( + -1 + ) + ) | 28 -> ( if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'g' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'g' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 'd' && String.unsafe_get s (pos+14) = '_' && String.unsafe_get s (pos+15) = 's' && String.unsafe_get s (pos+16) = 'y' && String.unsafe_get s (pos+17) = 'n' && String.unsafe_get s (pos+18) = 't' && String.unsafe_get s (pos+19) = 'a' && String.unsafe_get s (pos+20) = 'c' && String.unsafe_get s (pos+21) = 't' && String.unsafe_get s (pos+22) = 'i' && String.unsafe_get s (pos+23) = 'c' && String.unsafe_get s (pos+24) = '_' && String.unsafe_get s (pos+25) = 'i' && String.unsafe_get s (pos+26) = 'd' && String.unsafe_get s (pos+27) = 's' then ( - 8 + 9 ) else ( -1 @@ -18544,7 +18652,7 @@ let read_scan_config = ( ) | 30 -> ( if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'g' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'g' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 'd' && String.unsafe_get s (pos+14) = '_' && String.unsafe_get s (pos+15) = 'm' && String.unsafe_get s (pos+16) = 'a' && String.unsafe_get s (pos+17) = 't' && String.unsafe_get s (pos+18) = 'c' && String.unsafe_get s (pos+19) = 'h' && String.unsafe_get s (pos+20) = '_' && String.unsafe_get s (pos+21) = 'b' && String.unsafe_get s (pos+22) = 'a' && String.unsafe_get s (pos+23) = 's' && String.unsafe_get s (pos+24) = 'e' && String.unsafe_get s (pos+25) = 'd' && String.unsafe_get s (pos+26) = '_' && String.unsafe_get s (pos+27) = 'i' && String.unsafe_get s (pos+28) = 'd' && String.unsafe_get s (pos+29) = 's' then ( - 9 + 10 ) else ( -1 @@ -18623,6 +18731,14 @@ let read_scan_config = ( ); ) | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_scan_all_deps_in_diff_scan := ( + ( + Atdgen_runtime.Oj_run.read_bool + ) p lb + ); + ) + | 9 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_triage_ignored_syntactic_ids := ( ( @@ -18630,7 +18746,7 @@ let read_scan_config = ( ) p lb ); ) - | 9 -> + | 10 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_triage_ignored_match_based_ids := ( ( @@ -18638,7 +18754,7 @@ let read_scan_config = ( ) p lb ); ) - | 10 -> + | 11 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_ignored_files := ( ( @@ -18646,7 +18762,7 @@ let read_scan_config = ( ) p lb ); ) - | 11 -> + | 12 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_enabled_products := ( Some ( @@ -18656,7 +18772,7 @@ let read_scan_config = ( ) ); ) - | 12 -> + | 13 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_actions := ( ( @@ -18664,7 +18780,7 @@ let read_scan_config = ( ) p lb ); ) - | 13 -> + | 14 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_ci_config_from_cloud := ( Some ( @@ -18692,7 +18808,7 @@ let read_scan_config = ( match String.unsafe_get s (pos+1) with | 'c' -> ( if String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 's' then ( - 12 + 13 ) else ( -1 @@ -18756,7 +18872,7 @@ let read_scan_config = ( ) | 'i' -> ( if String.unsafe_get s (pos+1) = 'g' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'd' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 'f' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'l' && String.unsafe_get s (pos+11) = 'e' && String.unsafe_get s (pos+12) = 's' then ( - 10 + 11 ) else ( -1 @@ -18786,7 +18902,7 @@ let read_scan_config = ( ) | 'e' -> ( if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'b' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'd' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 'p' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'd' && String.unsafe_get s (pos+12) = 'u' && String.unsafe_get s (pos+13) = 'c' && String.unsafe_get s (pos+14) = 't' && String.unsafe_get s (pos+15) = 's' then ( - 11 + 12 ) else ( -1 @@ -18800,7 +18916,7 @@ let read_scan_config = ( match String.unsafe_get s pos with | 'c' -> ( if String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = '_' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'f' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'g' && String.unsafe_get s (pos+9) = '_' && String.unsafe_get s (pos+10) = 'f' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'o' && String.unsafe_get s (pos+13) = 'm' && String.unsafe_get s (pos+14) = '_' && String.unsafe_get s (pos+15) = 'c' && String.unsafe_get s (pos+16) = 'l' && String.unsafe_get s (pos+17) = 'o' && String.unsafe_get s (pos+18) = 'u' && String.unsafe_get s (pos+19) = 'd' then ( - 13 + 14 ) else ( -1 @@ -18818,9 +18934,17 @@ let read_scan_config = ( -1 ) ) + | 26 -> ( + 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) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = '_' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 's' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'n' && String.unsafe_get s (pos+16) = '_' && String.unsafe_get s (pos+17) = 'd' && String.unsafe_get s (pos+18) = 'i' && String.unsafe_get s (pos+19) = 'f' && String.unsafe_get s (pos+20) = 'f' && String.unsafe_get s (pos+21) = '_' && String.unsafe_get s (pos+22) = 's' && String.unsafe_get s (pos+23) = 'c' && String.unsafe_get s (pos+24) = 'a' && String.unsafe_get s (pos+25) = 'n' then ( + 8 + ) + else ( + -1 + ) + ) | 28 -> ( if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'g' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'g' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 'd' && String.unsafe_get s (pos+14) = '_' && String.unsafe_get s (pos+15) = 's' && String.unsafe_get s (pos+16) = 'y' && String.unsafe_get s (pos+17) = 'n' && String.unsafe_get s (pos+18) = 't' && String.unsafe_get s (pos+19) = 'a' && String.unsafe_get s (pos+20) = 'c' && String.unsafe_get s (pos+21) = 't' && String.unsafe_get s (pos+22) = 'i' && String.unsafe_get s (pos+23) = 'c' && String.unsafe_get s (pos+24) = '_' && String.unsafe_get s (pos+25) = 'i' && String.unsafe_get s (pos+26) = 'd' && String.unsafe_get s (pos+27) = 's' then ( - 8 + 9 ) else ( -1 @@ -18828,7 +18952,7 @@ let read_scan_config = ( ) | 30 -> ( if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'g' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'g' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 'd' && String.unsafe_get s (pos+14) = '_' && String.unsafe_get s (pos+15) = 'm' && String.unsafe_get s (pos+16) = 'a' && String.unsafe_get s (pos+17) = 't' && String.unsafe_get s (pos+18) = 'c' && String.unsafe_get s (pos+19) = 'h' && String.unsafe_get s (pos+20) = '_' && String.unsafe_get s (pos+21) = 'b' && String.unsafe_get s (pos+22) = 'a' && String.unsafe_get s (pos+23) = 's' && String.unsafe_get s (pos+24) = 'e' && String.unsafe_get s (pos+25) = 'd' && String.unsafe_get s (pos+26) = '_' && String.unsafe_get s (pos+27) = 'i' && String.unsafe_get s (pos+28) = 'd' && String.unsafe_get s (pos+29) = 's' then ( - 9 + 10 ) else ( -1 @@ -18907,6 +19031,14 @@ let read_scan_config = ( ); ) | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_scan_all_deps_in_diff_scan := ( + ( + Atdgen_runtime.Oj_run.read_bool + ) p lb + ); + ) + | 9 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_triage_ignored_syntactic_ids := ( ( @@ -18914,7 +19046,7 @@ let read_scan_config = ( ) p lb ); ) - | 9 -> + | 10 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_triage_ignored_match_based_ids := ( ( @@ -18922,7 +19054,7 @@ let read_scan_config = ( ) p lb ); ) - | 10 -> + | 11 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_ignored_files := ( ( @@ -18930,7 +19062,7 @@ let read_scan_config = ( ) p lb ); ) - | 11 -> + | 12 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_enabled_products := ( Some ( @@ -18940,7 +19072,7 @@ let read_scan_config = ( ) ); ) - | 12 -> + | 13 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_actions := ( ( @@ -18948,7 +19080,7 @@ let read_scan_config = ( ) p lb ); ) - | 13 -> + | 14 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_ci_config_from_cloud := ( Some ( @@ -18975,6 +19107,7 @@ let read_scan_config = ( deepsemgrep = !field_deepsemgrep; dependency_query = !field_dependency_query; path_to_transitivity = !field_path_to_transitivity; + scan_all_deps_in_diff_scan = !field_scan_all_deps_in_diff_scan; triage_ignored_syntactic_ids = !field_triage_ignored_syntactic_ids; triage_ignored_match_based_ids = !field_triage_ignored_match_based_ids; ignored_files = !field_ignored_files; @@ -31484,6 +31617,15 @@ let write_features : _ -> features -> _ = ( Yojson.Safe.write_bool ) ob x.path_to_transitivity; + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"scan_all_deps_in_diff_scan\":"; + ( + Yojson.Safe.write_bool + ) + ob x.scan_all_deps_in_diff_scan; Buffer.add_char ob '}'; ) let string_of_features ?(len = 1024) x = @@ -31498,6 +31640,7 @@ let read_features = ( let field_deepsemgrep = ref (false) in let field_dependency_query = ref (false) in let field_path_to_transitivity = ref (false) in + let field_scan_all_deps_in_diff_scan = ref (false) in try Yojson.Safe.read_space p lb; Yojson.Safe.read_object_end lb; @@ -31539,6 +31682,14 @@ let read_features = ( -1 ) ) + | 26 -> ( + 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) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = '_' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 's' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'n' && String.unsafe_get s (pos+16) = '_' && String.unsafe_get s (pos+17) = 'd' && String.unsafe_get s (pos+18) = 'i' && String.unsafe_get s (pos+19) = 'f' && String.unsafe_get s (pos+20) = 'f' && String.unsafe_get s (pos+21) = '_' && String.unsafe_get s (pos+22) = 's' && String.unsafe_get s (pos+23) = 'c' && String.unsafe_get s (pos+24) = 'a' && String.unsafe_get s (pos+25) = 'n' then ( + 4 + ) + else ( + -1 + ) + ) | _ -> ( -1 ) @@ -31579,6 +31730,14 @@ let read_features = ( ) p lb ); ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_scan_all_deps_in_diff_scan := ( + ( + Atdgen_runtime.Oj_run.read_bool + ) p lb + ); + ) | _ -> ( Yojson.Safe.skip_json p lb ) @@ -31624,6 +31783,14 @@ let read_features = ( -1 ) ) + | 26 -> ( + 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) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = '_' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 's' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'n' && String.unsafe_get s (pos+16) = '_' && String.unsafe_get s (pos+17) = 'd' && String.unsafe_get s (pos+18) = 'i' && String.unsafe_get s (pos+19) = 'f' && String.unsafe_get s (pos+20) = 'f' && String.unsafe_get s (pos+21) = '_' && String.unsafe_get s (pos+22) = 's' && String.unsafe_get s (pos+23) = 'c' && String.unsafe_get s (pos+24) = 'a' && String.unsafe_get s (pos+25) = 'n' then ( + 4 + ) + else ( + -1 + ) + ) | _ -> ( -1 ) @@ -31664,6 +31831,14 @@ let read_features = ( ) p lb ); ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_scan_all_deps_in_diff_scan := ( + ( + Atdgen_runtime.Oj_run.read_bool + ) p lb + ); + ) | _ -> ( Yojson.Safe.skip_json p lb ) @@ -31677,6 +31852,7 @@ let read_features = ( deepsemgrep = !field_deepsemgrep; dependency_query = !field_dependency_query; path_to_transitivity = !field_path_to_transitivity; + scan_all_deps_in_diff_scan = !field_scan_all_deps_in_diff_scan; } : features) ) diff --git a/semgrep_output_v1_j.mli b/semgrep_output_v1_j.mli index 4ed0169..f195d5f 100644 --- a/semgrep_output_v1_j.mli +++ b/semgrep_output_v1_j.mli @@ -386,6 +386,7 @@ type engine_configuration = Semgrep_output_v1_t.engine_configuration = { deepsemgrep: bool; dependency_query: bool; path_to_transitivity: bool; + scan_all_deps_in_diff_scan: bool; ignored_files: string list; product_ignored_files: product_ignored_files option; generic_slow_rollout: bool; @@ -458,7 +459,8 @@ type ci_config = Semgrep_output_v1_t.ci_config = { autofix: bool; deepsemgrep: bool; dependency_query: bool; - path_to_transitivity: bool + path_to_transitivity: bool; + scan_all_deps_in_diff_scan: bool } type action = Semgrep_output_v1_t.action @@ -479,6 +481,7 @@ type scan_config = Semgrep_output_v1_t.scan_config = { deepsemgrep: bool; dependency_query: bool; path_to_transitivity: bool; + scan_all_deps_in_diff_scan: bool; triage_ignored_syntactic_ids: string list; triage_ignored_match_based_ids: string list; ignored_files: string list; @@ -793,7 +796,8 @@ type features = Semgrep_output_v1_t.features = { autofix: bool; deepsemgrep: bool; dependency_query: bool; - path_to_transitivity: bool + path_to_transitivity: bool; + scan_all_deps_in_diff_scan: bool } type diff_file = Semgrep_output_v1_t.diff_file = {