Skip to content

ci: share a bench setup action and stop evicting the browser cache - #305

Merged
harshtandiya merged 1 commit into
developfrom
ci/speed-up-workflows
Jul 29, 2026
Merged

ci: share a bench setup action and stop evicting the browser cache#305
harshtandiya merged 1 commit into
developfrom
ci/speed-up-workflows

Conversation

@harshtandiya

Copy link
Copy Markdown
Collaborator

Playwright job usually ran ~5 min but spiked to ~15. The variance was one step: Install Playwright, 16s on a good run vs 624s on a bad one (runs 30474649946 / 30473372443). Tests themselves are stable at ~110s.

Cause: gh cache list shows the repo at GitHub's 10 GB cache cap with >8 GB of it yarn (Linux-yarn-* at 1.17 GB, 1.18 GB, 0.90 GB ×2, 0.77 GB). LRU eviction kills the 249 MB Playwright cache, so chromium re-downloads. The yarn caches grew forever because restore-keys restored the previous cache, bench build added to it, and the union got saved under a new key.

Fix: both test workflows now use setup-node's built-in yarn cache, no restore-keys, sharing one entry with typecheck/unit-tests. Playwright cache keys on yarn.lock instead of hashFiles('**/package.json')dashboard/package.json changed 5× in the last 50 commits and was busting it for unrelated reasons.

Also extracts the provisioning both workflows duplicated into .github/actions/setup-bench, and overlaps what shares no state: apt with uv tool install frappe-bench, and bench build with bench new-site. Plus mariadb 10.6 → 11.8 with tmpfs and durability off, and bench build dropped from the server job.

Non-obvious bits a reviewer can't get from the diff:

  • bench build runs root package.json's "build": "cd dashboard && yarn build" via frappe's esbuild --run-build-command. It's a full vite build — that's why overlapping it with new-site is the win, not a micro-opt.
  • No NODE_ENV: production, though frappe sets it. vite, tailwindcss, @vitejs/plugin-vue and @playwright/test are all devDependencies here; it would break the build and the tests.
  • socketio stays in the Procfile. Frappe only strips it in server tests. dashboard/src/main.ts:44 calls initSocket() on boot.
  • Root install needs --ignore-scripts — the root postinstall is cd dashboard && yarn install.
  • bench setup requirements --dev installs only python dev deps (bench/commands/setup.py, the else branch), so running it alongside --node is not a race.
  • bench get-app's NAME arg is nargs=-1 and documented "Dummy argument for backward compatibility" — a bare URL is enough.

Not done: sharding Playwright (110s of tests vs ~100s provisioning per shard), workers > 1 (projects share server state, playwright.config.ts:20), caching all of ~/frappe-bench (1–2 GB into the budget that caused this).

Deferred: the oversized Linux-yarn-* cache entries still need gh cache delete. Pointless before this merges — develop's current workflows would recreate them on the next run.

Checks: actionlint clean, YAML parses, shellcheck clean on every run block, composite inputs cross-checked against both callers. Not run: the workflows themselves — they only execute on GitHub, so CI on this PR is the first real test. Expect the first run to be slow (cold caches); the second is the measurement.

The Playwright job usually took ~5 min but spiked to ~15. The variance was
entirely the "Install Playwright" step (16s vs 624s): the repo sits at
GitHub's 10 GB Actions cache cap, >8 GB of it yarn, so the 249 MB browser
cache kept getting evicted and chromium re-downloaded.
The yarn caches grew without bound because `restore-keys` restored the
previous cache, the build added to it, and the union was saved under a new
key. Both test workflows now use setup-node's built-in yarn cache with no
restore-keys, sharing one entry with the two dashboard workflows.
Also extracts the provisioning both workflows duplicated into a composite
action, and overlaps the parts that share no state: apt with the bench
install, and `bench build` with `bench new-site`.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@greptile-appsgreptile-appsBot 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@harshtandiya
harshtandiya merged commit 36eb7bf into developJul 29, 2026
7 checks passed
@harshtandiya
harshtandiya deleted the ci/speed-up-workflows branch July 29, 2026 18:06
harshtandiya added a commit that referenced this pull request Jul 29, 2026
Brings main to parity with develop at a4f52b2: the buzz/api domain package
split (#295-#303), the shared bench setup action (#305), and the backport
workflow (#273, #291). Tree is identical to develop at a4f52b2.
harshtandiya added a commit that referenced this pull request Jul 29, 2026
Brings main to parity with develop at a4f52b2: the buzz/api domain package
split (#295-#303), the shared bench setup action (#305), and the backport
workflow (#273, #291). Tree is identical to develop at a4f52b2.
Sign up for freeto 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.

1 participant

@harshtandiya