Skip to content

Commit 8a8abc7

Browse files
authored
feat: add skipped_paths field to ci_scan_results (#427)
## Summary Add optional `skipped_paths` field to the `ci_scan_results` type to communicate which files were detected but couldn't be scanned due to errors (timeout, OOM, stack overflow, etc.). This allows the app to avoid marking findings in these files as "fixed" when they weren't actually scanned. ## Changes - Added `?skipped_paths` field to `ci_scan_results` in `semgrep_output_v1.atd` - Regenerated all derived files (Python, OCaml, JSON Schema, Proto, ...) ## Backwards Compatibility - Field is optional (`?` prefix), so existing consumers will still work - Field is omitted from JSON when None/empty --- - [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.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! - [x] Any accompanying changes in `semgrep-proprietary` are approved and ready to merge once this PR is merged
1 parent e5da967 commit 8a8abc7

9 files changed

+115
-20
lines changed

semgrep_output_v1.atd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2031,8 +2031,11 @@ type ci_scan_results = {
20312031
(* TODO? use a token type ? *)
20322032
token: string nullable;
20332033

2034-
searched_paths: fpath list;
2034+
searched_paths
2035+
<doc text="Files that were detected and attempted to scan. Note that some of these may have been skipped due to errors (see skipped_paths).">
2036+
: fpath list;
20352037
renamed_paths: fpath list;
2038+
~skipped_paths <doc text="Files detected but not scanned due to errors (timeout, OOM, etc.). The app should NOT mark findings in these files as fixed.">: fpath list;
20362039

20372040
rule_ids: rule_id list;
20382041

semgrep_output_v1.jsonschema

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

semgrep_output_v1.proto

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

semgrep_output_v1.py

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

semgrep_output_v1.ts

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

semgrep_output_v1_j.ml

Lines changed: 67 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

semgrep_output_v1_j.mli

Lines changed: 10 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

semgrep_output_v1_t.ml

Lines changed: 10 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

semgrep_output_v1_t.mli

Lines changed: 10 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)