Derive CI planner gate test inputs from package.json scripts - #4479
Open
Rangsh wants to merge 1 commit into
Open
Derive CI planner gate test inputs from package.json scripts#4479Rangsh wants to merge 1 commit into
Rangsh wants to merge 1 commit into
Conversation
Stop hand-maintaining scripts/*.test.mjs paths in RELEASE_CONTRACT_FILES and ASF_SOURCE_FILES. The planner now reads check:release and check:asf-source (including nested npm run delegations) and treats each named test file as an input to that gate's lane.
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.
Derive CI planner gate test inputs from package.json scripts
Stop hand-maintaining
scripts/*.test.mjspaths inRELEASE_CONTRACT_FILESandASF_SOURCE_FILES. The planner now readscheck:releaseandcheck:asf-source(including nestednpm rundelegations) and treats each named test file as an input to that gate's lane.Summary
Whether a
scripts/*.test.mjsfile runs, and whether a change to it schedules the lane that runs it, were previously written in three places: the test file itself, an npm gate script (check:release,check:asf-source) or a CI step, and a literal path list inscripts/ci-test-plan.mjs. Missing the third meant the gate still ran the test, but editing the test alone did not select the lane — so the test could be changed green without CI exercising it.This PR makes the planner derive those test-file inputs from
package.jsoninstead:loadGateTestFiles()readscheck:releaseandcheck:asf-sourcecollectGateScriptTestFiles()extracts everyscripts/*.test.mjspath from each gate script's command textnpm runinvocations are followed recursively (e.g.check:release→check:asf-npm→scripts/asf-npm-workflow-policy.test.mjs)isReleaseContractPath()andisAsfSourcePath()union the derived sets with the remaining static authority pathsThirteen hand-written
.test.mjsentries are removed fromRELEASE_CONTRACT_FILESandASF_SOURCE_FILES. Static non-test authority paths (workflows, generators, manifests) stay listed as before.Out of scope (per issue): the ~11 test files named directly in
.github/workflows/ci.ymlnode --teststeps are unchanged — most run unconditionally and need no lane selection. App icon drift tests remain driven by the workflow step, not an npm gate script.Fixes #4473
Verification
Result: 32/32 tests passed.
Spot checks:
Not run locally: full
npm ci,check:release,check:asf-source, or workflow-policy suites. The change is confined to the install-free planner and its unit tests, which run beforenpm ciin CI.AI use
Select exactly one:
Tool(s) and scope:
Cursor (Auto) — implemented
loadGateTestFiles/collectGateScriptTestFiles, removed duplicated static test paths, and updatedci-test-plan.test.mjsguardrails.Checklist
Does this PR entail a change in behavior?
Behavior change: editing any
scripts/*.test.mjsnamed bycheck:releaseorcheck:asf-source(including via nestednpm run) now selectsrelease_contractorasf_sourcein the CI test plan. Previously, several release-gate tests (e.g.desktop-nightly-workflow-policy.test.mjs,release-cli-*tests reachable only via derivation) did not select their lane when edited alone. The planner's output now also depends onpackage.jsonscript text, not only the static tables.