From 1d13c0e0c889a4ce0485d6f01666a08374cc6ea6 Mon Sep 17 00:00:00 2001 From: Brandon Wu <49291449+brandonspark@users.noreply.github.com> Date: Wed, 15 Jan 2025 13:02:35 -0800 Subject: [PATCH 1/3] chore: add `id_info` to `ImportFrom` (#332) As title. It seems that our `Makefile` is improperly specified and does not regenerate `ast_generic_v1.py`. I fixed this in this PR also. - [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! --- Makefile | 1 + ast_generic_v1.atd | 7 ++- ast_generic_v1.py | 114 +++++++++++++++++++++++---------- ast_generic_v1_j.ml | 150 ++++++++++++++++++++++---------------------- 4 files changed, 162 insertions(+), 110 deletions(-) diff --git a/Makefile b/Makefile index 1c599bd8..2c4166d4 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,7 @@ FILES= \ semgrep_output_$(VER).ts \ semgrep_output_$(VER).jsonschema \ semgrep_output_$(VER).proto \ + ast_generic_$(VER).py \ ast_generic_$(VER)_j.ml \ ast_generic_$(VER)_j.mli \ Language.ml \ diff --git a/ast_generic_v1.atd b/ast_generic_v1.atd index 1884a88a..991ea75b 100644 --- a/ast_generic_v1.atd +++ b/ast_generic_v1.atd @@ -966,7 +966,7 @@ type directive = [ | ImportFrom of ( tok (* 'import'/'from' for Python, 'include' for C *) * module_name - * (ident * alias nullable (* as name alias *)) list + * import_from_kind list ) | ImportAs of (tok * module_name * alias nullable) (* as name *) @@ -987,6 +987,11 @@ type directive = [ (* ... as name *) type alias = (ident * id_info) +type import_from_kind = [ + | Direct of alias + | Aliased of (ident * alias) + ] + (*****************************************************************************) (* Toplevel *) (*****************************************************************************) diff --git a/ast_generic_v1.py b/ast_generic_v1.py index e68b368a..6a307e3c 100644 --- a/ast_generic_v1.py +++ b/ast_generic_v1.py @@ -9,7 +9,7 @@ # Import annotations to allow forward references from __future__ import annotations -from dataclasses import dataclass +from dataclasses import dataclass, field from typing import Any, Callable, Dict, List, NoReturn, Optional, Tuple, Union import json @@ -137,6 +137,19 @@ def read_nullable(x: Any) -> Any: return read_nullable +def _atd_read_option(read_elt: Callable[[Any], Any]) \ + -> Callable[[Optional[Any]], Optional[Any]]: + def read_option(x: Any) -> Any: + if x == 'None': + return None + elif isinstance(x, List) and len(x) == 2 and x[0] == 'Some': + return read_elt(x[1]) + else: + _atd_bad_json('option', x) + raise AssertionError('impossible') # keep mypy happy + return read_option + + def _atd_write_unit(x: Any) -> None: if x is None: return x @@ -232,6 +245,16 @@ def write_nullable(x: Any) -> Any: return write_nullable +def _atd_write_option(write_elt: Callable[[Any], Any]) \ + -> Callable[[Optional[Any]], Optional[Any]]: + def write_option(x: Any) -> Any: + if x is None: + return 'None' + else: + return ['Some', write_elt(x)] + return write_option + + ############################################################################ # Public classes ############################################################################ @@ -2307,6 +2330,7 @@ def to_json() -> Any: def to_json_string(self, **kw: Any) -> str: return json.dumps(self.to_json(), **kw) + @dataclass class LDA: """Original type: operator = [ ... | LDA | ... ]""" @@ -2323,6 +2347,7 @@ def to_json() -> Any: def to_json_string(self, **kw: Any) -> str: return json.dumps(self.to_json(), **kw) + @dataclass class RDA: """Original type: operator = [ ... | RDA | ... ]""" @@ -2339,6 +2364,7 @@ def to_json() -> Any: def to_json_string(self, **kw: Any) -> str: return json.dumps(self.to_json(), **kw) + @dataclass class LSA: """Original type: operator = [ ... | LSA | ... ]""" @@ -2355,6 +2381,7 @@ def to_json() -> Any: def to_json_string(self, **kw: Any) -> str: return json.dumps(self.to_json(), **kw) + @dataclass class RSA: """Original type: operator = [ ... | RSA | ... ]""" @@ -2619,6 +2646,23 @@ def to_json_string(self, **kw: Any) -> str: return json.dumps(self.to_json(), **kw) +@dataclass +class Cls: + """Original type: special = [ ... | Cls | ... ]""" + + @property + def kind(self) -> str: + """Name of the class representing this variant.""" + return 'Cls' + + @staticmethod + def to_json() -> Any: + return 'Cls' + + def to_json_string(self, **kw: Any) -> str: + return json.dumps(self.to_json(), **kw) + + @dataclass class Self: """Original type: special = [ ... | Self | ... ]""" @@ -2917,7 +2961,7 @@ def to_json_string(self, **kw: Any) -> str: class Special: """Original type: special = [ ... ]""" - value: Union[This, Super, Self, Parent, Eval, Typeof, Instanceof, Sizeof, Defined, ConcatString, EncodedString, InterpolatedElement, Spread, HashSplat, ForOf, Op, IncrDecr_, Require, OtherSpecial] + value: Union[This, Super, Cls, Self, Parent, Eval, Typeof, Instanceof, Sizeof, Defined, ConcatString, EncodedString, InterpolatedElement, Spread, HashSplat, ForOf, Op, IncrDecr_, Require, OtherSpecial] @property def kind(self) -> str: @@ -2931,6 +2975,8 @@ def from_json(cls, x: Any) -> 'Special': return cls(This()) if x == 'Super': return cls(Super()) + if x == 'Cls': + return cls(Cls()) if x == 'Self': return cls(Self()) if x == 'Parent': @@ -3196,27 +3242,6 @@ def to_json_string(self, **kw: Any) -> str: return json.dumps(self.to_json(), **kw) -@dataclass -class IntNullableWrap: - """Original type: _int_nullable_wrap""" - - value: Tuple[Optional[int], Tok] - - @classmethod - def from_json(cls, x: Any) -> 'IntNullableWrap': - return cls((lambda x: (_atd_read_nullable(_atd_read_int)(x[0]), Tok.from_json(x[1])) if isinstance(x, list) and len(x) == 2 else _atd_bad_json('array of length 2', x))(x)) - - def to_json(self) -> Any: - return (lambda x: [_atd_write_nullable(_atd_write_int)(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) - - @classmethod - def from_json_string(cls, x: str) -> 'IntNullableWrap': - return cls.from_json(json.loads(x)) - - def to_json_string(self, **kw: Any) -> str: - return json.dumps(self.to_json(), **kw) - - @dataclass class IntWrap: """Original type: _int_wrap""" @@ -3343,6 +3368,27 @@ def to_json_string(self, **kw: Any) -> str: return json.dumps(self.to_json(), **kw) +@dataclass +class XB40703a: + """Original type: _x_b40703a""" + + value: Tuple[Optional[int], Tok] + + @classmethod + def from_json(cls, x: Any) -> 'XB40703a': + return cls((lambda x: (_atd_read_nullable(_atd_read_int)(x[0]), Tok.from_json(x[1])) if isinstance(x, list) and len(x) == 2 else _atd_bad_json('array of length 2', x))(x)) + + def to_json(self) -> Any: + return (lambda x: [_atd_write_nullable(_atd_write_int)(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) + + @classmethod + def from_json_string(cls, x: str) -> 'XB40703a': + return cls.from_json(json.loads(x)) + + def to_json_string(self, **kw: Any) -> str: + return json.dumps(self.to_json(), **kw) + + @dataclass class Ident: """Original type: ident""" @@ -3428,7 +3474,7 @@ def to_json_string(self, **kw: Any) -> str: class Int: """Original type: literal = [ ... | Int of ... | ... ]""" - value: IntNullableWrap + value: XB40703a @property def kind(self) -> str: @@ -3640,7 +3686,7 @@ def from_json(cls, x: Any) -> 'Literal': if cons == 'Bool': return cls(Bool(BoolWrap.from_json(x[1]))) if cons == 'Int': - return cls(Int(IntNullableWrap.from_json(x[1]))) + return cls(Int(XB40703a.from_json(x[1]))) if cons == 'Float': return cls(Float(FloatNullableWrap.from_json(x[1]))) if cons == 'Char': @@ -5761,7 +5807,7 @@ def to_json_string(self, **kw: Any) -> str: class ImportFrom: """Original type: directive = [ ... | ImportFrom of ... | ... ]""" - value: Tuple[Tok, ModuleName, List[Tuple[Ident, Optional[Alias]]]] + value: Tuple[Tok, ModuleName, List[Tuple[Alias, Optional[Alias]]]] @property def kind(self) -> str: @@ -5899,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: (Ident.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((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]))) 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': @@ -8117,18 +8163,18 @@ def to_json_string(self, **kw: Any) -> str: @dataclass -class PatUnderscore: - """Original type: pattern = [ ... | PatUnderscore of ... | ... ]""" +class PatWildcard: + """Original type: pattern = [ ... | PatWildcard of ... | ... ]""" value: Tok @property def kind(self) -> str: """Name of the class representing this variant.""" - return 'PatUnderscore' + return 'PatWildcard' def to_json(self) -> Any: - return ['PatUnderscore', (lambda x: x.to_json())(self.value)] + return ['PatWildcard', (lambda x: x.to_json())(self.value)] def to_json_string(self, **kw: Any) -> str: return json.dumps(self.to_json(), **kw) @@ -8246,7 +8292,7 @@ def to_json_string(self, **kw: Any) -> str: class Pattern: """Original type: pattern = [ ... ]""" - value: Union[PatLiteral, PatConstructor, PatRecord, PatId, PatTuple, PatList, PatKeyVal, PatUnderscore, PatDisj, PatTyped, PatWhen, PatAs, PatType, OtherPat] + value: Union[PatLiteral, PatConstructor, PatRecord, PatId, PatTuple, PatList, PatKeyVal, PatWildcard, PatDisj, PatTyped, PatWhen, PatAs, PatType, OtherPat] @property def kind(self) -> str: @@ -8271,8 +8317,8 @@ def from_json(cls, x: Any) -> 'Pattern': return cls(PatList(PatternListBracket.from_json(x[1]))) if cons == 'PatKeyVal': return cls(PatKeyVal((lambda x: (Pattern.from_json(x[0]), Pattern.from_json(x[1])) if isinstance(x, list) and len(x) == 2 else _atd_bad_json('array of length 2', x))(x[1]))) - if cons == 'PatUnderscore': - return cls(PatUnderscore(Tok.from_json(x[1]))) + if cons == 'PatWildcard': + return cls(PatWildcard(Tok.from_json(x[1]))) if cons == 'PatDisj': return cls(PatDisj((lambda x: (Pattern.from_json(x[0]), Pattern.from_json(x[1])) if isinstance(x, list) and len(x) == 2 else _atd_bad_json('array of length 2', x))(x[1]))) if cons == 'PatTyped': diff --git a/ast_generic_v1_j.ml b/ast_generic_v1_j.ml index 682c5d84..c4f5adc6 100644 --- a/ast_generic_v1_j.ml +++ b/ast_generic_v1_j.ml @@ -4497,7 +4497,29 @@ 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_nullable ob x = ( +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 = ( Atdgen_runtime.Oj_run.write_nullable ( write_alias ) @@ -4930,28 +4952,6 @@ and string_of__for_var_or_expr_list ?(len = 1024) x = let ob = Buffer.create len in write__for_var_or_expr_list ob x; Buffer.contents ob -and write__ident_alias_nullable_list ob x = ( - Atdgen_runtime.Oj_run.write_list ( - 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_nullable - ) ob x - ); - Buffer.add_char ob ']'; - ) -) ob x -and string_of__ident_alias_nullable_list ?(len = 1024) x = - let ob = Buffer.create len in - write__ident_alias_nullable_list ob x; - Buffer.contents ob and write__ident_type_arguments_nullable_list ob x = ( Atdgen_runtime.Oj_run.write_list ( fun ob x -> @@ -5963,7 +5963,7 @@ and write_directive = ( Buffer.add_char ob ','; (let _, _, x = x in ( - write__ident_alias_nullable_list + write__alias_alias_nullable_list ) ob x ); Buffer.add_char ob ']'; @@ -8829,7 +8829,55 @@ 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_nullable p lb = ( +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 = ( fun p lb -> Yojson.Safe.read_space p lb; (if Yojson.Safe.read_null_if_possible p lb then None @@ -9621,54 +9669,6 @@ and read__for_var_or_expr_list p lb = ( ) p lb and _for_var_or_expr_list_of_string s = read__for_var_or_expr_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -and read__ident_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_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_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 _ident_alias_nullable_list_of_string s = - read__ident_alias_nullable_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) and read__ident_type_arguments_nullable_list p lb = ( Atdgen_runtime.Oj_run.read_list ( fun p lb -> @@ -13029,7 +13029,7 @@ and read_directive = ( let x2 = let x = ( - read__ident_alias_nullable_list + read__alias_alias_nullable_list ) p lb in incr len; @@ -13383,7 +13383,7 @@ and read_directive = ( let x2 = let x = ( - read__ident_alias_nullable_list + read__alias_alias_nullable_list ) p lb in incr len; From 147dcdedd67fa57abd220e50b3395f98fb3dd6c8 Mon Sep 17 00:00:00 2001 From: Ben Kettle Date: Wed, 15 Jan 2025 14:27:33 -0800 Subject: [PATCH 2/3] 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 6a307e3c..1a69cbd3 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 c4f5adc6..040de469 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 b1e79048..503d739c 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 0d25c957..a270d8e0 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 e3ebc7ab..f21105a2 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 9a47fa55..548ef31e 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 a84033b8..efc765cf 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 161a1ccd..39b450aa 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 e70c9eb4..91e88ad4 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 4ed01692..f195d5f4 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 = { From 41bdd7f9c696916838de726a6a34fb841b2e8d0c Mon Sep 17 00:00:00 2001 From: Yoann Padioleau Date: Thu, 16 Jan 2025 09:32:57 +0100 Subject: [PATCH 3/3] Remove semgrep_version from project_metadata and meta from scan_request (#333) The backend should not use those fields anymore so we can remove them. Note that even if old versions of semgrep are still producing those fields, it is fine because when the backend is consuming the JSON, any unknown field is skipped and those fields should not be used anymore. test plan: see related PR in semgrep - [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! Co-authored-by: pad --- semgrep_output_v1.atd | 22 +-- semgrep_output_v1.jsonschema | 18 +- semgrep_output_v1.proto | 4 +- semgrep_output_v1.py | 7 - semgrep_output_v1.ts | 26 ++- semgrep_output_v1_j.ml | 314 +++++++++++++---------------------- semgrep_output_v1_j.mli | 8 +- 7 files changed, 141 insertions(+), 258 deletions(-) diff --git a/semgrep_output_v1.atd b/semgrep_output_v1.atd index a270d8e0..91010804 100644 --- a/semgrep_output_v1.atd +++ b/semgrep_output_v1.atd @@ -100,6 +100,8 @@ type uuid = string wrap (* RFC 3339 format *) type datetime = string wrap +type glob = string + (*****************************************************************************) (* Versioning *) (*****************************************************************************) @@ -494,6 +496,7 @@ type match_intermediate_var = { (* both ecosystem and transitivity below have frozen=True so the generated * classes can be hashed and put in sets (see calls to reachable_deps.add() * in semgrep SCA code) + * TODO: use , and do the same for manifest *) type ecosystem @@ -595,6 +598,7 @@ type dependency_child = { * the validity of a finding. No_validator is currently also used when no * validation has yet occurred, which if that becomes confusing we * could adjust that, by adding another state. + * TODO: use *) type validation_state @@ -948,7 +952,7 @@ type cli_output_extra = { type config_error_reason = [ | UnparsableRule -] +] type config_error = { file: fpath; @@ -1291,8 +1295,6 @@ type engine_configuration = { ~always_suppress_errors: bool; } -type glob = string - type product_ignored_files = (product * glob list) list (* We omit the usual otherwise we get a * "keys must be strings" error *) @@ -1319,18 +1321,9 @@ type deployment_response = { (* 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.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.100.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; } (* Collect information about a project from the environment, filesystem, @@ -1340,9 +1333,6 @@ type scan_request = { * clearer (while still being backward compatible) *) type project_metadata = { - (* TODO: deprecate in favor of scan_metadata.cli_version *) - semgrep_version: version; - (* TODO: use enum with *) (* "git" | "github-actions" | "gitlab-ci" | "circleci" * "jenkins" | "bitbucket" | "azure-pipelines" | "buildkite" | "travis-ci" @@ -1657,6 +1647,7 @@ type dependency_parser_error = { (* json names are to maintain backwards compatibility with the python enum it * is replacing + * TODO: use *) type sca_parser_name = [ | Gemfile_lock @@ -2015,6 +2006,7 @@ type lockfile_kind | ConanLock ] +(* TODO: use *) type manifest_kind = diff --git a/semgrep_output_v1.jsonschema b/semgrep_output_v1.jsonschema index f21105a2..ed33034d 100644 --- a/semgrep_output_v1.jsonschema +++ b/semgrep_output_v1.jsonschema @@ -41,6 +41,7 @@ "sha1": { "type": "string" }, "uuid": { "type": "string" }, "datetime": { "type": "string" }, + "glob": { "type": "string" }, "version": { "type": "string" }, "position": { "type": "object", @@ -1013,7 +1014,6 @@ "always_suppress_errors": { "type": "boolean" } } }, - "glob": { "type": "string" }, "product_ignored_files": { "type": "array", "items": { @@ -1047,22 +1047,20 @@ "properties": { "project_metadata": { "$ref": "#/definitions/project_metadata" }, "scan_metadata": { "$ref": "#/definitions/scan_metadata" }, - "project_config": { "$ref": "#/definitions/ci_config_from_repo" }, - "meta": { "$ref": "#/definitions/raw_json" } + "project_config": { "$ref": "#/definitions/ci_config_from_repo" } } }, "project_metadata": { "type": "object", "required": [ - "semgrep_version", "scan_environment", "repository", "repo_url", - "branch", "commit", "commit_title", "commit_author_email", - "commit_author_name", "commit_author_username", - "commit_author_image_url", "ci_job_url", "on", - "pull_request_author_username", "pull_request_author_image_url", - "pull_request_id", "pull_request_title", "is_full_scan" + "scan_environment", "repository", "repo_url", "branch", "commit", + "commit_title", "commit_author_email", "commit_author_name", + "commit_author_username", "commit_author_image_url", "ci_job_url", + "on", "pull_request_author_username", + "pull_request_author_image_url", "pull_request_id", + "pull_request_title", "is_full_scan" ], "properties": { - "semgrep_version": { "$ref": "#/definitions/version" }, "scan_environment": { "type": "string" }, "repository": { "type": "string" }, "repo_url": { "$ref": "#/definitions/uri" }, diff --git a/semgrep_output_v1.proto b/semgrep_output_v1.proto index 548ef31e..4b75eb87 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: 9133678c7f6d6a5ba2337316cb0777b2f614ef5781f6c940f49ed654c7d31172 +// Source file sha256 digest: 8001990de58c4148e223fc41e9ac343fee04cd84dccdd2786cd9d28cad320fe1 syntax = "proto3"; @@ -387,11 +387,9 @@ message ScanRequest { ProjectMetadata project_metadata = 24255885; ScanMetadata scan_metadata = 76122041; CiConfigFromRepo project_config = 317758767; - google.protobuf.Any meta = 3004443; } message ProjectMetadata { - string semgrep_version = 118812144; string scan_environment = 288669428; string repository = 439913047; string repo_url = 245057343; diff --git a/semgrep_output_v1.py b/semgrep_output_v1.py index efc765cf..d50f5cff 100644 --- a/semgrep_output_v1.py +++ b/semgrep_output_v1.py @@ -5040,7 +5040,6 @@ def to_json_string(self, **kw: Any) -> str: class ProjectMetadata: """Original type: project_metadata = { ... }""" - semgrep_version: Version scan_environment: str repository: str repo_url: Optional[Uri] @@ -5072,7 +5071,6 @@ class ProjectMetadata: def from_json(cls, x: Any) -> 'ProjectMetadata': if isinstance(x, dict): return cls( - semgrep_version=Version.from_json(x['semgrep_version']) if 'semgrep_version' in x else _atd_missing_json_field('ProjectMetadata', 'semgrep_version'), scan_environment=_atd_read_string(x['scan_environment']) if 'scan_environment' in x else _atd_missing_json_field('ProjectMetadata', 'scan_environment'), repository=_atd_read_string(x['repository']) if 'repository' in x else _atd_missing_json_field('ProjectMetadata', 'repository'), repo_url=_atd_read_nullable(Uri.from_json)(x['repo_url']) if 'repo_url' in x else _atd_missing_json_field('ProjectMetadata', 'repo_url'), @@ -5105,7 +5103,6 @@ def from_json(cls, x: Any) -> 'ProjectMetadata': def to_json(self) -> Any: res: Dict[str, Any] = {} - res['semgrep_version'] = (lambda x: x.to_json())(self.semgrep_version) res['scan_environment'] = _atd_write_string(self.scan_environment) res['repository'] = _atd_write_string(self.repository) res['repo_url'] = _atd_write_nullable((lambda x: x.to_json()))(self.repo_url) @@ -5190,7 +5187,6 @@ class ScanRequest: project_metadata: ProjectMetadata scan_metadata: ScanMetadata project_config: Optional[CiConfigFromRepo] = None - meta: Optional[RawJson] = None @classmethod def from_json(cls, x: Any) -> 'ScanRequest': @@ -5199,7 +5195,6 @@ def from_json(cls, x: Any) -> 'ScanRequest': 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, - meta=RawJson.from_json(x['meta']) if 'meta' in x else None, ) else: _atd_bad_json('ScanRequest', x) @@ -5210,8 +5205,6 @@ def to_json(self) -> Any: 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.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 39b450aa..f3b8c420 100644 --- a/semgrep_output_v1.ts +++ b/semgrep_output_v1.ts @@ -26,6 +26,8 @@ export type Uuid = string export type Datetime = string +export type Glob = string + export type Version = string export type Position = { @@ -552,8 +554,6 @@ export type EngineConfiguration = { always_suppress_errors: boolean; } -export type Glob = string - export type ProductIgnoredFiles = Map export type HistoricalConfiguration = { @@ -569,11 +569,9 @@ export type ScanRequest = { project_metadata: ProjectMetadata; scan_metadata: ScanMetadata; project_config?: CiConfigFromRepo; - meta?: RawJson; } export type ProjectMetadata = { - semgrep_version: Version; scan_environment: string; repository: string; repo_url: (Uri | null); @@ -1057,6 +1055,14 @@ export function readDatetime(x: any, context: any = x): Datetime { return _atd_read_string(x, context); } +export function writeGlob(x: Glob, context: any = x): any { + return _atd_write_string(x, context); +} + +export function readGlob(x: any, context: any = x): Glob { + return _atd_read_string(x, context); +} + export function writeVersion(x: Version, context: any = x): any { return _atd_write_string(x, context); } @@ -2758,14 +2764,6 @@ export function readEngineConfiguration(x: any, context: any = x): EngineConfigu }; } -export function writeGlob(x: Glob, context: any = x): any { - return _atd_write_string(x, context); -} - -export function readGlob(x: any, context: any = x): Glob { - return _atd_read_string(x, context); -} - export function writeProductIgnoredFiles(x: ProductIgnoredFiles, context: any = x): any { return _atd_write_assoc_map_to_array(writeProduct, _atd_write_array(writeGlob))(x, context); } @@ -2805,7 +2803,6 @@ export function writeScanRequest(x: ScanRequest, context: any = x): any { '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), - 'meta': _atd_write_optional_field(writeRawJson, x.meta, x), }; } @@ -2814,13 +2811,11 @@ export function readScanRequest(x: any, context: any = x): ScanRequest { 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), - meta: _atd_read_optional_field(readRawJson, x['meta'], x), }; } export function writeProjectMetadata(x: ProjectMetadata, context: any = x): any { return { - 'semgrep_version': _atd_write_required_field('ProjectMetadata', 'semgrep_version', writeVersion, x.semgrep_version, x), 'scan_environment': _atd_write_required_field('ProjectMetadata', 'scan_environment', _atd_write_string, x.scan_environment, x), 'repository': _atd_write_required_field('ProjectMetadata', 'repository', _atd_write_string, x.repository, x), 'repo_url': _atd_write_required_field('ProjectMetadata', 'repo_url', _atd_write_nullable(writeUri), x.repo_url, x), @@ -2852,7 +2847,6 @@ export function writeProjectMetadata(x: ProjectMetadata, context: any = x): any export function readProjectMetadata(x: any, context: any = x): ProjectMetadata { return { - semgrep_version: _atd_read_required_field('ProjectMetadata', 'semgrep_version', readVersion, x['semgrep_version'], x), scan_environment: _atd_read_required_field('ProjectMetadata', 'scan_environment', _atd_read_string, x['scan_environment'], x), repository: _atd_read_required_field('ProjectMetadata', 'repository', _atd_read_string, x['repository'], x), repo_url: _atd_read_required_field('ProjectMetadata', 'repo_url', _atd_read_nullable(readUri), x['repo_url'], x), diff --git a/semgrep_output_v1_j.ml b/semgrep_output_v1_j.ml index 91e88ad4..13cc6e8f 100644 --- a/semgrep_output_v1_j.ml +++ b/semgrep_output_v1_j.ml @@ -238,7 +238,9 @@ type rule_result = Semgrep_output_v1_t.rule_result = { type fixtest_result = Semgrep_output_v1_t.fixtest_result = { passed: bool } -type config_error_reason = Semgrep_output_v1_t.config_error_reason +type config_error_reason = Semgrep_output_v1_t.config_error_reason = + UnparsableRule + type config_error = Semgrep_output_v1_t.config_error = { file: fpath; @@ -409,7 +411,6 @@ type scan_metadata = Semgrep_output_v1_t.scan_metadata = { } type project_metadata = Semgrep_output_v1_t.project_metadata = { - semgrep_version: version; scan_environment: string; repository: string; repo_url: uri option; @@ -446,8 +447,7 @@ type ci_config_from_repo = Semgrep_output_v1_t.ci_config_from_repo = { type scan_request = Semgrep_output_v1_t.scan_request = { project_metadata: project_metadata; scan_metadata: scan_metadata; - project_config: ci_config_from_repo option; - meta: raw_json option + project_config: ci_config_from_repo option } type ci_env = Semgrep_output_v1_t.ci_env @@ -9458,10 +9458,10 @@ let read_fixtest_result = ( ) let fixtest_result_of_string s = read_fixtest_result (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -let write_config_error_reason = ( - fun ob x -> +let write_config_error_reason : _ -> config_error_reason -> _ = ( + fun ob (x : config_error_reason) -> match x with - | `UnparsableRule -> Buffer.add_string ob "\"unparsable_rule\"" + | UnparsableRule -> Buffer.add_string ob "\"unparsable_rule\"" ) let string_of_config_error_reason ?(len = 1024) x = let ob = Buffer.create len in @@ -9476,14 +9476,14 @@ let read_config_error_reason = ( | "unparsable_rule" -> Yojson.Safe.read_space p lb; Yojson.Safe.read_gt p lb; - `UnparsableRule + (UnparsableRule : config_error_reason) | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x ) | `Double_quote -> ( match Yojson.Safe.finish_string p lb with | "unparsable_rule" -> - `UnparsableRule + (UnparsableRule : config_error_reason) | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x ) @@ -15262,15 +15262,6 @@ let write_project_metadata : _ -> project_metadata -> _ = ( fun ob (x : project_metadata) -> Buffer.add_char ob '{'; let is_first = ref true in - if !is_first then - is_first := false - else - Buffer.add_char ob ','; - Buffer.add_string ob "\"semgrep_version\":"; - ( - write_version - ) - ob x.semgrep_version; if !is_first then is_first := false else @@ -15533,7 +15524,6 @@ let read_project_metadata = ( fun p lb -> Yojson.Safe.read_space p lb; Yojson.Safe.read_lcurl p lb; - let field_semgrep_version = ref (None) in let field_scan_environment = ref (None) in let field_repository = ref (None) in let field_repo_url = ref (None) in @@ -15571,7 +15561,7 @@ let read_project_metadata = ( match len with | 2 -> ( if String.unsafe_get s pos = 'o' && String.unsafe_get s (pos+1) = 'n' then ( - 16 + 15 ) else ( -1 @@ -15581,7 +15571,7 @@ let read_project_metadata = ( match String.unsafe_get s pos with | 'b' -> ( if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'h' then ( - 7 + 6 ) else ( -1 @@ -15589,7 +15579,7 @@ let read_project_metadata = ( ) | 'c' -> ( if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' then ( - 8 + 7 ) else ( -1 @@ -15597,7 +15587,7 @@ let read_project_metadata = ( ) | 'o' -> ( if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = '_' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'd' then ( - 5 + 4 ) else ( -1 @@ -15609,7 +15599,7 @@ let read_project_metadata = ( ) | 7 -> ( if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'd' then ( - 4 + 3 ) else ( -1 @@ -15619,7 +15609,7 @@ let read_project_metadata = ( match String.unsafe_get s pos with | 'b' -> ( if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'h' && String.unsafe_get s (pos+7) = 'a' then ( - 21 + 20 ) else ( -1 @@ -15627,7 +15617,7 @@ let read_project_metadata = ( ) | 'r' -> ( if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'u' && String.unsafe_get s (pos+6) = 'r' && String.unsafe_get s (pos+7) = 'l' then ( - 3 + 2 ) else ( -1 @@ -15639,7 +15629,7 @@ let read_project_metadata = ( ) | 9 -> ( if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = '_' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'h' && String.unsafe_get s (pos+8) = 'a' then ( - 22 + 21 ) else ( -1 @@ -15649,7 +15639,7 @@ let read_project_metadata = ( 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) = 'j' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'b' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'u' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 'l' then ( - 15 + 14 ) else ( -1 @@ -15657,7 +15647,7 @@ let read_project_metadata = ( ) | 'r' -> ( if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 's' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 'y' then ( - 2 + 1 ) else ( -1 @@ -15669,7 +15659,7 @@ let read_project_metadata = ( ) | 11 -> ( if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 's' && String.unsafe_get s (pos+2) = '_' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'c' && String.unsafe_get s (pos+9) = 'a' && String.unsafe_get s (pos+10) = 'n' then ( - 24 + 23 ) else ( -1 @@ -15679,7 +15669,7 @@ let read_project_metadata = ( match String.unsafe_get s pos with | 'c' -> ( if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'l' && String.unsafe_get s (pos+11) = 'e' then ( - 9 + 8 ) else ( -1 @@ -15690,7 +15680,7 @@ let read_project_metadata = ( match String.unsafe_get s (pos+3) with | 'c' -> ( if String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 'c' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 'n' then ( - 25 + 24 ) else ( -1 @@ -15698,7 +15688,7 @@ let read_project_metadata = ( ) | 'f' -> ( if String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 'c' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 'n' then ( - 23 + 22 ) else ( -1 @@ -15720,7 +15710,7 @@ let read_project_metadata = ( match String.unsafe_get s pos with | 'i' -> ( if String.unsafe_get s (pos+1) = 's' && String.unsafe_get s (pos+2) = '_' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 'r' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 's' && String.unsafe_get s (pos+10) = '_' && String.unsafe_get s (pos+11) = 's' && String.unsafe_get s (pos+12) = 'c' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 'n' then ( - 26 + 25 ) else ( -1 @@ -15728,15 +15718,7 @@ let read_project_metadata = ( ) | 'p' -> ( if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'q' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = '_' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'd' then ( - 19 - ) - else ( - -1 - ) - ) - | 's' -> ( - if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'g' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 'v' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'r' && String.unsafe_get s (pos+11) = 's' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'n' then ( - 0 + 18 ) else ( -1 @@ -15750,7 +15732,7 @@ let read_project_metadata = ( match String.unsafe_get s pos with | 'c' -> ( if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'm' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 's' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 'm' && String.unsafe_get s (pos+15) = 'p' then ( - 10 + 9 ) else ( -1 @@ -15758,7 +15740,7 @@ let read_project_metadata = ( ) | 's' -> ( if 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) = 'e' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 'v' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'n' && String.unsafe_get s (pos+12) = 'm' && String.unsafe_get s (pos+13) = 'e' && String.unsafe_get s (pos+14) = 'n' && String.unsafe_get s (pos+15) = 't' then ( - 1 + 0 ) else ( -1 @@ -15770,7 +15752,7 @@ let read_project_metadata = ( ) | 17 -> ( if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'p' && String.unsafe_get s (pos+9) = 'l' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 'y' && String.unsafe_get s (pos+12) = '_' && String.unsafe_get s (pos+13) = 'n' && String.unsafe_get s (pos+14) = 'a' && String.unsafe_get s (pos+15) = 'm' && String.unsafe_get s (pos+16) = 'e' then ( - 6 + 5 ) else ( -1 @@ -15780,7 +15762,7 @@ let read_project_metadata = ( match String.unsafe_get s pos with | 'c' -> ( if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'h' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'n' && String.unsafe_get s (pos+15) = 'a' && String.unsafe_get s (pos+16) = 'm' && String.unsafe_get s (pos+17) = 'e' then ( - 12 + 11 ) else ( -1 @@ -15788,7 +15770,7 @@ let read_project_metadata = ( ) | 'p' -> ( if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'q' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = '_' && String.unsafe_get s (pos+13) = 't' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 't' && String.unsafe_get s (pos+16) = 'l' && String.unsafe_get s (pos+17) = 'e' then ( - 20 + 19 ) else ( -1 @@ -15800,7 +15782,7 @@ let read_project_metadata = ( ) | 19 -> ( if String.unsafe_get s pos = 'c' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'h' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'e' && String.unsafe_get s (pos+15) = 'm' && String.unsafe_get s (pos+16) = 'a' && String.unsafe_get s (pos+17) = 'i' && String.unsafe_get s (pos+18) = 'l' then ( - 11 + 10 ) else ( -1 @@ -15808,7 +15790,7 @@ let read_project_metadata = ( ) | 22 -> ( if String.unsafe_get s pos = 'c' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'h' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'u' && String.unsafe_get s (pos+15) = 's' && String.unsafe_get s (pos+16) = 'e' && String.unsafe_get s (pos+17) = 'r' && String.unsafe_get s (pos+18) = 'n' && String.unsafe_get s (pos+19) = 'a' && String.unsafe_get s (pos+20) = 'm' && String.unsafe_get s (pos+21) = 'e' then ( - 13 + 12 ) else ( -1 @@ -15816,7 +15798,7 @@ let read_project_metadata = ( ) | 23 -> ( if String.unsafe_get s pos = 'c' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'h' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'm' && String.unsafe_get s (pos+16) = 'a' && String.unsafe_get s (pos+17) = 'g' && String.unsafe_get s (pos+18) = 'e' && String.unsafe_get s (pos+19) = '_' && String.unsafe_get s (pos+20) = 'u' && String.unsafe_get s (pos+21) = 'r' && String.unsafe_get s (pos+22) = 'l' then ( - 14 + 13 ) else ( -1 @@ -15824,7 +15806,7 @@ let read_project_metadata = ( ) | 28 -> ( if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'q' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = '_' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 'u' && String.unsafe_get s (pos+15) = 't' && String.unsafe_get s (pos+16) = 'h' && String.unsafe_get s (pos+17) = 'o' && String.unsafe_get s (pos+18) = 'r' && String.unsafe_get s (pos+19) = '_' && String.unsafe_get s (pos+20) = 'u' && String.unsafe_get s (pos+21) = 's' && String.unsafe_get s (pos+22) = 'e' && String.unsafe_get s (pos+23) = 'r' && String.unsafe_get s (pos+24) = 'n' && String.unsafe_get s (pos+25) = 'a' && String.unsafe_get s (pos+26) = 'm' && String.unsafe_get s (pos+27) = 'e' then ( - 17 + 16 ) else ( -1 @@ -15832,7 +15814,7 @@ let read_project_metadata = ( ) | 29 -> ( if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'q' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = '_' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 'u' && String.unsafe_get s (pos+15) = 't' && String.unsafe_get s (pos+16) = 'h' && String.unsafe_get s (pos+17) = 'o' && String.unsafe_get s (pos+18) = 'r' && String.unsafe_get s (pos+19) = '_' && String.unsafe_get s (pos+20) = 'i' && String.unsafe_get s (pos+21) = 'm' && String.unsafe_get s (pos+22) = 'a' && String.unsafe_get s (pos+23) = 'g' && String.unsafe_get s (pos+24) = 'e' && String.unsafe_get s (pos+25) = '_' && String.unsafe_get s (pos+26) = 'u' && String.unsafe_get s (pos+27) = 'r' && String.unsafe_get s (pos+28) = 'l' then ( - 18 + 17 ) else ( -1 @@ -15847,14 +15829,6 @@ let read_project_metadata = ( ( match i with | 0 -> - field_semgrep_version := ( - Some ( - ( - read_version - ) p lb - ) - ); - | 1 -> field_scan_environment := ( Some ( ( @@ -15862,7 +15836,7 @@ let read_project_metadata = ( ) p lb ) ); - | 2 -> + | 1 -> field_repository := ( Some ( ( @@ -15870,7 +15844,7 @@ let read_project_metadata = ( ) p lb ) ); - | 3 -> + | 2 -> field_repo_url := ( Some ( ( @@ -15878,7 +15852,7 @@ let read_project_metadata = ( ) p lb ) ); - | 4 -> + | 3 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_repo_id := ( Some ( @@ -15888,7 +15862,7 @@ let read_project_metadata = ( ) ); ) - | 5 -> + | 4 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_org_id := ( Some ( @@ -15898,7 +15872,7 @@ let read_project_metadata = ( ) ); ) - | 6 -> + | 5 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_repo_display_name := ( Some ( @@ -15908,7 +15882,7 @@ let read_project_metadata = ( ) ); ) - | 7 -> + | 6 -> field_branch := ( Some ( ( @@ -15916,7 +15890,7 @@ let read_project_metadata = ( ) p lb ) ); - | 8 -> + | 7 -> field_commit := ( Some ( ( @@ -15924,7 +15898,7 @@ let read_project_metadata = ( ) p lb ) ); - | 9 -> + | 8 -> field_commit_title := ( Some ( ( @@ -15932,7 +15906,7 @@ let read_project_metadata = ( ) p lb ) ); - | 10 -> + | 9 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_commit_timestamp := ( Some ( @@ -15942,7 +15916,7 @@ let read_project_metadata = ( ) ); ) - | 11 -> + | 10 -> field_commit_author_email := ( Some ( ( @@ -15950,7 +15924,7 @@ let read_project_metadata = ( ) p lb ) ); - | 12 -> + | 11 -> field_commit_author_name := ( Some ( ( @@ -15958,7 +15932,7 @@ let read_project_metadata = ( ) p lb ) ); - | 13 -> + | 12 -> field_commit_author_username := ( Some ( ( @@ -15966,7 +15940,7 @@ let read_project_metadata = ( ) p lb ) ); - | 14 -> + | 13 -> field_commit_author_image_url := ( Some ( ( @@ -15974,7 +15948,7 @@ let read_project_metadata = ( ) p lb ) ); - | 15 -> + | 14 -> field_ci_job_url := ( Some ( ( @@ -15982,7 +15956,7 @@ let read_project_metadata = ( ) p lb ) ); - | 16 -> + | 15 -> field_on := ( Some ( ( @@ -15990,7 +15964,7 @@ let read_project_metadata = ( ) p lb ) ); - | 17 -> + | 16 -> field_pull_request_author_username := ( Some ( ( @@ -15998,7 +15972,7 @@ let read_project_metadata = ( ) p lb ) ); - | 18 -> + | 17 -> field_pull_request_author_image_url := ( Some ( ( @@ -16006,7 +15980,7 @@ let read_project_metadata = ( ) p lb ) ); - | 19 -> + | 18 -> field_pull_request_id := ( Some ( ( @@ -16014,7 +15988,7 @@ let read_project_metadata = ( ) p lb ) ); - | 20 -> + | 19 -> field_pull_request_title := ( Some ( ( @@ -16022,7 +15996,7 @@ let read_project_metadata = ( ) p lb ) ); - | 21 -> + | 20 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_base_sha := ( Some ( @@ -16032,7 +16006,7 @@ let read_project_metadata = ( ) ); ) - | 22 -> + | 21 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_start_sha := ( Some ( @@ -16042,7 +16016,7 @@ let read_project_metadata = ( ) ); ) - | 23 -> + | 22 -> field_is_full_scan := ( Some ( ( @@ -16050,7 +16024,7 @@ let read_project_metadata = ( ) p lb ) ); - | 24 -> + | 23 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_is_sca_scan := ( Some ( @@ -16060,7 +16034,7 @@ let read_project_metadata = ( ) ); ) - | 25 -> + | 24 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_is_code_scan := ( Some ( @@ -16070,7 +16044,7 @@ let read_project_metadata = ( ) ); ) - | 26 -> + | 25 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_is_secrets_scan := ( Some ( @@ -16095,7 +16069,7 @@ let read_project_metadata = ( match len with | 2 -> ( if String.unsafe_get s pos = 'o' && String.unsafe_get s (pos+1) = 'n' then ( - 16 + 15 ) else ( -1 @@ -16105,7 +16079,7 @@ let read_project_metadata = ( match String.unsafe_get s pos with | 'b' -> ( if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'h' then ( - 7 + 6 ) else ( -1 @@ -16113,7 +16087,7 @@ let read_project_metadata = ( ) | 'c' -> ( if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' then ( - 8 + 7 ) else ( -1 @@ -16121,7 +16095,7 @@ let read_project_metadata = ( ) | 'o' -> ( if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = '_' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'd' then ( - 5 + 4 ) else ( -1 @@ -16133,7 +16107,7 @@ let read_project_metadata = ( ) | 7 -> ( if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'd' then ( - 4 + 3 ) else ( -1 @@ -16143,7 +16117,7 @@ let read_project_metadata = ( match String.unsafe_get s pos with | 'b' -> ( if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'h' && String.unsafe_get s (pos+7) = 'a' then ( - 21 + 20 ) else ( -1 @@ -16151,7 +16125,7 @@ let read_project_metadata = ( ) | 'r' -> ( if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'u' && String.unsafe_get s (pos+6) = 'r' && String.unsafe_get s (pos+7) = 'l' then ( - 3 + 2 ) else ( -1 @@ -16163,7 +16137,7 @@ let read_project_metadata = ( ) | 9 -> ( if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = '_' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'h' && String.unsafe_get s (pos+8) = 'a' then ( - 22 + 21 ) else ( -1 @@ -16173,7 +16147,7 @@ let read_project_metadata = ( 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) = 'j' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'b' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'u' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 'l' then ( - 15 + 14 ) else ( -1 @@ -16181,7 +16155,7 @@ let read_project_metadata = ( ) | 'r' -> ( if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 's' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 'y' then ( - 2 + 1 ) else ( -1 @@ -16193,7 +16167,7 @@ let read_project_metadata = ( ) | 11 -> ( if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 's' && String.unsafe_get s (pos+2) = '_' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'c' && String.unsafe_get s (pos+9) = 'a' && String.unsafe_get s (pos+10) = 'n' then ( - 24 + 23 ) else ( -1 @@ -16203,7 +16177,7 @@ let read_project_metadata = ( match String.unsafe_get s pos with | 'c' -> ( if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'l' && String.unsafe_get s (pos+11) = 'e' then ( - 9 + 8 ) else ( -1 @@ -16214,7 +16188,7 @@ let read_project_metadata = ( match String.unsafe_get s (pos+3) with | 'c' -> ( if String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 'c' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 'n' then ( - 25 + 24 ) else ( -1 @@ -16222,7 +16196,7 @@ let read_project_metadata = ( ) | 'f' -> ( if String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 'c' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 'n' then ( - 23 + 22 ) else ( -1 @@ -16244,7 +16218,7 @@ let read_project_metadata = ( match String.unsafe_get s pos with | 'i' -> ( if String.unsafe_get s (pos+1) = 's' && String.unsafe_get s (pos+2) = '_' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 'r' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 's' && String.unsafe_get s (pos+10) = '_' && String.unsafe_get s (pos+11) = 's' && String.unsafe_get s (pos+12) = 'c' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 'n' then ( - 26 + 25 ) else ( -1 @@ -16252,15 +16226,7 @@ let read_project_metadata = ( ) | 'p' -> ( if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'q' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = '_' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'd' then ( - 19 - ) - else ( - -1 - ) - ) - | 's' -> ( - if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'g' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 'v' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'r' && String.unsafe_get s (pos+11) = 's' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'n' then ( - 0 + 18 ) else ( -1 @@ -16274,7 +16240,7 @@ let read_project_metadata = ( match String.unsafe_get s pos with | 'c' -> ( if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'm' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 's' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 'm' && String.unsafe_get s (pos+15) = 'p' then ( - 10 + 9 ) else ( -1 @@ -16282,7 +16248,7 @@ let read_project_metadata = ( ) | 's' -> ( if 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) = 'e' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 'v' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'n' && String.unsafe_get s (pos+12) = 'm' && String.unsafe_get s (pos+13) = 'e' && String.unsafe_get s (pos+14) = 'n' && String.unsafe_get s (pos+15) = 't' then ( - 1 + 0 ) else ( -1 @@ -16294,7 +16260,7 @@ let read_project_metadata = ( ) | 17 -> ( if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'p' && String.unsafe_get s (pos+9) = 'l' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 'y' && String.unsafe_get s (pos+12) = '_' && String.unsafe_get s (pos+13) = 'n' && String.unsafe_get s (pos+14) = 'a' && String.unsafe_get s (pos+15) = 'm' && String.unsafe_get s (pos+16) = 'e' then ( - 6 + 5 ) else ( -1 @@ -16304,7 +16270,7 @@ let read_project_metadata = ( match String.unsafe_get s pos with | 'c' -> ( if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'h' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'n' && String.unsafe_get s (pos+15) = 'a' && String.unsafe_get s (pos+16) = 'm' && String.unsafe_get s (pos+17) = 'e' then ( - 12 + 11 ) else ( -1 @@ -16312,7 +16278,7 @@ let read_project_metadata = ( ) | 'p' -> ( if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'q' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = '_' && String.unsafe_get s (pos+13) = 't' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 't' && String.unsafe_get s (pos+16) = 'l' && String.unsafe_get s (pos+17) = 'e' then ( - 20 + 19 ) else ( -1 @@ -16324,7 +16290,7 @@ let read_project_metadata = ( ) | 19 -> ( if String.unsafe_get s pos = 'c' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'h' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'e' && String.unsafe_get s (pos+15) = 'm' && String.unsafe_get s (pos+16) = 'a' && String.unsafe_get s (pos+17) = 'i' && String.unsafe_get s (pos+18) = 'l' then ( - 11 + 10 ) else ( -1 @@ -16332,7 +16298,7 @@ let read_project_metadata = ( ) | 22 -> ( if String.unsafe_get s pos = 'c' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'h' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'u' && String.unsafe_get s (pos+15) = 's' && String.unsafe_get s (pos+16) = 'e' && String.unsafe_get s (pos+17) = 'r' && String.unsafe_get s (pos+18) = 'n' && String.unsafe_get s (pos+19) = 'a' && String.unsafe_get s (pos+20) = 'm' && String.unsafe_get s (pos+21) = 'e' then ( - 13 + 12 ) else ( -1 @@ -16340,7 +16306,7 @@ let read_project_metadata = ( ) | 23 -> ( if String.unsafe_get s pos = 'c' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'h' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'm' && String.unsafe_get s (pos+16) = 'a' && String.unsafe_get s (pos+17) = 'g' && String.unsafe_get s (pos+18) = 'e' && String.unsafe_get s (pos+19) = '_' && String.unsafe_get s (pos+20) = 'u' && String.unsafe_get s (pos+21) = 'r' && String.unsafe_get s (pos+22) = 'l' then ( - 14 + 13 ) else ( -1 @@ -16348,7 +16314,7 @@ let read_project_metadata = ( ) | 28 -> ( if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'q' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = '_' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 'u' && String.unsafe_get s (pos+15) = 't' && String.unsafe_get s (pos+16) = 'h' && String.unsafe_get s (pos+17) = 'o' && String.unsafe_get s (pos+18) = 'r' && String.unsafe_get s (pos+19) = '_' && String.unsafe_get s (pos+20) = 'u' && String.unsafe_get s (pos+21) = 's' && String.unsafe_get s (pos+22) = 'e' && String.unsafe_get s (pos+23) = 'r' && String.unsafe_get s (pos+24) = 'n' && String.unsafe_get s (pos+25) = 'a' && String.unsafe_get s (pos+26) = 'm' && String.unsafe_get s (pos+27) = 'e' then ( - 17 + 16 ) else ( -1 @@ -16356,7 +16322,7 @@ let read_project_metadata = ( ) | 29 -> ( if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'q' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = '_' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 'u' && String.unsafe_get s (pos+15) = 't' && String.unsafe_get s (pos+16) = 'h' && String.unsafe_get s (pos+17) = 'o' && String.unsafe_get s (pos+18) = 'r' && String.unsafe_get s (pos+19) = '_' && String.unsafe_get s (pos+20) = 'i' && String.unsafe_get s (pos+21) = 'm' && String.unsafe_get s (pos+22) = 'a' && String.unsafe_get s (pos+23) = 'g' && String.unsafe_get s (pos+24) = 'e' && String.unsafe_get s (pos+25) = '_' && String.unsafe_get s (pos+26) = 'u' && String.unsafe_get s (pos+27) = 'r' && String.unsafe_get s (pos+28) = 'l' then ( - 18 + 17 ) else ( -1 @@ -16371,14 +16337,6 @@ let read_project_metadata = ( ( match i with | 0 -> - field_semgrep_version := ( - Some ( - ( - read_version - ) p lb - ) - ); - | 1 -> field_scan_environment := ( Some ( ( @@ -16386,7 +16344,7 @@ let read_project_metadata = ( ) p lb ) ); - | 2 -> + | 1 -> field_repository := ( Some ( ( @@ -16394,7 +16352,7 @@ let read_project_metadata = ( ) p lb ) ); - | 3 -> + | 2 -> field_repo_url := ( Some ( ( @@ -16402,7 +16360,7 @@ let read_project_metadata = ( ) p lb ) ); - | 4 -> + | 3 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_repo_id := ( Some ( @@ -16412,7 +16370,7 @@ let read_project_metadata = ( ) ); ) - | 5 -> + | 4 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_org_id := ( Some ( @@ -16422,7 +16380,7 @@ let read_project_metadata = ( ) ); ) - | 6 -> + | 5 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_repo_display_name := ( Some ( @@ -16432,7 +16390,7 @@ let read_project_metadata = ( ) ); ) - | 7 -> + | 6 -> field_branch := ( Some ( ( @@ -16440,7 +16398,7 @@ let read_project_metadata = ( ) p lb ) ); - | 8 -> + | 7 -> field_commit := ( Some ( ( @@ -16448,7 +16406,7 @@ let read_project_metadata = ( ) p lb ) ); - | 9 -> + | 8 -> field_commit_title := ( Some ( ( @@ -16456,7 +16414,7 @@ let read_project_metadata = ( ) p lb ) ); - | 10 -> + | 9 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_commit_timestamp := ( Some ( @@ -16466,7 +16424,7 @@ let read_project_metadata = ( ) ); ) - | 11 -> + | 10 -> field_commit_author_email := ( Some ( ( @@ -16474,7 +16432,7 @@ let read_project_metadata = ( ) p lb ) ); - | 12 -> + | 11 -> field_commit_author_name := ( Some ( ( @@ -16482,7 +16440,7 @@ let read_project_metadata = ( ) p lb ) ); - | 13 -> + | 12 -> field_commit_author_username := ( Some ( ( @@ -16490,7 +16448,7 @@ let read_project_metadata = ( ) p lb ) ); - | 14 -> + | 13 -> field_commit_author_image_url := ( Some ( ( @@ -16498,7 +16456,7 @@ let read_project_metadata = ( ) p lb ) ); - | 15 -> + | 14 -> field_ci_job_url := ( Some ( ( @@ -16506,7 +16464,7 @@ let read_project_metadata = ( ) p lb ) ); - | 16 -> + | 15 -> field_on := ( Some ( ( @@ -16514,7 +16472,7 @@ let read_project_metadata = ( ) p lb ) ); - | 17 -> + | 16 -> field_pull_request_author_username := ( Some ( ( @@ -16522,7 +16480,7 @@ let read_project_metadata = ( ) p lb ) ); - | 18 -> + | 17 -> field_pull_request_author_image_url := ( Some ( ( @@ -16530,7 +16488,7 @@ let read_project_metadata = ( ) p lb ) ); - | 19 -> + | 18 -> field_pull_request_id := ( Some ( ( @@ -16538,7 +16496,7 @@ let read_project_metadata = ( ) p lb ) ); - | 20 -> + | 19 -> field_pull_request_title := ( Some ( ( @@ -16546,7 +16504,7 @@ let read_project_metadata = ( ) p lb ) ); - | 21 -> + | 20 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_base_sha := ( Some ( @@ -16556,7 +16514,7 @@ let read_project_metadata = ( ) ); ) - | 22 -> + | 21 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_start_sha := ( Some ( @@ -16566,7 +16524,7 @@ let read_project_metadata = ( ) ); ) - | 23 -> + | 22 -> field_is_full_scan := ( Some ( ( @@ -16574,7 +16532,7 @@ let read_project_metadata = ( ) p lb ) ); - | 24 -> + | 23 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_is_sca_scan := ( Some ( @@ -16584,7 +16542,7 @@ let read_project_metadata = ( ) ); ) - | 25 -> + | 24 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_is_code_scan := ( Some ( @@ -16594,7 +16552,7 @@ let read_project_metadata = ( ) ); ) - | 26 -> + | 25 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_is_secrets_scan := ( Some ( @@ -16613,7 +16571,6 @@ let read_project_metadata = ( with Yojson.End_of_object -> ( ( { - semgrep_version = (match !field_semgrep_version with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "semgrep_version"); scan_environment = (match !field_scan_environment with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "scan_environment"); repository = (match !field_repository with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "repository"); repo_url = (match !field_repo_url with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "repo_url"); @@ -16968,17 +16925,6 @@ let write_scan_request : _ -> scan_request -> _ = ( ) ob x; ); - (match x.meta with None -> () | Some x -> - if !is_first then - is_first := false - else - Buffer.add_char ob ','; - Buffer.add_string ob "\"meta\":"; - ( - write_raw_json - ) - ob x; - ); Buffer.add_char ob '}'; ) let string_of_scan_request ?(len = 1024) x = @@ -16992,7 +16938,6 @@ let read_scan_request = ( let field_project_metadata = 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; @@ -17002,14 +16947,6 @@ let read_scan_request = ( if pos < 0 || len < 0 || pos + len > String.length s then invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); 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 ( - 3 - ) - else ( - -1 - ) - ) | 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 ( 1 @@ -17068,16 +17005,6 @@ let read_scan_request = ( ) ); ) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) then ( - field_meta := ( - Some ( - ( - read_raw_json - ) p lb - ) - ); - ) | _ -> ( Yojson.Safe.skip_json p lb ) @@ -17091,14 +17018,6 @@ let read_scan_request = ( if pos < 0 || len < 0 || pos + len > String.length s then invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); 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 ( - 3 - ) - else ( - -1 - ) - ) | 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 ( 1 @@ -17157,16 +17076,6 @@ let read_scan_request = ( ) ); ) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) then ( - field_meta := ( - Some ( - ( - read_raw_json - ) p lb - ) - ); - ) | _ -> ( Yojson.Safe.skip_json p lb ) @@ -17179,7 +17088,6 @@ let read_scan_request = ( 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; - meta = !field_meta; } : scan_request) ) diff --git a/semgrep_output_v1_j.mli b/semgrep_output_v1_j.mli index f195d5f4..945459f6 100644 --- a/semgrep_output_v1_j.mli +++ b/semgrep_output_v1_j.mli @@ -238,7 +238,9 @@ type rule_result = Semgrep_output_v1_t.rule_result = { type fixtest_result = Semgrep_output_v1_t.fixtest_result = { passed: bool } -type config_error_reason = Semgrep_output_v1_t.config_error_reason +type config_error_reason = Semgrep_output_v1_t.config_error_reason = + UnparsableRule + type config_error = Semgrep_output_v1_t.config_error = { file: fpath; @@ -409,7 +411,6 @@ type scan_metadata = Semgrep_output_v1_t.scan_metadata = { } type project_metadata = Semgrep_output_v1_t.project_metadata = { - semgrep_version: version; scan_environment: string; repository: string; repo_url: uri option; @@ -446,8 +447,7 @@ type ci_config_from_repo = Semgrep_output_v1_t.ci_config_from_repo = { type scan_request = Semgrep_output_v1_t.scan_request = { project_metadata: project_metadata; scan_metadata: scan_metadata; - project_config: ci_config_from_repo option; - meta: raw_json option + project_config: ci_config_from_repo option } type ci_env = Semgrep_output_v1_t.ci_env