Repository navigation
fix(ci): keep a graduation green, and trigger Auto Fix on every generator input - #602
Merged
Merged
Conversation
…ator input A graduation left lint:arch red. src/upstream-gaps/lfs.ts was the one file drawing the declared edge upstream-gaps -> types, so once the Auto Fix bot rewrote or deleted it, architecture.yml carried a stale allowance the bot may not repair. gap.ts now exports OctokitLacks, a constraint type a gap file names over its own GAP: the tripwire still fires as TS2344 inside the gap file, which is what the graduate script reads, and a gap file imports only ./gap.js. The upstream-gaps: [types] edge is deleted, and the generated module map follows. Auto Fix did not run for a pull request that edited only a generator input outside src/. Its trigger paths gain docs/sections/*.docs.yml and docs/schema.docs.yml (the docs registry loads them for build:docs), test/e2e/openapi/paths.ts (imported by the validator build:docs reads), and biome.json and biome.local.jsonc (the formatter that every generator but the gaps index pipes its output through). Nothing else in the workflow changed. package-smoke.ts stopped at npm pack under npm 10, which runs the package's prepare script under --ignore-scripts and prints its output ahead of the JSON. npm 11 skips the script, so CI never saw it. The pack call adds --foreground-scripts=false. The generator-order comment in auto-fix-steps.ts named action.yml as the inputs table's source. It reads INPUT_DECLS from src/flows/inputs.ts.
Contributor
File size check0 over a hard cap (fails), 6 warning(s).
Split the file, wrap the line, shorten or exempt the comment, or list the path in 5 managed file(s) skipped; repo-platform owns them. |
Contributor
Member shape check1 finding(s).
Add the blank lines, make the comment one line directly above the item, comment every field or none, or list the path in 4 generated file(s) skipped. |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the CI reliability changes.
No open issues 🎉
What changed in this PR
This PR improves CI reliability for upstream-gap graduation, generated-file updates, and library package smoke checks.
Changes:
- Moves the Octokit graduation constraint into the shared gap module, removing a layer dependency that becomes stale after graduation.
- Expands Auto Fix triggers to cover documentation and formatter inputs, with regression tests for generator input coverage.
- Keeps
npm packoutput parseable under npm 10 by disabling foreground script output, with a regression test.
| File | Description |
|---|---|
test/scripts/graduate-upstream-gaps.test.ts |
Tests architecture validity after graduation and the relocated type-check tripwire. |
test/scripts/auto-fix-steps.test.ts |
Checks that generator modules and documentation inputs trigger Auto Fix. |
test/library/package-smoke.test.ts |
Tests JSON-only pack output with a printing prepare script. |
src/upstream-gaps/lfs.ts |
Uses the shared OctokitLacks constraint. |
src/upstream-gaps/gap.ts |
Defines the shared graduation constraint. |
docs/reference/architecture.md |
Removes the obsolete dependency from the generated diagram. |
architecture.yml |
Removes the upstream-gaps-to-types allowance. |
.github/workflows/auto-fix.yml |
Adds missing generator-input trigger paths. |
.github/scripts/package-smoke.ts |
Centralizes pack arguments and disables foreground script output. |
.github/scripts/auto-fix-steps.ts |
Corrects a comment identifying the inputs table's source. |
Review effort: Balanced
…longs The comment above the biome trigger paths said no test can see a subprocess's reads. The limit is narrower: the trigger test follows what a generator imports and loads, not what a subprocess opens.
Vivswan
marked this pull request as ready for review
November 12, 2026 04:22
This was referenced Nov 12, 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.
Before
After
How
gap.tsexportsOctokitLacks, a constraint a gap file names over its ownGAP.upstream-gaps: [types]leavesarchitecture.yml, a deliberate edit: a gap file now imports only./gap.js.auto-fix.ymlgains five trigger paths and a comment:docs/{sections/*.docs.yml,schema.docs.yml},test/e2e/openapi/paths.ts,biome.json,biome.local.jsonc. Nothing else about the workflow changed.prepareunder--ignore-scriptsand npm 11 skips it. CI packs with npm 11.--foreground-scripts=falsekeeps the JSON alone on stdout. No parser was written.Proof
package smoke: okunder npm 10.9.8 and under npm 11.21.2.Technical details
Trigger paths added
docs/sections/*.docs.ymlbuild:docssrc/sections/docs-registry.tsloads every section's file andshared.docs.ymlat importdocs/schema.docs.ymlbuild:docstest/e2e/openapi/paths.tsbuild:docstest/e2e/openapi/validate.ts, which was already listedbiome.json,biome.local.jsoncbuild:gaps-index.github/scripts/lib/biome-format.tspipes generated text throughbiome formatstrace -f -e trace=openat, and every repository file it opened was glob-checked againston.pull_request.paths..gitignore,lint/never-throw.grit,lint/rule-gate.grit. biome opens them while loading its config, and formatter output cannot depend on them.test/e2e/constants.ts,test/root.ts. They load besidevalidate.ts, but the bundler drops both: no export of theirs reaches a generator.- "<path>"lines and one two-line comment underon.pull_request.paths. Permissions, jobs, steps, and token use are byte-identical.Census script and its output
The tripwire the script reads
A scratch gap file over a route
@octokit/typesalready ships (GET /repos/{owner}/{repo}), compiled as the script compiles it:planGraduation()returnsgapFiles: ["src/upstream-gaps/shipped.ts"]and no foreign diagnostic on both sides.MustBeNeverinsidegap.ts: its argument must be provablynever, and for an arbitraryGit is not, soMustBeNever<Extract<G["routes"][number], keyof Endpoints>>is itself a TS2344 at the declaration.defineGap's parameter: the tripwire would fire as TS2322, which a typo in a gap file also raises.MustBeNeveritself is untouched:git grep -l MustBeNever -- src testlists 22 files undersrc/and 8 undertest/.src/: its homesrc/types.tsand 21 other matching files (one of them names it only in a comment), none of them insrc/upstream-gaps/.test/: 7 users, andtest/scripts/graduate-upstream-gaps.test.ts, where the name is text inside a string fixture.lfs.ts, and one mention in agap.tscomment.docs/reference/architecture.mdloses theupstream_gaps --> typesarrow, bybun run build:docs.The npm difference
preparewhateverignoreScriptssays, andnpm packruns scripts in the foreground by default, so the script's stdout precedes the JSON.ignoreScripts.How each block was captured
git archive <ref> | tar -x), the script's own rewrite, then the index, then the lint:bun -e 'import { toSpecOnlyGapSource } from "./.github/scripts/graduate-upstream-gaps.ts"; const f = "src/upstream-gaps/lfs.ts"; await Bun.write(f, toSpecOnlyGapSource(await Bun.file(f).text(), f));' bun .github/scripts/gen-gaps-index.ts bun .github/scripts/arch-lint.tsrm src/upstream-gaps/lfs.tsin place of the first line prints the same two results.bun -e 'import { parse } from "yaml"; const paths = parse(await Bun.file(".github/workflows/auto-fix.yml").text()).on.pull_request.paths; for (const path of process.argv.slice(1)) console.log(paths.some((p) => new Bun.Glob(p).match(path)) ? "triggers " : "does not match ", path);' docs/sections/labels.docs.yml src/sections/labels/index.tsbun install, put any npm 10 onPATH, and runbun .github/scripts/package-smoke.ts.Tests
bun test test/scripts/{arch-lint,auto-fix-steps,endpoint-docs,gen-docs,generated,graduate-upstream-gaps,nightly-steps,tsc-diagnostics}.test.ts test/library/package-smoke.test.ts test/lint/never-throw.test.ts test/sections/{docs-registry,graphql-queries}.test.ts test/workflows test/docs test/config/package-json.test.ts, afterbun run build:schema.test/scripts/graduate-upstream-gaps.test.ts: on a copy ofsrc/, lint:arch stays green with every spec-pinned gap rewritten and with every gap file deleted, beside an untouched control.test/scripts/auto-fix-steps.test.ts: every module a generator's bundle holds and every docs file the registry loads matches a trigger path.test/library/package-smoke.test.ts: a realnpm packunder the smoke's arguments, on a fixture whoseprepareprints, yields JSON alone.auto-fix-steps.tssaid the inputs table readsaction.yml. It readsINPUT_DECLSfromsrc/flows/inputs.ts.