feat(ci): add a cf-typegen staleness check for worker-configuration.d.ts - #2599
Conversation
worker-configuration.d.ts is generated from wrangler.jsonc bindings via npm run cf-typegen, but unlike its sibling generated artifacts (openapi.json, migrations) there was no CI guard against it drifting. Two PRs that each independently add a wrangler binding can both pass CI in isolation, then merge sequentially and leave a stale committed worker-configuration.d.ts with zero prior gate signal. Added cf-typegen:check (wrangler types --check, which wrangler already supports natively -- no custom diffing script needed) and wired it into test:ci right after the migrations check. wrangler.jsonc and worker-configuration.d.ts are now backend-filter paths in ci.yml so the validate-code job's new drift-check step actually runs when either changes. Documented the new check in the contributing skill's reference table alongside the other generated-artifact guards. Closes #2557
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-02 12:20:15 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 6 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2599 +/- ##
==========================================
+ Coverage 95.99% 96.02% +0.02%
==========================================
Files 230 233 +3
Lines 25887 26077 +190
Branches 9410 9474 +64
==========================================
+ Hits 24851 25041 +190
Misses 425 425
Partials 611 611 🚀 New features to boost your workflow:
|
Summary
worker-configuration.d.tsis generated fromwrangler.jsoncbindings vianpm run cf-typegen, but unlike its sibling generated artifacts (openapi.json, migrations) there was no CI guard against it drifting.worker-configuration.d.ts, silently, with zero gate signal.Scope
package.json— addedcf-typegen:check(wrangler types --check, which wrangler already supports natively — no custom diffing script needed), wired intotest:ciright afterdb:migrations:check..github/workflows/ci.yml— addedwrangler.jsoncandworker-configuration.d.tsto thechangesjob'sbackendpath filter, and a new "cf-typegen drift check" step invalidate-code, gated identically to "Check migrations"..claude/skills/contributing-to-gittensory/reference.md— added a row to the CI-check table (thecf-typegenregeneration requirement itself was already documented inSKILL.md; this just closes the CI-enforcement gap).test/unit/ci-cf-typegen-check.test.ts— new regression tests asserting the npm script wiring, the path-filter change, and the workflow step's gating.Validation
npx vitest run test/unit/ci-cf-typegen-check.test.ts— 3/3 passingnpm run actionlint— cleannpm run typecheck— cleannpm run test:ci— full local gate green (includes the newcf-typegen:checkstep passing against the current committedworker-configuration.d.ts)npm audit --audit-level=moderate— 0 vulnerabilitiesSafety
wrangler.jsonc/worker-configuration.d.tssees zero added CI cost (path-gated, same pattern asdb:migrations:check).wrangler types --checkalready passes against it..github/workflows/**, a guarded path — expect this to be held for manual owner merge rather than auto-merged.Closes #2557