Skip to content

Commit bf68a85

Browse files
coreymartinclaude
authored andcommitted
Parallelize gql-codegen with other checks tasks (#25485)
## Summary Merges the `gql-codegen` turbo invocation into the main checks turbo run, allowing it to execute in parallel with `format`, `circular-deps`, `package:checks`, and the `^build` dependencies that `lint`/`test` need. Also adds explicit `gql-codegen` as a `dependsOn` for `lint`, `test`, `types`, and `circular-deps` in turbo.json to ensure correctness — these tasks need the generated files from codegen. **Before:** ``` yarn deps:check && turbo gql-codegen && turbo run lint format test circular-deps package:checks ``` gql-codegen (~56s) blocks everything — format, circular-deps, package:checks all wait. **After:** ``` yarn deps:check && turbo run gql-codegen lint format test circular-deps package:checks ``` Turbo schedules all tasks optimally. Tasks that need codegen (lint, test, types, circular-deps) explicitly depend on it in turbo.json. Tasks that don't (format, package:checks) start immediately. ## Local benchmarks (interleaved, 10 pairs) Fair A/B comparison — each pair runs sequential then parallel back-to-back under identical cache conditions: | Pair | Sequential | Parallel | Saved | |------|-----------|----------|-------| | 1 | 3m 58s | 3m 31s | 26s | | 2 | 3m 57s | 3m 15s | 42s | | 3 | 4m 28s | 3m 36s | 51s | | 4 | 3m 58s | 2m 51s | 1m 07s | | 5 | 3m 41s | 3m 01s | 40s | | 6 | 3m 36s | 2m 36s | 59s | | 7 | 3m 28s | 2m 35s | 52s | | 8 | 4m 06s | 3m 08s | 58s | | 9 | 3m 50s | 3m 03s | 47s | | 10 | 3m 44s | 2m 59s | 44s | | **mean** | **3m 52s** | **3m 03s** | **49s (21%)** | | **median** | **3m 57s** | **3m 03s** | **51s** | **Parallel wins 10/10 pairs.** Also more consistent (1m range vs 1m 33s). ## CI validation (2 runs on 8-core ARM) | Metric | Sequential baseline | Parallel | |--------|-------------------|----------| | yarn checks | 3m 35s | 2m 43s | | check job | 5m 25s | 4m 21s | ## Test plan - [x] `yarn checks` passes in CI - [x] gql generated code check still passes - [x] Verified via `--dry` that lint/test/types/circular-deps depend on gql-codegen in correct workspaces - [x] Verified via verbose build that ops:gql-codegen completes before ops:lint starts - [x] Local interleaved benchmark: 10/10 pairs faster, mean 49s saved 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> GitOrigin-RevId: 311c089549739aea21310be574d328069eef79ae
1 parent 06ecc78 commit bf68a85

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"build-sb": "turbo run build-sb",
1111
"build": "turbo run build",
1212
"build:watch": "turbo run build:watch",
13-
"checks": "yarn deps:check && turbo gql-codegen && turbo run lint format circular-deps package:checks",
13+
"checks": "yarn deps:check && turbo run gql-codegen lint format circular-deps package:checks",
1414
"test-cmd": "turbo run test",
1515
"circular-deps": "turbo run circular-deps",
1616
"clean": "turbo run clean",

turbo.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"outputs": ["storybook-static/**"]
1919
},
2020
"circular-deps": {
21-
"dependsOn": []
21+
"dependsOn": ["gql-codegen"]
2222
},
2323
"clean": {
2424
"cache": false
@@ -42,10 +42,10 @@
4242
"cache": false
4343
},
4444
"lint": {
45-
"dependsOn": ["^build"]
45+
"dependsOn": ["^build", "gql-codegen"]
4646
},
4747
"lint:fix": {
48-
"dependsOn": ["^build"]
48+
"dependsOn": ["^build", "gql-codegen"]
4949
},
5050
"lint:watch": {
5151
"cache": false,
@@ -64,7 +64,7 @@
6464
"persistent": true
6565
},
6666
"test": {
67-
"dependsOn": ["^build"]
67+
"dependsOn": ["^build", "gql-codegen"]
6868
},
6969
"test:ui": {
7070
"dependsOn": ["^build"]
@@ -73,7 +73,7 @@
7373
"dependsOn": ["^build"]
7474
},
7575
"types": {
76-
"dependsOn": ["^build"]
76+
"dependsOn": ["^build", "gql-codegen"]
7777
},
7878
"types:watch": {
7979
"cache": false,

0 commit comments

Comments
 (0)