Repository navigation
test: pin the codeql.yml path filter and SARIF permission contract - #1014
Merged
Merged
Conversation
codeql.yml is the only static-analysis gate in this repository and is not a required status check, so when its push/pull_request path filters stop matching the sources they target the scan never starts: an unscanned tree reads exactly like a clean one. Nothing asserted anything about the file. Add tests/codeql-contract.test.mjs, covering the invariants that have no cross-workflow analogue in tests/ci-supply-chain.test.mjs: the path filters enumerate every JavaScript-family extension present in the working tree, push and pull_request scan the same set, the analyze job holds security-events: write so its SARIF can be uploaded, init and analyze are pinned to the same codeql-action release, analyze's category names the language set init declared, and the weekly schedule survives with a five-field cron. The extension list is derived from the tree rather than hard-coded, and the check asserts it found at least one source before concluding the filters are complete, so it cannot pass vacuously. No workflow file is modified: codeql.yml already satisfies every invariant. Closes #1013 Signed-off-by: quality <quality@hive.kubestellar.io>
Contributor
Author
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will automatically remove the |
This was referenced Oct 3, 2026
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.
Test Improvement
Adds
tests/codeql-contract.test.mjs. Test-only — no workflow or source fileis modified.
.github/workflows/codeql.ymlis the only static-analysis gate in thisrepository, it is not a required status check, and nothing asserted anything
about it. Because it runs behind a
paths:filter, a filter that stopsmatching its sources does not turn the workflow red — the workflow never
starts, and an unscanned tree is indistinguishable from a clean one. The same
holds for
security-events: write: without it the analysis runs and thencannot upload its SARIF.
tests/ci-supply-chain.test.mjsalready covers the generic workflow propertiesfor every workflow including this one (SHA pinning, version comments,
non-blanket permissions, pinned runners,
timeout-minutes,persist-credentials). The nine tests added here cover only the CodeQLinvariants that have no cross-workflow analogue:
requiredreturns a present value and names the fault in the restsecurity-events: writeanalyze.categorytracksinit.languagescodeql.ymlis in its own filterpackage.json,package-lock.jsonschedule:with a five-field cronThe extension check derives its list by walking the tree, so adding a first
.tsdirectory without widening the filters fails the unit suite instead ofsilently shrinking the scan. It asserts it found at least one JavaScript-family
source before concluding the filters are complete, following the "detection is
not vacuous" pattern in
tests/ci-supply-chain.test.mjsandtests/automation-workflow-ordering.test.mjs, so it cannot pass vacuously.Verification
All nine pass on current
main(6071e69) —codeql.ymlalready satisfies everyinvariant, so this adds a regression floor rather than fixing a defect.
Mutation-verified: flipping
security-eventstoread, dropping'**/*.mjs'from the filters, narrowing
categoryto/language:javascript, and adding asixth cron field each fail the corresponding test and nothing else.
npm run test:unit:coverage:checkpasses with the new file at 100.00% lines /93.33% regions;
src filesstays at 100.00/100.00 (8351/8351 lines,2395/2395 regions) and
all filesregions are unchanged at 95.02 against the94 floor.
npx prettier --checkis clean.Files claimed by this PR
tests/codeql-contract.test.mjs(new). Disjoint from every open hold-gated PR:#989/#991 (
tests/tools/e2e-coverage-report.mjs), #996(
tests/tools/coverage-report.mjs), #1000 (tests/ci-gating-jobs.test.mjs),#1002 (
tests/ci-concurrency.test.mjs), #998 (tests/adr-contract.test.mjs),#1004/#1007/#1010/#1012 (ignore- and linter-config contracts).
gh pr diffover#1000 and #1002 returns zero
codeqlmatches.Related Issue
Closes #1013
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88