Skip to content

Commit c093472

Browse files
authored
chore(dep-resolution): add dependency resolution errors to core error type (#302)
As part of the ongoing lockfileless work, we aim to integrate errors that occur during dependency resolution into the error framework that the rest of the CLI uses. This PR adds dependency resolution errors as an error type. Dependency _parser_ errors remain as their own type for now, but in the future may be integrated as well by adding them as a variant of `DependencyResolutionError`. - [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 74a0c4b commit c093472

7 files changed

+2855
-2785
lines changed

semgrep_output_v1.atd

+4
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,8 @@ type error_type
511511
* *)
512512
| PatternParseError0 <json name="Pattern parse error">
513513
| IncompatibleRule0 <json name="Incompatible rule">
514+
(* since semgrep 1.94.0 *)
515+
| DependencyResolutionError of resolution_error
514516
] <ocaml repr="classic">
515517

516518
type incompatible_rule
@@ -1846,6 +1848,7 @@ type manifest = {
18461848
}
18471849

18481850
type resolution_error
1851+
<ocaml attr="deriving show">
18491852
<python decorator="dataclass(frozen=True)"> = [
18501853
| UnsupportedManifest
18511854
| MissingRequirement of string
@@ -1854,6 +1857,7 @@ type resolution_error
18541857
]
18551858

18561859
type resolution_cmd_failed
1860+
<ocaml attr="deriving show">
18571861
<python decorator="dataclass(frozen=True)"> = {
18581862
command: string;
18591863
message: string;

semgrep_output_v1.jsonschema

+10-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

semgrep_output_v1.proto

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

semgrep_output_v1.py

+162-142
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)