Repository navigation
feat(ci): add diff-aware PR scans (--changed-since/--changed-files) and findings baseline (--baseline) - #211
Conversation
…nd findings baseline (--baseline)
classify_finding_scope let the report's Scope: tag override the finding's location. The tag is model output, so text in a scanned PR could get a finding in a changed file tagged context and past --fail-scope changed. Use the tag only for findings without a location. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks, and welcome! This is a solid take on #109. The git handling validates the ref ( I pushed one fix (5e596c4), with a test. Once a maintainer approves the workflow run and CI is green, this is ready to merge. |
# Conflicts: # src/secfoo/runner.py # src/secfoo/skills/renderer.py
# Conflicts: # src/secfoo/cli.py
|
Merged, thank you! 🎉 Diff-scoped PR scans, Before merging, I pushed the scope fix described above (the finding's path decides, not the model's tag) with a test. I also merged current #212 and #210 are still open with review notes. Happy to help with the rebases when you get to them. |
Leaderboard update
SriRamkunamsetty now has 26 points (rank #3, Bronze). 24 more to reach Silver. |
Fixes #109
Summary
--changed-since,--changed-files,--fail-scope):src/secfoo/targets/diff.pycomputing changed paths viagit diff --name-only --no-renames --merge-base(with merge-base fallback and untracked handling) and reading newline-separated path lists, validating git repos and refs before any skill executes.render_prompt()insrc/secfoo/skills/renderer.pyto include the changed-files brief and instructions to tag unchanged-file findings withscope: context.src/secfoo/runner.pyto passeffective_scan_scopeintocomplete_runandupdate_structured_findingsso out-of-scope findings remain open, and extract per-findingscope(changedvscontext) and fingerprints onRunOutcomefor--fail-scope changed.--baseline,secfoo findings baseline write|check):src/secfoo/report/baseline.pysupporting JSON baselines withfingerprint,skill,severity,title, optionalreason, andexpires(YYYY-MM-DD) handling.secfoo findings baseline writeandsecfoo findings baseline checkinsrc/secfoo/cli.py.--baselineintosecfoo run(excluding active entries from--fail-on, reporting and re-counting expired entries, persisting active acknowledgments infinding_baselines) andsecfoo findings export(SARIFbaselineState: "unchanged" | "new"viasrc/secfoo/report/sarif.py, JSONLbaseline: {reason, expires}).sast_findings_list.html,sast_finding_detail.html).changed-onlyandbaselineinputs toaction.ymland updatedexamples/ci/github-actions-manual.yml,examples/ci/gitlab-ci.yml,docs/CI.md(including "Adopting secfoo in an existing repo"), anddocs/REFERENCE.md.tests/test_diff_and_baseline.py.Verification
ruff check .— 0 errorsbandit -c .bandit -ll -r src/secfoo— 0 medium/high issuespytest tests/test_diff_and_baseline.py tests/test_cli.py tests/test_runner.py tests/test_docs_consistency.py tests/test_report/test_sarif.py tests/test_storage/test_structured_findings_storage.py tests/test_web/test_sast_finding_route.py tests/test_web/test_no_inline_scripts.py -q— 180 passed