Skip to content

CI: key the Playwright browser caches on the OS release, and move the WebKit jobs back to ubuntu-latest - #17009

Merged
danielhanchen merged 2 commits into
mainfrom
ci/playwright-cache-os
Nov 7, 2026
Merged

danielhanchen merged 2 commits into
mainfrom
ci/playwright-cache-os

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

#16987 moved the WebKit jobs to ubuntu-24.04 because WebKit would not launch on the ubuntu-26.04 image. The image was not the cause. The cause was the Playwright browser cache restoring a WebKit build made for a different Ubuntu release.

Playwright downloads a separate WebKit build for each Ubuntu release (webkit-ubuntu-24.04.zip, webkit-ubuntu-26.04.zip), and both unpack into the same webkit-<rev> folder. The cache key, ms-playwright-Linux-<playwright version>-cfw-v2, does not name the release. So a cache saved on one release is a hit on the other, playwright install skips the download, and WebKit exits at launch. install-deps cannot fix that.

The evidence:

run image cache restored WebKit
main, run 42338613438 (before #16987) ubuntu-26.04 ms-playwright-Linux-1.64.1-cfw-v2, saved 2026-10-22 on 24.04 TargetClosedError, also after install-deps
a repo whose first cache save was on 26.04, saving run ubuntu-26.04 none, downloaded webkit-ubuntu-26.04.zip launches, Chat UI and indicator jobs pass
the same repo today, after #16987 ubuntu-24.04 that 26.04 cache TargetClosedError, also after install-deps

So the 24.04 pin only works where the cache happened to be saved on 24.04, and it breaks wherever the cache was saved on 26.04. The apt archive cache has a related bug. Its key uses ${{ env.ImageOS }}-${{ env.ImageVersion }}, but those are runner shell variables and not part of the env expression context, so the key expands to apt-archives-Linux---cfw-v1 and never names the image either.

Change

  • Every id: pw step that feeds a Playwright cache key now also writes os=<ID>-<VERSION_ID> from /etc/os-release (for example ubuntu-26.04). This covers studio-ui-smoke.yml (Chat UI Tests and Loaded-models indicator), studio-frontend-ci.yml, studiobench-ci.yml and studiobench-ui-parity.yml.
  • Every ms-playwright-* key includes ${{ steps.pw.outputs.os }}, and the apt archive keys use it in place of the empty env.ImageOS / env.ImageVersion. The frontend build and the chromium-only UI shards still share one key, as before. The first main run on each release misses once and saves a cache built for that release. A PR run that misses downloads the matching build.
  • Revert the CI: run the Playwright WebKit jobs on ubuntu-24.04 while ubuntu-latest is 26.04 #16987 pins. ui-smoke and ui-indicator go back to ubuntu-latest, and so do the ubuntu-latest legs of studio-composer-compatibility.yml and studio-inline-images.yml. The last two never cached browsers, so they always downloaded the right build. Check names are unchanged.
  • Replace tests/studio/test_webkit_jobs_skip_ubuntu_latest.py, which encoded the wrong cause, with tests/studio/test_playwright_cache_keys_name_the_os.py. For every actions/cache step over ms-playwright or .apt-archives, the new test requires the key to name steps.<id>.outputs.os, written from /etc/os-release by an earlier step in the same job. A save that reuses cache-primary-key is followed back to its restore step. It refuses env.ImageOS / env.ImageVersion in a key and checks that it still finds the five browser-cache jobs. It is registered in workflow-trigger-lint.yml in place of the old guard.

Testing

test_playwright_cache_keys_name_the_os.py
this branch 20 passed
main's workflows with this test 15 failed (every browser and apt cache step in the five jobs), 5 passed

The whole workflow-trigger-lint.yml pytest list passes, except for two tests that fail the same way on main in this environment (test_cached_paths_hold_no_credentials.py::test_model_cache_variables_are_not_treated_as_credential_homes, test_version_compat_bundle.py::test_the_daily_sweep_skips_what_it_cannot_import). Neither touches these files. This PR's own Chat UI Tests and Loaded-models indicator runs are the end-to-end check. They run on ubuntu-latest (26.04), miss the new key, and download the 26.04 WebKit build.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T12:01:58.439339Z 0ac5a68 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 078a62d511

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 0ac5a6891f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

1 participant