Skip to content

Commit 5149397

Browse files
authored
feat(ptt): Add space ptt feature to features (#299)
For PTT, in order to ensure that the default lockfile-less logic (to only generate graphs in the absence of a lockfile) is overridden when a customer is using PTT, we need a way to communicate the status of the PTT feature to the CLI from the app. As such, this PR introduces `path_to_transitivity` as an optional (for backwards compatibility) boolean value on `feature` . An alternative I was exploring was adding a field to the `scan_config` and `scan_response` objects which could store a list of "feature flags" and their values/enabled status from the app in order to avoid having to make changes to interfaces in the case that we want feature flag behavior to affect the way `semgrep-pro` works. However, with this approach, the main con is that we would need to ensure that the names of the feature flags stay consistent between the CLI and the app which would open us up to bad bugs resulting from silly things like typos. With the approach in this PR (just tacking PTT onto the list of features in the config), the main con is that principally the `features` entry gets its values from settings stored as part of the config in `postgres`. In addition, once PTT is GA, this feature flag becomes useless so ideally, we will update lockfileless to generate the graph by default and then remove code which checks the PTT flag and then altogether from interfaces. - [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 9a2889b commit 5149397

7 files changed

+302
-65
lines changed

semgrep_output_v1.atd

+1
Original file line numberDiff line numberDiff line change
@@ -1218,6 +1218,7 @@ type features = {
12181218
~autofix: bool;
12191219
~deepsemgrep: bool;
12201220
~dependency_query: bool;
1221+
~path_to_transitivity: bool;
12211222
}
12221223

12231224
type triage_ignored = {

semgrep_output_v1.jsonschema

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

semgrep_output_v1.proto

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

semgrep_output_v1.py

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

semgrep_output_v1.ts

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

0 commit comments

Comments
 (0)