Repository navigation
fork CI: FORK_CHANGES.md checks move to the workflows job so fork-only PRs skip app tests (#259) - #389
Conversation
…y PRs skip app tests (#259) The FORK_CHANGES.md checks (every fork setting named, no unknown setting) move from the vitest file packages/shared/src/forkDocs.test.ts to .github/scripts/fork-changes-list.test.cjs, which reads forkDefaults.ts as text and runs in Fork tests' `workflows` job on every pull request. FORK_CHANGES.md is now fork-owned, so a fork feature pull request that only adds its line there skips the app jobs. fork-owned-reads.test.py now counts a read of a `.md` file the list owns by its own line, so an app test reading FORK_CHANGES.md again is caught. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
lens: skip-safety verdict: SAFE (head 2cca645) Read-only review: skip safety and correctness. The head did not move while I reviewed. Skip safety: no PR can skip app tests it needs
The moved checks still fail closed
Findingsminor:
The always-on formatter would rewrite the quoted and spaced forms. It would leave the spread, the helper call and the shorthand alone. The old vitest check read the runtime array, so it saw them. In those shapes, a setting missing from These shapes throw, which is correct: key before scope, Today's table is uniform (22 nit: nit (not this PR): two Check 3: the new Tests run (as the workflow runs them)
Mutation resultsI broke one line at a time; each run went red (exit 1), and I restored each file afterwards.
|
…y PRs skip app tests (#259) (#389) The FORK_CHANGES.md checks (every fork setting named, no unknown setting) move from the vitest file packages/shared/src/forkDocs.test.ts to .github/scripts/fork-changes-list.test.cjs, which reads forkDefaults.ts as text and runs in Fork tests' `workflows` job on every pull request. FORK_CHANGES.md is now fork-owned, so a fork feature pull request that only adds its line there skips the app jobs. fork-owned-reads.test.py now counts a read of a `.md` file the list owns by its own line, so an app test reading FORK_CHANGES.md again is caught. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…y PRs skip app tests (#259) (#389) The FORK_CHANGES.md checks (every fork setting named, no unknown setting) move from the vitest file packages/shared/src/forkDocs.test.ts to .github/scripts/fork-changes-list.test.cjs, which reads forkDefaults.ts as text and runs in Fork tests' `workflows` job on every pull request. FORK_CHANGES.md is now fork-owned, so a fork feature pull request that only adds its line there skips the app jobs. fork-owned-reads.test.py now counts a read of a `.md` file the list owns by its own line, so an app test reading FORK_CHANGES.md again is caught. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
What and why
The fork-only skip (F2) rarely fired. Each fork feature PR changes its line in
FORK_CHANGES.md, and that file was not fork-owned because an app test (packages/shared/src/forkDocs.test.ts, in the appTestjob) read it. So every app job ran.This PR:
FORK_CHANGES.mdchecks to.github/scripts/fork-changes-list.test.cjs(withfork-changes-list.cjs). The checks are: every fork setting is named, and no setting is named that does not exist. They run in Fork tests'workflowsjob, which runs on every pull request, and they readpackages/contracts/src/forkDefaults.tsas text. The test is listed in.github/fork-ci-tests.txt. The parse fails closed when the table is missing or empty, when ascope:has nokey:it can read, or when a scope is unknown.forkDocs.test.ts. That file still checksdocs/fork/README.md, which is not fork-owned.FORK_CHANGES.mdfork-owned in.github/fork-owned-paths.txt..github/fork-fleet.jsonstays excluded.fork-owned-reads.test.py. It used to drop every.mdname, so it could never have seen the vitest reader. It now counts a read of a.mdfile that the list owns by its own line (FORK_CHANGES.md). Runbook pointers matched by a wider line (.github/fork-*.md) still do not count. A new planted case covers this. The vitest reader is gone, so the real scan is clean.fork-owned-paths.test.py(FORK_CHANGES.md is now expected to be fork-owned). Updates the two docs that named the old test (FORK_CHANGES.md,docs/fork/updates.md).No workflow edit needed
The
workflowsjob's sparse checkout leaves outFORK_CHANGES.mdandforkDefaults.ts. In a sparse checkout (core.sparseCheckout=true), and only there, the test reads a missing file from the checked-out commit withgit show HEAD:<file>. actions/checkout's sparse fetch is partial (blob:none), so git fetches that blob on demand. A file missing from a full checkout, or from the commit, fails the test.Optional, not required: to skip the on-demand fetch, add these two lines to the
workflowsjob'ssparse-checkout:list in.github/workflows/fork-tests.yml. This agent's token cannot push workflow files.Proof
Same failures as the old test. All runs locally with
node --test .github/scripts/fork-changes-list.test.cjs:server.agentSlotsun-backticked)['server.agentSlots']server.notASetting)['server.notASetting']server.brandNew)Each guard was mutation-checked red. The checks: always fall back to the commit, never fall back, no
scope/keycount guard, no unknown-scope guard, no empty-table guard, table end ignored.fork-owned-reads.test.py:reads: [('packages/shared/src/forkDocs.test.ts', 'FORK_CHANGES.md')]..mdrule.fork-owned-paths.test.py: red ({"FORK_CHANGES.md": true}) before its expectation was updated, then green.F2 decision. The list's own
judge(), main vs this branch:fork-kit/x/y.py+FORK_CHANGES.mdFORK_CHANGES.mdonlyforkDefaults.tsonlyvp run check:changedpasses: format, lint, knip, typecheck,forkDocs.test.ts(24 pass) and the new node test.State question
FORK_CHANGES.md: fork-only, so the app jobs are skipped. Theworkflowsjob still runsfork-changes-list.test.cjs, so a missing or unknown setting is red there.forkDefaults.tsand notFORK_CHANGES.md:forkDefaults.tsis not fork-owned, so every job runs. Theworkflowsjob (Workflow lint and upstream drift, step "Fork script tests") catches the missing line, as theforkDefaults.ts-only row above shows. That job runs on every same-repo pull request whatever F2 decides.FORK_CHANGES.md: it names nothing, so "names every fork setting" fails with the full list. An empty or unreadableforkDefaults.tstable throws ("no row read"). It does not pass on empty state.Runner-minutes saved
In #238's run (44033525268), the jobs a fork-only PR skips (Build and Typecheck, Test 1-2, Test Web 1-3, Test Server 1-8, Rust, Release Smoke) took 2406 s together. A typical fork feature PR that changes only fork-owned paths plus its
FORK_CHANGES.mdline now saves about 40 runner-minutes. Wall-clock time drops by about 7 minutes: Test 1 alone was 403 s, and that is the issue's figure. The new test adds well under a second to theworkflowsjob.General vs project
.md) needs an exception for owned files of that type, or it can never see their readers..github/fork-owned-paths.txt, theworkflowsjob's sparse checkout,FORK_CHANGES.mdandforkDefaults.ts.Fixes #259
🤖 Generated with Claude Code