Repository navigation
ci: stop merge_group runs from writing caches under ephemeral queue refs - #33085
Conversation
Two steps still saved GitHub Actions caches from merge_group runs. The
queue's gh-readonly-queue/* ref dies when its entry merges or is
dequeued, so anything saved there is unreachable by every later run —
but it stays charged against the repo's 10 GB LRU budget until evicted,
and what it evicts is the main-scoped copies everyone else restores from.
Measured 2026-09-09:
* 18 GB active against the 10 GB budget at one point; ~40
buildkit-blob-* entries on a single queue ref (mode=max exports every
layer, 0-380 MB each).
* Steady-state ~2.35 GB of node-cache-Linux-x64-yarn-* on dead queue
refs from the playwright-summary job alone.
* Main's scope held ZERO golden-fixture / distribution / ingestion-image
entries — all evicted despite populate-playwright-caches.yml saving
them on every push to main.
* Downstream: 231 of 235 merge_group Playwright runs in 24h missed the
golden fixture and rebuilt it (~17 min each, on the critical path of
every shard). Fixture cache hit rate: 2% merge_group, 27% PR.
The two writers, both now gated off merge_group — reads stay
unconditional, and pull_request / workflow_dispatch (refs that outlive
the run) may still populate:
java-playwright-nightly.yml
docker/build-push-action `cache-to: type=gha,mode=max` on every
event. The spike vector: a queue ref that cold-builds the server
image dumps dozens of layer blobs into the budget in one go.
playwright-postgresql-e2e.yml (playwright-summary job)
actions/setup-node `cache: yarn`. setup-node's built-in cache saves
as a post-step under the current ref with no restore-only mode; this
is the only setup-node+cache writer on a merge_group trigger in the
repo. ~1.2 GB per merge_group run, every run. A cold
`yarn --ignore-scripts` on the summary job costs ~1 min; a missed
golden fixture costs ~17 min per shard.
Same rule playwright-e2e-reusable.yml already applies to every one of
its own actions/cache/save steps.
Swept every other merge_group workflow for cache writers. The remaining
~15 actions/cache@v6 steps (integration-tests-*, service-unit-tests,
yarn-coverage, java-playwright-nightly's maven caches) all key on
hashFiles(**/pom.xml) / hashFiles(**/yarn.lock): on an exact hit
actions/cache skips the save, and live inventory confirms zero maven
entries on queue refs. They write only after a lockfile bump (~14% of
commits) and the orphaned copy is bounded. Follow-up: convert them to
actions/cache/restore + a merge_group-guarded actions/cache/save, the
pattern playwright-knowledge-graph-postgresql-e2e.yml already uses.
Not changed here: the reusable's own saves on pull_request refs
(ingestion image ~2.5 GB, distribution ~1.1 GB, browser ~1 GB — ~4.6 GB
of the 6.7 GB PR-scoped footprint). Those give re-pushed PRs a 27%
fixture hit rate; whether that is worth the budget is a separate
decision.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ ApprovedPrevents OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
✅ Playwright Results — workflow succeededValidated commit ✅ 557 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 47m 32s ⏱️ Max setup 4m 36s · max shard execution 14m 32s · max shard-job elapsed before upload 18m 19s · reporting 4s 🌐 236.17 requests/attempt · 2.82 app boots/UI scenario · 9.17% common-shard skew Optimization targets still in progress:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
…per-test lanes before shard fan-out (open-metadata#33095) * ci: stop merge_group runs from saving the ingestion venv cache under queue refs Follow-up to open-metadata#33085, which gated the setup-node yarn cache and the buildkit layer cache off merge_group. It missed the largest ephemeral writer because my sweep only covered .github/workflows/*.yml with a direct merge_group trigger — not composite actions, and not reusables invoked by merge_group callers. The writer is the Python venv save in .github/actions/setup-openmetadata-test-environment/action.yml, used by py-tests-shared.yml (via py-tests.yml and py-tests-postgres.yml on merge_group). Its `if:` guarded the fork pull_request_target cache-poisoning case and nothing else — even though the same action, ~50 lines earlier, gates setup-uv's enable-cache off merge_group with a comment explaining the ephemeral-ref problem. One writer fixed, one missed, same file. Cost: ~1 GB per Python version per merge_group run (the py-tests matrix runs two), saved under a gh-readonly-queue/* ref that dies when the entry merges or is dequeued, charged against the 10 GB LRU budget until evicted. Measured 2026-09-10: * 03:44-03:49: four Linux-py3.1x-om-venv entries, 3.98 GB, on two dead queue refs. Total cache 11.46 GB against 10 GB. * 03:24: populate-playwright-caches.yml (02:54 push run) saved playwright-golden-fixture, playwright-distribution and playwright-ingestion-image under main. By ~03:50 distribution (0.37 GB) and ingestion-image (1.26 GB) were gone — LRU-evicted — while the 54 MB fixture survived only because a merge_group run had just restored it (last_accessed 03:49, 03:52). * Net effect on merge_group runs: fixture cache now hits, but `build` still runs mvn cold (~6.5 min) and the ingestion lanes still rebuild the image, because the main-scoped copies cannot survive 2 GB/run of ephemeral writes. Change: add `github.event_name != 'merge_group'` to the save's `if:`. The restore step above is untouched, so queue runs keep hitting main's venv; only the write is gated. Same rule playwright-e2e-reusable.yml applies to all of its own saves. Not changed: the 32 MB spacy-model actions/cache@ in py-tests-shared.yml (same class, 0.6% of budget — not worth the surface). Not changed: CodeQL's overlay-base-database entries (8 x ~470 MB = 3.74 GB on main in 45 min) — that is GitHub default-setup CodeQL, no workflow file to edit; it is the elephant in the budget but not ours to gate here. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ci(playwright): start the AutoPilot MySQL fixture; route failed-start logs through the stop script start_playwright_autopilot_mysql.sh and the stop script's cleanup were already on main but nothing started the container. Start it alongside the ingestion image, seed it from docker/development/playwright-autopilot-mysql.sql, and export PLAYWRIGHT_AUTOPILOT_MYSQL_* so AutoPilot.spec can use a per-shard source. A failed start now runs the stop script with PW_STARTUP_FAILED=true, which already saves and prints the server log tail, so the start script no longer dumps it a second time. From open-metadata#33088 (harshach/debug-merge-queue). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(playwright): make the helper-test lanes pass on main Both lanes already on main (helper-tests.config.ts, browser-helper-tests.config.ts) had rotted because nothing runs them in CI: 10 HTTP-helper and 2 serverLoad browser tests failed on a clean main. - fetchCompletedCsvAsyncJobResult polls /csvAsyncJobs/{jobId} and fails fast on FAILED/CANCELLED/unknown status or a mismatched job, instead of scanning a list (which is not what the endpoint returns). - setRemoteRunnerAsDefault, getGlossaryApprovalWorkflowSnapshot and deleteArticleByFqn throw on an HTTP error rather than silently continuing. - serverLoad boot cache: a read that started before a write is no longer cached after it (write generation), so a cached boot config cannot go stale. Keeps main's lost-token guard and "Route is already handled" tolerance; a disposed response is only ignored when its page is closed. From open-metadata#33088 (harshach/debug-merge-queue). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * ci(playwright): run the HTTP and browser helper lanes before shard fan-out Adds the plan-playwright steps from open-metadata#33088: HTTP helper tests and the browser-helper lane (compiled core components, real Chromium), each in a network-less, read-only container. A broken shared helper now fails planning in about a minute instead of surfacing as scattered e2e timeouts. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(ci): point the impact map at the moved Auth login specs open-metadata#34056 moved Pages/Login.spec.ts and Pages/LoginConfiguration.spec.ts to e2e/Auth/, but impact-map.json still listed the old paths. Login.spec.ts is in the smoke list every targeted PR run selects, so shard planning failed with "Playwright selectors reference specs that do not exist" on every such PR. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Auto-revert Test <test-auto-revert@example.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…in (open-metadata#34237) Measured 2026-09-29 15:44Z: the 10 GB Actions cache budget held 13.3 GB, of which 11.6 GB (87%) sat under refs/pull/* and only 2.2 GB under main. Main had no Playwright fixture entries at all; the warmer's copies from 13:16 had been LRU-evicted by the PR-ref flood within ~2.5 h. A PR-ref copy is visible only to that PR's own re-runs, so every one of those entries cost the shared budget while serving almost nobody. Four changes, one PR: - playwright-postgresql-e2e.yml: the summary job used setup-node's built-in `cache: yarn`, whose node-cache-* key nothing on main ever writes. Every PR missed and saved its own 1.4 GB copy (3 x 1.4 GB, 43% of the budget, from three PRs in one afternoon). Replace with actions/cache/restore against the warmer's main-scoped yarn-pkg-cache-* key. Restore-only; the follow-up my own open-metadata#33085 comment named. - playwright-e2e-reusable.yml: gate the distribution, golden-fixture and ingestion-image saves off pull_request as well as merge_group. Only populate-playwright-caches.yml writes them now. - setup-openmetadata-test-environment/action.yml: same gate on the venv save. Restore stays unconditional. - populate-playwright-caches.yml: new warm-venv job (py 3.10/3.11/3.12) calling the composite exactly as py-tests-shared does. Until now no push-triggered workflow ran the composite without fast-mode, so main never held a venv and merge_group always built it cold. actionlint: no new findings (the 11 reported pre-exist on main).
Summary
Two workflow steps still saved GitHub Actions caches from
merge_groupruns. The queue'sgh-readonly-queue/*ref dies the moment its entry merges or is dequeued — anything saved there is unreachable by every later run — but it stays charged against the repo's 10 GB LRU budget until evicted, and what it evicts is the main-scoped copies everyone else restores from.This PR gates both writers off
merge_group. Reads stay unconditional;pull_requestandworkflow_dispatch(refs that outlive the run) may still populate. It's the same ruleplaywright-e2e-reusable.ymlalready applies to every one of its ownactions/cache/savesteps.What we measured (2026-09-09, 24h window)
node-cache-*-yarnon dead queue refs (steady)populate-playwright-caches.ymlsaving them on every push to mainThat fixture miss is the single largest fixed cost in the pipeline —
prepare-playwright-fixturep50 is 16.9 min of a 56 min merge_group run.The two writers
java-playwright-nightly.yml—docker/build-push-actioncache-to: type=gha,mode=maxmode=maxexports every layer. A queue ref that cold-builds the server image dumps dozens ofbuildkit-blob-*entries into the budget in one go — this is the spike vector behind the 18 GB reading.cache-fromis unchanged, so queue runs still benefit from a PR- or dispatch-primed scope.playwright-postgresql-e2e.yml—playwright-summaryjob,actions/setup-nodecache: yarnsetup-node's built-in cache saves as a post-step under the current ref and has no restore-only mode. This is the onlysetup-node+cachewriter on amerge_grouptrigger in the repo. ~1.2 GB per merge_group run, every run. Tradeoff: a coldyarn --ignore-scripts --frozen-lockfileon the summary job costs ~1 min; a missed golden fixture costs ~17 min per shard.What the sweep found and deliberately left alone
I checked every
merge_group-triggered workflow for cache writers. The remaining ~15actions/cache@v6steps (integration-tests-*,openmetadata-service-unit-tests,yarn-coverage, and the maven caches injava-playwright-nightly) all key onhashFiles('**/pom.xml')/hashFiles('**/yarn.lock'). On an exact-key hitactions/cacheskips the save; live inventory shows zero maven entries on queue refs right now. They write only after a lockfile bump (~14% of commits) and the orphaned copy is bounded.Follow-up (separate PR): convert those to
actions/cache/restore+ amerge_group-guardedactions/cache/save—playwright-knowledge-graph-postgresql-e2e.yml:260already models the pattern.Also not changed: the reusable's own saves on
pull_requestrefs — ingestion image ~2.5 GB, distribution ~1.1 GB, browser ~1 GB, roughly 4.6 GB of the 6.7 GB PR-scoped footprint. Those are what give a re-pushed PR its 27% fixture hit rate. Whether that hit rate is worth the budget pressure is a real tradeoff and deserves its own decision, not a side effect of this PR.What "fixed" looks like
After this lands and
populate-playwright-caches.ymlruns once on the next push to main,gh api repos/open-metadata/OpenMetadata/actions/caches?ref=refs/heads/mainshould showplaywright-golden-fixture-v2-*,playwright-distribution-v2-*, andplaywright-ingestion-image-v2-*entries and keep showing them across subsequent merge_group runs.restore-playwright-fixtureon merge_group should flip fromCache not foundtoCache restored. Combined with #33061 (tighter fixture fingerprint), the expected steady-state merge_group fixture hit rate is ~85%.Test plan
${{ }}expressions evaluate to the intended strings (verified by loading and printing thewith:values)actions/cache@,cache/save@,setup-node/setup-python/setup-java/setup-uvcache options — classified every keypopulate-playwright-caches.ymlpush run saves fixture/distribution/ingestion underrefs/heads/mainrestore-playwright-fixturereportsCache restoredfor the ones whose queued PRs don't touchFIXTURE_PREFIXESgh api .../actions/cache/usagestays under 10 GB across a full day🤖 Generated with Claude Code