Skip to content

Single-source codegen freshness checks via pnpm codegen scripts#7732

Draft
dmerand wants to merge 2 commits into
mainfrom
donald/dx-codegen-aggregator
Draft

Single-source codegen freshness checks via pnpm codegen scripts#7732
dmerand wants to merge 2 commits into
mainfrom
donald/dx-codegen-aggregator

Conversation

@dmerand
Copy link
Copy Markdown
Contributor

@dmerand dmerand commented Jun 5, 2026

WHY are these changes introduced?

The two generated-file gates (Check graphql-codegen has been run, Check OCLIF manifests & readme & docs) inline their regenerate-and-verify steps in tests-pr.yml. No local command runs the same steps, so staleness surfaces only as a CI failure and gets fixed piecemeal. The regeneration list lives in both the workflow and contributors' memory, so the two drift.

WHAT is this pull request doing?

package.json becomes the single source of codegen freshness, used by humans and CI:

Script Does
pnpm codegen Regenerate every generated artifact
pnpm codegen:check:graphql / :oclif Regenerate, then assert the tree is clean

bin/check-codegen-clean.js holds each check's owned paths and fix message. The graphql-schema and oclif-checks jobs now call these scripts instead of inlining steps (−24/+4).

Behavior-preserving: same generators, order, and per-area messages. Job names, runners, and the oclif Build step are unchanged, so required checks and the merge queue are unaffected. Not user-facing.

How to test your changes?

  1. Clean checkout: pnpm codegen produces no diff (idempotent).
  2. Add a flag without refreshing: pnpm codegen:check:oclif fails with Run pnpm refresh-manifests… and the diff; pnpm codegen restores clean.
  3. The two gate jobs pass/fail as before.

Notes

  • No combined codegen:check: the whole-repo git status asserts cross-contaminate in one working tree, so CI keeps them as isolated fresh-checkout jobs.
  • pnpm codegen is non-idempotent on main today — it deletes orphaned config:autoupgrade docs, which the OCLIF gate doesn't catch (asserts only generated/*.json). Pre-existing; separate fix.

Post-release steps

None.

@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label Jun 5, 2026
Copy link
Copy Markdown
Contributor Author

dmerand commented Jun 5, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant