Fix: go-manifest false positives from node_modules in sourceCodeUri scans#556
Fix: go-manifest false positives from node_modules in sourceCodeUri scans#556academo merged 4 commits intografana:mainfrom
Conversation
|
|
1 similar comment
|
|
There was a problem hiding this comment.
Pull request overview
This PR updates the go-manifest analyzer to avoid false-positive manifest/source mismatches when sourceCodeUri includes dependency trees that contain .go files under node_modules (including pnpm-style nested layouts).
Changes:
- Filter discovered Go source files to exclude paths under
node_modulesbefore manifest verification. - Generalize manifest parsing to ignore
node_modulesentries instead of a single hardcoded ignored file.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
academo
left a comment
There was a problem hiding this comment.
@hoptical even though the code is correct I want to keep this a dedicated list.
this has been the only case of a false positive from the gomanifest and the current code opens the door to someone doing
pkg
node_modules/
now_this_wont_be_checked.go
which is what we want to avoid with the dedicated list of specific files
6a4d42e to
ffc0096
Compare
@academo So now:
Tests:
Please let me know if it satisfies your concern and does the fix. |
Summary
This PR fixes false-positive Go manifest validation errors when sourceCodeUri contains dependency trees with Go files under node_modules (including pnpm layouts).
Problem
Go manifest validation was scanning all Go files from sourceCodeUri and treating dependency files in node_modules as plugin-owned backend source. This caused errors like:
What changed
gomanifest.gogomanifest.gogomanifest_test.go:Validation
go test ./pkg/analysis/passes/gomanifest/ -vpassedIssues
Additional note about CI
It seems to me that the current PR CI does not run this analyzer test surface (for example go-manifest paths), so this class of regression can slip through even when required checks pass. I suggest adding analyzer/package tests to PR CI, at least:
or a broader: