mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #5630] [MERGED] ci: shard the browser matrix, cache browsers, and gate unaffected PRs #6857
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#6857
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5630
Author: @kolacheee
Created: 8/29/2026
Status: ✅ Merged
Merged: 8/29/2026
Merged by: @kolacheee
Base:
staging← Head:feat/5622-fast-browser-matrix📝 Commits (1)
29867f3ci: shard the browser matrix, cache browsers, and gate unaffected PRs📊 Changes
2 files changed (+310 additions, -24 deletions)
View changed files
➕
.github/actions/playwright-shard/action.yml(+68 -0)📝
.github/workflows/playwright.yml(+242 -24)📄 Description
Closes #5622 — items 1–4. The smoke-subset policy variant is deliberately not included, per maintainer decision.
What changed
playwright.ymlis restructured around a shared composite action (.github/actions/playwright-shard); the node lane is untouched.1. Sharding (the big one). Each browser lane now runs as 3 parallel shard jobs (
--shard=k/3), taking wall time from 15–21 min toward the length of one third of the suite. One discovery en route: with the config'sfullyParallel: false, Playwright's shard unit is the file — and this suite is one 19,800-line file, so plain--shardput all 197 tests in shard 1 and zero elsewhere. The fix is--fully-parallel --workers=1on the CI invocation only:--fully-parallelchanges just the sharding granularity to individual tests, while--workers=1keeps execution inside each shard strictly serial in file order — the no-concurrent-tests-against-one-server property thatfullyParallel: falseexists to protect. Each shard job is its own runner booting its own servers with a fresh data dir. Distribution verified: 66/66/65.2. "Build once" — implemented as its honest version. The issue's premise that each job rebuilds the app turned out to overstate: the Playwright webServer builds only the shared package (~40s) and then runs dev servers; the client is never production-built in this workflow. A serial prebuild job would add more gate latency than nine parallel 40-second shared builds cost, so there is no artifact hand-off — the per-job work that actually dominated (browser downloads, suite runtime) is what items 1 and 3 remove. Prebuilding the client for tests would mean testing
vite previewinstead of the dev server the suite was written against — out of scope.3. Playwright browser cache.
~/.cache/ms-playwright, keyed on OS + browser + the installed@playwright/testversion. On a hit,playwright installskips the download (the WebKit bundle is the chunky one);--with-deps' OS packages still install, as they must.4. Skip gate for unaffected PRs. A fast
browser-lane-gatejob diffs the PR's merge commit against its first parent (exactly the PR's change set) and skips the shard jobs when every changed file matches the narrow skip list:docs/**,**/*.md,.gitattributes,win/**,android/**,scripts/regressions/**— files the running app can never load. Anything else (server, client, e2e, workflows, lockfile, launcher scripts) runs the lanes; so does any push,workflow_dispatch, or a diff the gate can't determine (conservative fallback). This is an in-workflow gate, not a workflow-levelpaths:filter, for the required-checks reason documented in the issue.Branch-protection compatibility: the shard jobs have new names (
desktop-chromium 1/3, …), but three fan-in jobs carry the exact pre-existing check names —desktop-chromium,mobile-chromium,mobile-webkit. Each passes when its shards all passed, passes with a "skipped: cannot affect the browser lanes" note when the gate proved it, and fails otherwise — including when the gate job itself fails, so a broken gate can never green the matrix.The honest risk, and how it was validated
Mid-file shards start against a fresh server with none of the earlier tests' accumulated state, so any test that silently depended on a predecessor's side effects would fail in shards 2/3. All three desktop-chromium shards were run locally from cold starts: shard 2 — 64/64 passed, shard 3 — 54/54 passed (remainder skipped by project gates), shard 1 — 63 passed with one failure of the pre-existing "Echo Chamber size persistence" pixel-tolerance flake, which passes 3/3 solo — an independent intermittent, not order coupling (worth its own #5618-style look if it recurs in CI). Two earlier local shard-2 runs failed en masse with
ECONNREFUSED— that turned out to be this Windows machine's known consecutive-run server-startup artifact, not the sharding (the clean re-runs above are decisive). The mobile lanes run the same single file with the same ordering profile, and this PR's own CI run exercises all nine shard jobs end-to-end on the runners that matter.Validation done
Manually verify
desktop-chromium,mobile-chromium,mobile-webkit) appear on this PR and match whatever branch protection requiresSummary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.