Skip to content

Commit

Permalink
chore(dep-resolution): add dependency resolution errors to core error…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
bkettle authored Oct 30, 2024
1 parent 74a0c4b commit c093472
Show file tree
Hide file tree
Showing 7 changed files with 2,855 additions and 2,785 deletions.
4 changes: 4 additions & 0 deletions semgrep_output_v1.atd
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,8 @@ type error_type
* *)
| PatternParseError0 <json name="Pattern parse error">
| IncompatibleRule0 <json name="Incompatible rule">
(* since semgrep 1.94.0 *)
| DependencyResolutionError of resolution_error
] <ocaml repr="classic">

type incompatible_rule
Expand Down Expand Up @@ -1846,6 +1848,7 @@ type manifest = {
}

type resolution_error
<ocaml attr="deriving show">
<python decorator="dataclass(frozen=True)"> = [
| UnsupportedManifest
| MissingRequirement of string
Expand All @@ -1854,6 +1857,7 @@ type resolution_error
]

type resolution_cmd_failed
<ocaml attr="deriving show">
<python decorator="dataclass(frozen=True)"> = {
command: string;
message: string;
Expand Down
11 changes: 10 additions & 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.

304 changes: 162 additions & 142 deletions semgrep_output_v1.py

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

Loading

0 comments on commit c093472

Please sign in to comment.