Skip to content

ci: run Node and Cloudflare E2E as separate jobs and report every failing shard - #4329

Open
danielmlr wants to merge 1 commit into
mainfrom
daniel/ci-e2e-split-targets
Open

danielmlr wants to merge 1 commit into
mainfrom
daniel/ci-e2e-split-targets

Conversation

@danielmlr

@danielmlr danielmlr commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Runs Node and Cloudflare E2E as separate jobs. A red run now shows every failing shard.

Each E2E shard ran the Node tests and then the Cloudflare tests, so the slowest shard paid for both. #3277 paired them to cut the job count while the org could run only 20 jobs at a time. That limit is gone. test-e2e-node and test-e2e-cloudflare now run 8 shards each. Each starts only when the test plan selects its target and builds only its own fixture. Each gets a 25-minute timeout instead of 40, about twice the slowest run measured. The Tests job checks both, and required check names don't change.

Once #4447 and a separate playground job have merged, E2E is the slowest job again, and this split takes a full run from about 13 to about 10 minutes. Each extra job pays its own install and build, so a full run takes about 15 more runner minutes: the 16 E2E jobs took 110.5 runner minutes on this PR's CI run, against about 95 for the 8 combined shards on main. 12 combined shards would cost about the same (about +14). So the reason for the split isn't runner minutes. It's the shorter E2E job: each one ends about 1.5 minutes sooner, which the later steps in #4449 need, and each target gets its own job and timeout.

The core unit test shards and both E2E jobs go back to fail-fast: false. With fail-fast, "Re-run failed jobs" also re-ran every shard that fail-fast had cancelled. In run 39123937452, one flaky shard failed and all 8 ran again. The cost is that a failing run turns red only when its slowest shard finishes, not as soon as the first one fails. That run went red 51 seconds after its failure. Without fail-fast, it would have waited for the other shards, and the split makes them shorter.

main runs CI one at a time, with one waiting slot. From 2026-10-17 to 10-20, 25 of 70 CI runs on main were replaced by a newer push before any job started. Shorter runs mean more main commits get tested.

#4447 changes the same E2E step, so this PR gets rebased onto it once it merges.

Part of #4449

Type of change

  • Bug fix
  • Feature (requires an accepted feature plan or RFC)
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Your connection to this change

  • I use EmDash and ran into the problem this PR addresses
  • I maintain a tool, dependency, or service that EmDash uses, and this change concerns that integration
  • A Maintainer approved this specific change before I opened the PR

Checklist

  • I have read CONTRIBUTING.md
  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test passes (or targeted tests for my change)
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable) (n/a: workflow change; the CI run below exercises it)
  • User-visible strings in the admin UI are wrapped for translation (if applicable). Do not include messages.po changes except in translation PRs — a workflow extracts catalogs on merge to main. (n/a: no admin UI change)
  • I have added and reviewed the user-facing changeset (if this PR changes a published package) (n/a: CI workflow only)
  • New features link to their merged design PR: https://github.com/emdash-cms/emdash/pull/... (n/a: not a feature)
  • I have included screenshots below if this PR changes the UI (n/a: no UI change)

AI assistance disclosure

  • This PR includes AI-generated code or text — model/tool: Claude Opus 5.5

Screenshots / test output

Test output:

@changeset-bot

changeset-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 8a15eb6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@emdashbot emdashbot Bot left a comment

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.

Splitting the Node and Cloudflare E2E targets into independent jobs is a sound way to stop every shard from running both targets in series. Disabling fail-fast also fits the goal, since "Re-run failed jobs" now re-runs only the shards that failed. Both reviewers approved and found no actionable issues.

The reviewers checked the gating of each job on its test-plan.mjs output and the needs list and check_lane handling in the Tests aggregate. They also checked the per-target fixture builds, the artifact naming and upload condition, and the retained E2E Tests and Tests job names. One caveat remains: it could not be confirmed statically that no branch ruleset still requires the old E2E shard (n/8) check names. CI execution and the reported timing improvements were not verified. No changeset is needed, because only the CI workflow changes.


Reviewed by anthropic/claude-opus-5-5 and openai/gpt-6.1-sol.

@swissky
swissky added this pull request to stack #4404 October 25, 2026 19:59

@khoinguyenpham04 khoinguyenpham04 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks

@emdashbot emdashbot Bot added review/needs-review No maintainer or bot review yet and removed review/needs-review No maintainer or bot review yet labels Oct 27, 2026
Base automatically changed from daniel/ci-e2e-build-once to main October 27, 2026 17:34
…ling shard

Each E2E shard ran the Node target and then the Cloudflare target, so the
slowest shard paid for both and set the run's wall clock. #3277 paired
them to cut the job count while the org could run only 20 jobs at a time,
and that limit no longer applies.

Run test-e2e-node and test-e2e-cloudflare as separate 8-shard matrices,
each gated on its own plan output and building only its own fixture, and
have the Tests job check both.

Set fail-fast: false on the vitest and E2E matrices again, so a red run
shows every failing shard and 'Re-run failed jobs' repeats only those
instead of every shard that fail-fast cancelled.
@danielmlr
danielmlr force-pushed the daniel/ci-e2e-split-targets branch from 8842da7 to 8a15eb6 Compare October 27, 2026 17:34
@github-actions github-actions Bot added query-count changed PR diff modifies query-count snapshot files review/needs-rereview New commits since the last review and removed query-count changed PR diff modifies query-count snapshot files review/needs-review No maintainer or bot review yet labels Oct 27, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://daniel-ci-e2e-split-targets.try.emdashcms.com, https://daniel-ci-e2e-split-targets-emdash-playground.emdash-cms.workers.dev (commit 8a15eb6)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://58c03701.try.emdashcms.com, https://58c03701-emdash-playground.emdash-cms.workers.dev 8a15eb6 2026-10-27T17:38:31.172Z Visit the dashboard ↗

@emdashbot emdashbot Bot left a comment

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.

Splitting the E2E targets remains a sound approach to reducing serial CI work while letting every failing shard finish and report.

For this follow-up, I checked the current workflow against the PR diff and the updated fixture setup: target selection, per-target builds, matrix failure handling, artifact uploads, and both lanes’ inclusion in the Tests aggregate remain consistent. The previous review had no actionable findings, and I found no new issues to fix.

Static review only; CI execution, timing improvements, and external branch-ruleset requirements were not independently verified.


Follow-up review by openai/gpt-6.1-sol, scoped to the changes since the last review.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants