Repository navigation
Fail the codegen check only on drift the pull request caused - #9216
Open
craigmichaelmartin wants to merge 1 commit into
Open
craigmichaelmartin wants to merge 1 commit into
craigmichaelmartin wants to merge 1 commit into
Conversation
The check regenerates the GraphQL types from the latest schemas, which change on their own, so the generated files can differ on a pull request that doesn't touch GraphQL. The job's last step now fails only on differences the pull request or merge group could have caused, using bin/graphql-codegen/check-drift.js. A mirror pull request, whose changes the upstream repository's CI has already checked, only gets a warning. Co-Authored-By: Claude Opus 5.5 <[email protected]>
isaacroldan
reviewed
Dec 4, 2026
| - name: Run git diff | ||
| run: git diff | ||
| - name: Fail if any changes were made | ||
| run: 'test -z "$(git status --porcelain)" || { echo -e "Run pnpm graphql-codegen when queries are changed, committing any fixes and generated files" ; exit 1; }' |
Contributor
There was a problem hiding this comment.
I think we don't need to check this on Github anymore, this should only happen in World.
Once code reaches CLI; it doesn't matter if the schemas change as it is 100% unrelated to the mirrored code (otherwise it couldn't have been merged in World)
This branch has not been deployed
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.
WHY are these changes introduced?
Check graphql-codegen has been runregenerates the GraphQL types from the latest schemas and fails on any difference. The schemas change on their own, so the check can fail on a pull request that doesn't touch GraphQL. Of the 38 times this job failed since 2026-11-16, 37 were schema changes that the pull request didn't make.The upstream repository is about to stop failing its own pull requests on such differences. After that, a mirror pull request can bring a change while the generated files are behind a schema change made elsewhere. With the current step, that would block the mirror until the files are regenerated.
WHAT is this pull request doing?
It changes the last step of the
Check graphql-codegen has been runjob, and nothing else:world-mirror/mainbranch of this repository), it lists the differing files in a warning and passes. The upstream repository's CI has already checked those changes, so any difference comes from a schema change made since.bin/graphql-codegen/check-drift.js. That script fails when the change edits the operations or generated files of an API whose files differ, or something codegen reads for every API, such asgraphql.config.ts,package.jsonor the lockfile. It also fails when it can't tell which files changed. The other differences pass with a warning.bin/graphql-codegen/check-drift.jsarrives with a later mirror update. Until then, a pull request that isn't a mirror pull request and has a difference fails as it does now, with a missing-module error instead of the hint. Release branches keep their own copy of this workflow, so only branches cut after this change get it.How to manually test your changes?
Once
bin/graphql-codegen/check-drift.jsis onmain:pnpm graphql-codegen:get-graphql-schemas && pnpm graphql-codegenpackages/app/src/cli/api/graphql/app-logs/app_logs_schema.graphqlthatpackages/app/src/cli/api/graphql/app-logs/generated/types.d.tsrepeats, such as the one onLogFilterField, and runpnpm graphql-codegenagain.printf 'packages/theme/src/index.ts\n' > /tmp/changed-files && node bin/graphql-codegen/check-drift.js --changed-files /tmp/changed-fileswarns and exits 0.printf 'packages/app/src/cli/api/graphql/app-logs/queries/historical-logs.graphql\n' > /tmp/changed-files && node bin/graphql-codegen/check-drift.js --changed-files /tmp/changed-filesexits 1.Checklist
patchfor bug fixes ·minorfor new features ·majorfor breaking changes) and added a changeset withpnpm changeset add🤖 Generated with Claude Code