chore(ci): remove self-scan workflow, superseded by hosted scanner#693
Merged
Conversation
The hosted Pathfinder service (cpf-executor) now scans this repo on every push and PR via the GitHub App, and posts inline PR comments plus a status check from there. Running the same scan twice (once via this workflow, once via the App) doubles runner minutes, posts duplicate PR comments, and uploads SARIF that the hosted scanner already publishes. action.yml stays put so external consumers still pulling shivasurya/code-pathfinder@vX from their own workflows keep working. This change only removes our self-application of the action.
SafeDep Report SummaryNo dependency changes detected. Nothing to scan. This report is generated by SafeDep Github App |
Pathfinder Report✅ No security findings on the changed files. This pull request is clean. Powered by Code Pathfinder. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #693 +/- ##
=======================================
Coverage 85.52% 85.52%
=======================================
Files 190 190
Lines 27467 27467
=======================================
+ Hits 23490 23492 +2
+ Misses 3084 3083 -1
+ Partials 893 892 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
6 tasks
shivasurya
added a commit
that referenced
this pull request
May 22, 2026
…ff (#712) * fix(cli): diff-aware mode must not fall back to full scan on empty diff Two paired bugs caused a delete-only PR to dump every full-repo finding instead of the expected zero. Surfaced as 207 findings on PR #693, which only deletes one YAML workflow file. The wire: pathfinder ci computes changedFiles via git diff, then filters scan results to that set when diff-aware is on. Both halves were broken: 1. diff/git_provider.go ran `git diff --diff-filter=ACMR`, excluding deletions. A delete-only PR therefore produced changedFiles=[]. 2. cmd/ci.go guarded the filter with `diffEnabled && len(changedFiles) > 0`. When the list was empty, the filter was skipped entirely and ALL full-scan findings were returned. The same guard was on the filesScanned count, so the report also claimed "scanned full repo." Fix: - ACMR -> ACMRD so deletions show up in changedFiles. A delete-only PR now returns the deleted path, distinguishing it from an empty PR. - Drop the `len(changedFiles) > 0` guard at both call sites. If diff-aware is on, honour it: an empty intersection returns zero findings, not "full repo." The two states (diff-aware on, nothing matched vs diff-aware off, scan everything) must stay separable. Updated the existing TestGitDiffProvider_DeletedFileExcluded test (now TestGitDiffProvider_DeletedFileIncluded) and added a deletion-only regression covering exactly the PR #693 shape. CLAUDE.md gains a "Diff-Aware Scanning" section documenting the new contract so future maintainers don't reintroduce the fallback. * refactor(cli): extract applyDiffFilter helper, fix the same bug in output.DiffFilter Codecov caught that the two diff-filter call-site changes in PR #712 weren't directly unit-tested (33% patch coverage). Pulling the gate logic into a named helper makes both branches testable as pure functions and exposes a deeper instance of the same bug. Changes: - cmd/diff_filter.go: new applyDiffFilter + countScannedFiles helpers. applyDiffFilter is the single source of truth for "if diff-aware is on, run the filter; an empty changedFiles list is a valid input that yields zero detections, NOT a pass-through." - cmd/ci.go, cmd/scan.go: both call sites switched to applyDiffFilter. cmd/scan.go previously had the same `diffAware && len(changedFiles) > 0` guard as cmd/ci.go — same regression risk, fixed here too. - output/filter.go: removed the `if len(f.changedFiles) == 0 { return detections }` short-circuit in both Filter and FilteredCount. That was the deeper instance of the bug: even after fixing the cmd-layer guard, output.NewDiffFilter([]).Filter(d) would still pass d through, defeating the cmd-layer fix for genuinely empty diffs. Callers that want "no filtering" must skip Filter entirely (which applyDiffFilter now enforces via the diffEnabled gate). - output/filter_test.go: flipped two test cases that hard-coded the buggy pass-through behaviour to assert the new contract. - cmd/diff_filter_test.go: 10 tests covering every branch of both helpers (100% function coverage). go vet, golangci-lint: 0 issues.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Removes
.github/workflows/code-pathfinder-scan.yml. The hosted Pathfinder service (cpf-executor on the production runner) now scans this repo on every push and PR via the GitHub App, posts inline PR comments, and publishes a status check directly. Keeping the in-repo workflow as well means:Scope
action.ymlstays put so external consumers usingshivasurya/code-pathfinder@vXin their own repositories are unaffected.