Repository navigation
feat(ci): diff-scoped PR scans and findings baseline (#109) - #215
Falguni-105 wants to merge 1 commit into
Conversation
19a9f6f to
fa82be1
Compare
|
Update: rebased onto the latest upstream main and resolved the conflict; this PR is now MERGEABLE. Branch protection still blocks a direct merge and I don't have upstream write/auto-merge permissions, so a maintainer will need to approve and merge. |
|
Thank you for this, and welcome! It's a careful implementation: We're closing it only because #211 implements the same issue (#109). #211 was claimed on the issue first, and we've just finished reviewing and merging it, so the two can't both land. One fix we made to #211 applies to yours too, in case it's useful elsewhere: a finding's file path, not the model's If you'd like to bring over any of your extras as a small follow-up on top of |
Fixes #109
Summary
--changed-since <ref>uses git's merge base (with rename detection contributing both old and new paths), and--changed-files <paths>accepts a CI-supplied newline-separated list. Bad refs and non-git targets fail before any agent starts. The brief names changed files and asks forScope: changed|contextmarkers; findings in unchanged files stay open and exported but are taggedscope: context.--fail-scope changedexcludes context findings from--fail-onwithout hiding them. Stale-finding closure is limited to the scanned paths, so a diff run never closes findings it did not look at.secfoo findings baseline write|checkmaintains a small, editable JSON file keyed by fingerprint.secfoo run --baseline <file>excludes active entries from the gate, re-counts expired ones with a clear notice, andfindings export --baselineannotates every finding with SARIFbaselineStateand JSONLbaseline: {reason, expires}instead of dropping it. The SAST dashboard shows an Accepted in baseline badge.action.ymlgainschanged-onlyandbaselineinputs (automaticgithub.event.pull_request.base.shawiring), with full-history checkout/fetch and diff/baseline examples in GitHub Actions and GitLab CI.docs/CI.mdadoption workflow and input table;docs/REFERENCE.mdflags, baseline commands, export annotations, fingerprint/diff notes, and dashboard badge note.Tests
tests/test_diff_scope.py,tests/test_baseline.py,tests/test_cli_diff_baseline.py,tests/test_runner_diff_scope.py(merge base, renames, bad refs, missing targets, brief text, scope tags, expiry, export annotations, out-of-scope findings staying open, baseline dashboard marker).pytesttargeted: 53 passed. CLI/memory: 85 passed. Report/storage: 319 passed (2 pre-existing SARIFas_uri()DeprecationWarnings). Docs/skills/lint config: 83 passed. YAML parse check passed foraction.ymlandexamples/ci/*.yml.HEAD d90d3f0, unrelated to this change.Notes
--changed-since) and a findings baseline (--baseline) #109. This PR is an alternative implementation with additional coverage for rename identity, baseline expiry/export annotations, and dashboard visibility; maintainers can choose one.