ci: exclude the test tree from CodeQL analysis - #16
Merged
Conversation
CodeQL was emitting parse-error diagnostics for intentionally-malformed fixtures (e.g. browserify's test/error_code/src.js and test/syntax_cache/invalid.js), which exist to exercise forks' syntax-error handling. Fork test suites also run bundles through vm.runInNewContext, which trips CodeQL's code-injection heuristics as false positives. Scan the shipped library code, not the test tree: add a paths-ignore for test/ and tests/ via the init action's inline config. Applies to every fork through the shared reusable workflow. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01UcmNgwVhqkNE1eViGYLnJ9
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.
What & why
CodeQL surfaced parse-error diagnostics on intentionally-malformed test fixtures:
Those files are deliberately invalid — they exist so browserify's tests can exercise its syntax-error handling. CodeQL can't parse them (by design), so it logs noise. Fork test trees also run bundles through
vm.runInNewContext(...), which trips CodeQL's code-injection heuristics as false positives.Neither the fixtures nor the harness is the security target for a library — the shipped code (
index.js,lib/,bin/) is.Change
Add a
paths-ignoreto the reusable CodeQL workflow'sinitstep (inlineconfig) sotest/andtests/are excluded from analysis:Applies to every fork through the shared reusable workflow — one change, no per-repo edits.
Rollout
Forks pick it up when their
unabandoned/.githubdigest pin bumps (Renovate — and those bumps now auto-merge on green, via renovate-config #17). The diagnostic is non-blocking in the meantime.Type of change
fix/feat/perf— consumer-facingdeps— dependency updatechore/ci/build/docs/test/refactor— maintenance (ci)Checklist
Generated by Claude Code