Skip to content

Commit

Permalink
Fix the new match_based_id alias (#327)
Browse files Browse the repository at this point in the history
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!
  • Loading branch information
aryx authored Dec 9, 2024
1 parent 1de5ce7 commit 8ffc890
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 30 deletions.
11 changes: 7 additions & 4 deletions semgrep_output_v1.atd
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ type uuid = string wrap <ocaml module="ATD_string_wrap.Uuidm">
(* RFC 3339 format *)
type datetime = string wrap <ocaml module="ATD_string_wrap.Datetime">

type match_based_id = string wrap

(*****************************************************************************)
(* Versioning *)
(*****************************************************************************)
Expand Down Expand Up @@ -258,6 +256,8 @@ type product
| Secrets <json name="secrets">
]

type match_based_id <ocaml attr="deriving show, eq"> = string (* ex:"ab023_1"*)

(*****************************************************************************)
(* Matches *)
(*****************************************************************************)
Expand Down Expand Up @@ -1163,6 +1163,7 @@ type features = {

type triage_ignored = {
~triage_ignored_syntactic_ids: string list;
(* TODO: use match_based_id list *)
~triage_ignored_match_based_ids: string list;
}

Expand Down Expand Up @@ -1462,7 +1463,7 @@ type finding = {
commit_date: string;

syntactic_id: string;
(* since semgrep 0.98 *)
(* since semgrep 0.98 TODO: use match_based_id option *)
?match_based_id: string option;
(* since semgrep 1.14.0 *)
?hashes: finding_hashes option;
Expand Down Expand Up @@ -1633,7 +1634,9 @@ type ci_scan_complete_response <ocaml attr="deriving show"> = {
~app_block_override: bool;
(* only when app_block_override is true *)
~app_block_reason: string;
(* match_based_ids of findings that semgrep-app determined should cause the scan to block *)
(* since 1.100.0. match_based_ids of findings that semgrep-app determined
* should cause the scan to block
*)
~app_blocking_match_based_ids : match_based_id list;
}

Expand Down
2 changes: 1 addition & 1 deletion semgrep_output_v1.jsonschema

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion semgrep_output_v1.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions semgrep_output_v1.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 3 additions & 14 deletions semgrep_output_v1_j.ml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions semgrep_output_v1_j.mli

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8ffc890

Please sign in to comment.