Skip to content

ci: shard ai and codemod tests#15404

Merged
gr2m merged 3 commits into
mainfrom
ci/shard-ai-codemod-tests
May 18, 2026
Merged

ci: shard ai and codemod tests#15404
gr2m merged 3 commits into
mainfrom
ci/shard-ai-codemod-tests

Conversation

@gr2m
Copy link
Copy Markdown
Collaborator

@gr2m gr2m commented May 18, 2026

Background

ai + codemod are slow tail tasks. Fixes #15403.

Summary

  • exclude ai + @ai-sdk/codemod from regular Test matrix
  • add dedicated 4-shard matrices for both
  • keep Node 20/22/24 coverage

Manual Verification

  • pnpm run check
  • pnpm --dir packages/ai test:node --shard 1/4
  • pnpm --dir packages/codemod exec vitest --config vitest.config.ts --run --shard 1/4
  • dry run confirms regular matrix excludes ai#test and @ai-sdk/codemod#test

Impact

CI run 26050427856 passed.

Regular Run tests step:

  • Node 20: 351s (baseline ~451s)
  • Node 22: 334s (baseline ~394s)
  • Node 24: 276s (baseline ~361s)

Shard jobs:

  • AI shards: max job 127s, shard test step max 39s
  • Codemod shards: max job 53s, shard test step max 8s

Net: regular Test jobs got faster, but CI fanout increased. Useful as isolation/sharding groundwork; wall-time win is mixed until combined with the other PRs.

Checklist

  • All commits are signed (PRs with unsigned commits cannot be merged)
  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

Related Issues

Fixes #15403

Split the two slowest package test tasks into dedicated shard matrices and exclude them from the regular Test matrix.

Fixes #15403

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread .github/workflows/ci.yml
test_ai_matrix:
name: 'Test AI'
runs-on: ubuntu-latest
strategy:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test_ai_matrix job redundantly builds packages on each of its 12 matrix runners instead of using the centralized build-packages artifact that all other jobs use.

Fix on Vercel

@gr2m gr2m merged commit 962aaec into main May 18, 2026
43 checks passed
@gr2m gr2m deleted the ci/shard-ai-codemod-tests branch May 18, 2026 19:40
gr2m added a commit that referenced this pull request May 19, 2026
Bundles the intent of these main-branch PRs into release-v6.0, adapted
to v6's CI structure (keeps Node 20/22/24 matrix; uses tag-style action
refs rather than SHA pins):

- #15400 ci: reuse package builds in test jobs
- #15407 test(ai): share Vitest config
- #15404 ci: shard ai and codemod tests
- #15411 ci: narrow PR test node matrix
- #15409 ci: gate RSC Playwright tests
- #15417 ci: delete obsolete discussion workflows
- #15418 ci: notify about failures on main and release branches
- #15419 ci: speed build build-examples job

Not backported: #15390 (bump min node to 22), #15389 (deps), #15421
(agent UI generic).
gr2m added a commit that referenced this pull request May 19, 2026
Bundles the intent of these main-branch PRs into release-v5.0, adapted
to v5's CI structure (keeps Node 20/22/24 matrix; uses tag-style action
refs rather than SHA pins; load-time job stays in examples/ai-core):

- #15400 ci: reuse package builds in test jobs
- #15407 test(ai): share Vitest config
- #15404 ci: shard ai and codemod tests
- #15411 ci: narrow PR test node matrix
- #15409 ci: gate RSC Playwright tests
- #15417 ci: delete obsolete discussion workflows (already absent on v5)
- #15418 ci: notify about failures on main and release branches
- #15419 ci: speed build build-examples job

Not backported: #15390 (bump min node to 22), #15389 (deps), #15421
(agent UI generic).
gr2m added a commit that referenced this pull request May 19, 2026
Bundles the intent of these main-branch PRs into release-v5.0, adapted
to v5's CI structure (keeps Node 20/22/24 matrix; uses tag-style action
refs rather than SHA pins; load-time job stays in examples/ai-core):

- #15400 ci: reuse package builds in test jobs
- #15407 test(ai): share Vitest config
- #15404 ci: shard ai and codemod tests
- #15411 ci: narrow PR test node matrix
- #15409 ci: gate RSC Playwright tests
- #15417 ci: delete obsolete discussion workflows (already absent on v5)
- #15418 ci: notify about failures on main and release branches
- #15419 ci: speed build build-examples job

Not backported: #15390 (bump min node to 22), #15389 (deps), #15421
(agent UI generic).
gr2m added a commit that referenced this pull request May 19, 2026
Bundles the intent of these main-branch PRs into release-v6.0, adapted
to v6's CI structure (keeps Node 20/22/24 matrix; uses tag-style action
refs rather than SHA pins):

- #15400 ci: reuse package builds in test jobs
- #15407 test(ai): share Vitest config
- #15404 ci: shard ai and codemod tests
- #15411 ci: narrow PR test node matrix
- #15409 ci: gate RSC Playwright tests
- #15417 ci: delete obsolete discussion workflows
- #15418 ci: notify about failures on main and release branches
- #15419 ci: speed build build-examples job

Not backported: #15390 (bump min node to 22), #15389 (deps), #15421
(agent UI generic).
gr2m added a commit that referenced this pull request May 19, 2026
Bundles the intent of these main-branch PRs into release-v5.0, adapted
to v5's CI structure (keeps Node 20/22/24 matrix; uses tag-style action
refs rather than SHA pins; load-time job stays in examples/ai-core):

- #15400 ci: reuse package builds in test jobs
- #15407 test(ai): share Vitest config
- #15404 ci: shard ai and codemod tests
- #15411 ci: narrow PR test node matrix
- #15409 ci: gate RSC Playwright tests
- #15417 ci: delete obsolete discussion workflows (already absent on v5)
- #15418 ci: notify about failures on main and release branches
- #15419 ci: speed build build-examples job

Not backported: #15390 (bump min node to 22), #15389 (deps), #15421
(agent UI generic).
gr2m added a commit that referenced this pull request May 19, 2026
Bundles the intent of these main-branch PRs into release-v6.0, adapted
to v6's CI structure (keeps Node 20/22/24 matrix; uses tag-style action
refs rather than SHA pins):

- #15400 ci: reuse package builds in test jobs
- #15407 test(ai): share Vitest config
- #15404 ci: shard ai and codemod tests
- #15411 ci: narrow PR test node matrix
- #15409 ci: gate RSC Playwright tests
- #15417 ci: delete obsolete discussion workflows
- #15418 ci: notify about failures on main and release branches
- #15419 ci: speed build build-examples job

Not backported: #15390 (bump min node to 22), #15389 (deps), #15421
(agent UI generic).
gr2m added a commit that referenced this pull request May 19, 2026
Bundles the intent of these main-branch PRs into release-v6.0, adapted
to v6's CI structure (keeps Node 20/22/24 matrix; uses tag-style action
refs rather than SHA pins):

- #15400 ci: reuse package builds in test jobs
- #15407 test(ai): share Vitest config
- #15404 ci: shard ai and codemod tests
- #15411 ci: narrow PR test node matrix
- #15409 ci: gate RSC Playwright tests
- #15417 ci: delete obsolete discussion workflows
- #15418 ci: notify about failures on main and release branches
- #15419 ci: speed build build-examples job

Not backported: #15390 (bump min node to 22), #15389 (deps), #15421
(agent UI generic).
gr2m added a commit that referenced this pull request May 19, 2026
Bundles the intent of these main-branch PRs into release-v5.0, adapted
to v5's CI structure (keeps Node 20/22/24 matrix; uses tag-style action
refs rather than SHA pins; load-time job stays in examples/ai-core):

- #15400 ci: reuse package builds in test jobs
- #15407 test(ai): share Vitest config
- #15404 ci: shard ai and codemod tests
- #15411 ci: narrow PR test node matrix
- #15409 ci: gate RSC Playwright tests
- #15417 ci: delete obsolete discussion workflows (already absent on v5)
- #15418 ci: notify about failures on main and release branches
- #15419 ci: speed build build-examples job

Not backported: #15390 (bump min node to 22), #15389 (deps), #15421
(agent UI generic).
gr2m added a commit that referenced this pull request May 19, 2026
Bundles the intent of these main-branch PRs into release-v6.0, adapted
to v6's CI structure (keeps Node 20/22/24 matrix; uses tag-style action
refs rather than SHA pins):

- #15400 ci: reuse package builds in test jobs
- #15407 test(ai): share Vitest config
- #15404 ci: shard ai and codemod tests
- #15411 ci: narrow PR test node matrix
- #15409 ci: gate RSC Playwright tests
- #15417 ci: delete obsolete discussion workflows
- #15418 ci: notify about failures on main and release branches
- #15419 ci: speed build build-examples job

Not backported: #15390 (bump min node to 22), #15389 (deps), #15421
(agent UI generic).
gr2m added a commit that referenced this pull request May 20, 2026
## Summary

Bundles the intent of eight main-branch CI PRs from May 18 into
`release-v5.0`. Each PR was manually adapted to v5's CI structure rather
than cherry-picked, because v5 still uses `@vN`-tag action refs (not SHA
pins), keeps the Node 20/22/24 matrix, has a flatter \`ci.yml\` (no
\`konsistent\` job), and runs the load-time benchmark from
\`examples/ai-core\` (not \`ai-functions\`).

### Backported

- #15400 \`ci: reuse package builds in test jobs\` — adds a
\`build-packages\` job that uploads \`packages/*/dist\`;
test/bundle-size/load-time jobs download instead of rebuilding.
- #15407 \`test(ai): share Vitest config\` — extracts
\`packages/ai/vitest.config.js\` factory.
- #15404 \`ci: shard ai and codemod tests\` — adds \`test_ai_matrix\` +
\`test_codemod_matrix\` (4 shards × Node 20/22/24); excludes ai +
codemod from regular Test matrix via \`pnpm test:ci\`.
- #15411 \`ci: narrow PR test node matrix\` — adds
\`test_node_versions\` planner; PRs without package source/test changes
use Node 22 only.
- #15409 \`ci: gate RSC Playwright tests\` — detects RSC-relevant PR
changes; skips Playwright install + sets \`SKIP_RSC_E2E=1\` when
irrelevant.
- #15417 \`ci: delete obsolete discussion workflows\` — no-op for
workflow deletes (already absent on v5); adds \`SKIP_RSC_E2E\` env to
relevant turbo tasks.
- #15418 \`ci: notify about failures on main and release branches\` —
adds CI to the Slack workflow_run watchlist with a branch filter;
corrects a verify-changesets comment.
- #15419 \`ci: speed build build-examples job\` — shards
\`build-examples\` into 4 with build caching.

### Not backported (per request)

- #15390 (bump min Node to 22 — breaking change)
- #15389 (dependency updates)
- #15421 (refactor: introduce agent UI message generic)

### Adaptations to v5

- Kept Node \`[20, 22, 24]\` everywhere (no jump to \`[22, 24, 26]\`).
- Used tag-style action refs (\`actions/checkout@v6\` etc.) instead of
main's pinned SHAs.
- Skipped the \`konsistent\` job since v5's ci.yml never had it.
- Load-time job runs from \`examples/ai-core\` with v5's existing
thresholds (ai max 95ms).
- Build-examples shard filters use v5's example names (e.g. includes
\`@example/next-openai\` which exists on v5 but not on main; uses
\`@example/next-openai-upstash-rate-limits\` to match v5's package name;
omits \`@example/next-workflow\`).
- Discussion workflows already absent on v5, so only the turbo.json
portion of #15417 applies.

## Test plan

- [ ] CI passes on this PR
- [ ] \`Test\` jobs run \`pnpm test:ci\` (regular packages, excludes
ai/codemod)
- [ ] \`Test AI\` runs 4 shards × Node 20/22/24
- [ ] \`Test Codemod\` runs 4 shards × Node 20/22/24
- [ ] PRs without package source changes get Node 22-only Test matrix
- [ ] Non-RSC changes skip Playwright install
- [ ] Build-examples shards complete in parallel with cache restore
gr2m added a commit that referenced this pull request May 20, 2026
## Summary

Bundles the intent of eight main-branch CI PRs from May 18 into
`release-v6.0`. Each PR was manually adapted to v6's CI structure rather
than cherry-picked, because v6 still uses `@vN`-tag action refs (not SHA
pins), keeps the Node 20/22/24 matrix, and has a flatter `ci.yml` (no
\`konsistent\` job).

### Backported

- #15400 \`ci: reuse package builds in test jobs\` — adds a
\`build-packages\` job that uploads \`packages/*/dist\`;
test/bundle-size/load-time jobs download instead of rebuilding.
- #15407 \`test(ai): share Vitest config\` — extracts
\`packages/ai/vitest.config.js\` factory.
- #15404 \`ci: shard ai and codemod tests\` — adds \`test_ai_matrix\` +
\`test_codemod_matrix\` (4 shards × Node 20/22/24); excludes ai +
codemod from regular Test matrix via \`pnpm test:ci\`.
- #15411 \`ci: narrow PR test node matrix\` — adds
\`test_node_versions\` planner; PRs without package source/test changes
use Node 22 only.
- #15409 \`ci: gate RSC Playwright tests\` — detects RSC-relevant PR
changes; skips Playwright install + sets \`SKIP_RSC_E2E=1\` when
irrelevant.
- #15417 \`ci: delete obsolete discussion workflows\` — deletes
\`discussions-auto-close-{new,stale}.yml\`; adds \`SKIP_RSC_E2E\` env to
relevant turbo tasks.
- #15418 \`ci: notify about failures on main and release branches\` —
adds CI to the Slack workflow_run watchlist with a branch filter;
corrects a verify-changesets comment.
- #15419 \`ci: speed build build-examples job\` — shards
\`build-examples\` into 4 with build caching.

### Not backported (per request)

- #15390 (bump min Node to 22 — breaking change)
- #15389 (dependency updates)
- #15421 (refactor: introduce agent UI message generic)

### Adaptations to v6

- Kept Node \`[20, 22, 24]\` everywhere (no jump to \`[22, 24, 26]\`).
- Used tag-style action refs (\`actions/checkout@v6\` etc.) instead of
main's pinned SHAs.
- Skipped the \`konsistent\` job since v6's ci.yml never had it.
- Build-examples shard filters mirror main; missing examples on v6 (e.g.
\`@example/next-workflow\`) become no-ops under turbo filters.
- Load-time job continues to use \`examples/ai-functions\` with v6's
existing thresholds (ai max 100ms).

## Test plan

- [ ] CI passes on this PR
- [ ] \`Test\` jobs run \`pnpm test:ci\` (regular packages, excludes
ai/codemod)
- [ ] \`Test AI\` runs 4 shards × Node 20/22/24
- [ ] \`Test Codemod\` runs 4 shards × Node 20/22/24
- [ ] PRs without package source changes get Node 22-only Test matrix
- [ ] Non-RSC changes skip Playwright install
- [ ] Build-examples shards complete in parallel with cache restore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: shard ai and codemod tests

1 participant