Skip to content

Commit 8ffc890

Browse files
authored
Fix the new match_based_id alias (#327)
Using a string wrap was causing semgrep-pro to fail to compile about a missing pp_match_based_id test plan: related PR in semgrep-pro - [x] I ran `make setup && make` to update the generated code after editing a `.atd` file (TODO: have a CI check) - [x] I made sure we're still backward compatible with old versions of the CLI. For example, the Semgrep backend need to still be able to *consume* data generated by Semgrep 1.50.0. See https://atd.readthedocs.io/en/latest/atdgen-tutorial.html#smooth-protocol-upgrades Note that the types related to the semgrep-core JSON output or the semgrep-core RPC do not need to be backward compatible!
1 parent 1de5ce7 commit 8ffc890

6 files changed

+23
-30
lines changed

semgrep_output_v1.atd

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ type uuid = string wrap <ocaml module="ATD_string_wrap.Uuidm">
100100
(* RFC 3339 format *)
101101
type datetime = string wrap <ocaml module="ATD_string_wrap.Datetime">
102102

103-
type match_based_id = string wrap
104-
105103
(*****************************************************************************)
106104
(* Versioning *)
107105
(*****************************************************************************)
@@ -258,6 +256,8 @@ type product
258256
| Secrets <json name="secrets">
259257
]
260258

259+
type match_based_id <ocaml attr="deriving show, eq"> = string (* ex:"ab023_1"*)
260+
261261
(*****************************************************************************)
262262
(* Matches *)
263263
(*****************************************************************************)
@@ -1163,6 +1163,7 @@ type features = {
11631163

11641164
type triage_ignored = {
11651165
~triage_ignored_syntactic_ids: string list;
1166+
(* TODO: use match_based_id list *)
11661167
~triage_ignored_match_based_ids: string list;
11671168
}
11681169

@@ -1462,7 +1463,7 @@ type finding = {
14621463
commit_date: string;
14631464

14641465
syntactic_id: string;
1465-
(* since semgrep 0.98 *)
1466+
(* since semgrep 0.98 TODO: use match_based_id option *)
14661467
?match_based_id: string option;
14671468
(* since semgrep 1.14.0 *)
14681469
?hashes: finding_hashes option;
@@ -1633,7 +1634,9 @@ type ci_scan_complete_response <ocaml attr="deriving show"> = {
16331634
~app_block_override: bool;
16341635
(* only when app_block_override is true *)
16351636
~app_block_reason: string;
1636-
(* match_based_ids of findings that semgrep-app determined should cause the scan to block *)
1637+
(* since 1.100.0. match_based_ids of findings that semgrep-app determined
1638+
* should cause the scan to block
1639+
*)
16371640
~app_blocking_match_based_ids : match_based_id list;
16381641
}
16391642

semgrep_output_v1.jsonschema

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

semgrep_output_v1.proto

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

semgrep_output_v1.ts

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

semgrep_output_v1_j.ml

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

semgrep_output_v1_j.mli

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

0 commit comments

Comments
 (0)