chore(ci): commit generated files and stop running codegen#7276
Draft
chore(ci): commit generated files and stop running codegen#7276
Conversation
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.
Every CI workflow currently runs
yarn setupwhich does GraphQL codegen and fetches network metadata from the backend on every job. This adds ~40s to every run, requires cloning the privaterainbow-envrepo for API keys in the unit-test workflow, and makes CI dependent on backend uptime. The generated output rarely changes (only when queries or backend schemas change), and our browser extension repo already commits its generated files without issues.This change commits the GraphQL type files (
src/graphql/__generated__/) and network metadata (src/references/networks.json) directly to the repo, then removesyarn setupfrom all CI workflows. The unit-test workflow no longer needs the env SSH key or.envclone at all since those were only required for codegen. Build workflows keep their.envsetup (still needed forIS_TESTING,ENABLE_DEV_MODE, and native prebuild hooks) but skip the codegen step.For
networks.jsonspecifically, this is safe because the committed file is only a boot-time seed. TheuseBackendNetworksStorealready fetches fresh network data at runtime every 30 minutes and persists it to storage, so the committed version only matters for the first seconds of a cold start with empty storage. For the GraphQL types, they're purely a compile-time concern. When backend schemas change, devs runyarn codegenlocally and commit the updated output, same as any other source change.The
yarn setupscript is removed sinceyarn codegennow covers the regeneration use case andds:installis a separate concern only relevant for the design system docs site. Thesetup-ci.shretry wrapper and references in convenience scripts (fast,install-all) are cleaned up accordingly.This simplifies both local dev setup and CI, and unblock further improvements. With codegen out of the picture, the unit-test workflow no longer needs any secrets beyond the sandbox SSH key for
yarn install, which simplifies splitting it into parallel jobs for each independent concern.NOTE: we can setup a scheduled Github workflow to check for drift between the committed gql and networks if we believe this to be an issue.