New input type for semgrep-core allows taking scanning roots instead of target files#337
New input type for semgrep-core allows taking scanning roots instead of target files#337
Conversation
|
Backwards compatibility summary: |
24d4b87 to
bd2cf34
Compare
|
BTW would be great after all this work to merge the semgrep-interfaces repo in semgrep-pro :) Those double PRs |
|
This is annoying: It's a legitimate incompatibility report but it's about the semgrep-core interface that we can break at will. It wouldn't happen if we could split the ATD file into multiple modules each concerned with a different interface. Maybe for now we could have some kind of hack to work around this. Atddiff offers an option to only check certain types so we could use this but it's not great for the long term (since adding a new interface would require adding the new root types to the list of types to check). By increasing difficulty (and cleanliness), we have:
|
|
Yes I've asked a few times for the ability to white list a few roots to not bother to check anything that descend from RPC or semgrep-core stuff. |
|
whitelist or blacklist. In this case we probably want atddiff --do-not-bother-about-those-roots 'function_call,function_return,core_output' Note that core_output also deeply use cli_output_extra, but this cli_output_extra is also used by cli_output so we should |
I added an option to atddiff to ensure that we don't miss future type definitions. atd PR coming soon. |
We'll need to add an option to make this safer. See TODO.
c0bf503 to
391c610
Compare
|
@aryx you wrote at ahrefs/atd#422 (comment):
|
This is used by https://github.com/semgrep/semgrep-proprietary/pull/2878.
make setup && maketo update the generated code after editing a.atdfile (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!