-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define new sca_error intermediate type and sca_resolution_error and ScaParseError #350
Conversation
test plan: see related PR in semgrep
Backwards compatibility summary:
|
semgrep_output_v1.atd
Outdated
| DependencyResolutionError of resolution_error | ||
| DependencyResolutionError of resolution_error_kind | ||
(* since semgrep 1.109.0 (to replace dependency_parser_error) *) | ||
| ScaParseError of sca_parser_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could alternatively skip adding an extra variant here, and instead add a variant to resolution_error_kind
. In my head "dependency resolution" refers to any way that we determine the dependencies for a project, so this could make sense. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me. That would maybe the need to have all those Union[out.DependencyParseError, out.ScaResolutionError] ? and we would have just out.ScaResolutionError or maybe just out.ScaError
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would be the difference between this ScaParserError of sca_parser_name and the
ParseDependenciesFailed of string in resolution_error_kind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ParseDependenciesFailed
was originally intended to be for when we produce some dependency list in lockfileless scanning (by talking to the package manager) but fail to parse it correctly, while ScaParserError
would be that a lockfile parser failed
test plan:
see related PR in semgrep
make setup && make
to update the generated code after editing a.atd
file (TODO: have a CI check)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!