Skip to content

Commit 724cfcc

Browse files
authored
add rpc interface for dump rule partitions (#293)
Closes [SMS-498](https://linear.app/semgrep/issue/SMS-498). Context is in the ticket. - [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.17.0. See https://atd.readthedocs.io/en/latest/atdgen-tutorial.html#smooth-protocol-upgrades
1 parent bc03844 commit 724cfcc

7 files changed

+432
-5
lines changed

semgrep_output_v1.atd

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1801,7 +1801,7 @@ type sarif_format_return
18011801
* performace when needed.
18021802
*)
18031803
format_time_seconds: float;
1804-
}
1804+
}
18051805

18061806
(* TODO: merge with src/osemgrep/reporting/Output_format.ml *)
18071807
type output_format = [
@@ -1820,7 +1820,6 @@ type manifest = {
18201820
path: fpath;
18211821
}
18221822

1823-
18241823
type resolution_error
18251824
<python decorator="dataclass(frozen=True)"> = [
18261825
| UnsupportedManifest
@@ -1842,6 +1841,12 @@ type resolution_result = [
18421841
| ResolutionError of resolution_error
18431842
]
18441843

1844+
type dump_rule_partitions_params = {
1845+
rules: raw_json;
1846+
n_partitions: int;
1847+
output_dir: fpath;
1848+
}
1849+
18451850
type function_call
18461851
<python decorator="dataclass(frozen=True)"> = [
18471852
| CallContributions
@@ -1854,6 +1859,7 @@ type function_call
18541859
*)
18551860
| CallValidate of fpath
18561861
| CallResolveDependencies of manifest list
1862+
| CallDumpRulePartitions of dump_rule_partitions_params
18571863
]
18581864

18591865
type function_return
@@ -1865,4 +1871,5 @@ type function_return
18651871
| RetFormatter of string
18661872
| RetValidate of bool
18671873
| RetResolveDependencies of (manifest * resolution_result) list
1874+
| RetDumpRulePartitions of bool
18681875
]

semgrep_output_v1.jsonschema

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

semgrep_output_v1.proto

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

semgrep_output_v1.py

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

semgrep_output_v1.ts

Lines changed: 32 additions & 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)