fix: align Docker image Playwright browsers with bundled version#3032
Conversation
The runner image installed Chromium with a hand-maintained, hardcoded PLAYWRIGHT_VER that drifted from the playwright version bundled with the likec4 package. likec4's bundled playwright launches a specific Chromium revision, so when the two disagreed `export png`/`jpg` failed with "Executable doesn't exist at .../chromium_headless_shell-<rev>/...". - docker.yaml now derives the exact playwright version from pnpm-lock.yaml and passes it as the PLAYWRIGHT_VER build arg. - Pin the playwright catalog entry to an exact version so the published likec4 package depends on exactly that version (no install-time drift). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 577d257 The changes in this PR will be included in the next version bump. This PR includes changesets to release 22 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR upgrades Playwright from 1.58.2 to 1.60.0 across the workspace, e2e tests, and Docker configuration. A release changeset documents the fix for PNG/JPG export failures in the Docker image. The CI workflow is enhanced to dynamically extract the Playwright version from the lock file and pass it to Docker builds, ensuring consistent versioning. ChangesPlaywright Version Upgrade and Docker Integration
Sequence Diagram(s)sequenceDiagram
participant Workflow as GitHub Workflow
participant LockFile as pnpm-lock.yaml
participant DockerBuild as Docker Build
Workflow->>LockFile: Extract playwright@version
LockFile-->>Workflow: 1.60.0
Workflow->>Workflow: Set PLAYWRIGHT_VER env
Workflow->>DockerBuild: Pass PLAYWRIGHT_VER build arg
DockerBuild-->>DockerBuild: Use version or default
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/docker.yaml:
- Around line 35-39: The script logs LIKEC4_VER before it's evaluated and
doesn't validate PLAYWRIGHT_VER; change the sequence to first compute LIKEC4_VER
and PLAYWRIGHT_VER, write them to GITHUB_ENV, then echo their resolved values
(so remove the premature echo of LIKEC4_VER), and add validation checks that
fail-fast: after computing LIKEC4_VER (via jq -r .version package.json) and
PLAYWRIGHT_VER (via the grep/cut pipeline) test that each is non-empty and if
empty print a clear error with the actual parsed value(s) and exit non-zero;
update the block around the LIKEC4_VER and PLAYWRIGHT_VER commands so the
assignment, validation, export to GITHUB_ENV, and resolved-value logs occur in
that order.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b0a26bd8-1e43-4551-a80f-e0660070ada8
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (5)
.changeset/fix-png-export-with-docker.md.github/workflows/docker.yamlDockerfilee2e/package.jsonpnpm-workspace.yaml
Compute LIKEC4_VER/PLAYWRIGHT_VER into shell vars first, validate they are non-empty, then export and log the actual resolved values. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fixes #2961
Problem
likec4 export png(andjpg) fail inside the published Docker image:The
likec4package bundlesplaywrightas a runtime dependency, and that bundled version dictates which Chromium revision it launches (viaimport('playwright')→chromium.executablePath()). The Dockerfile, however, installed the browser binaries with a hand-maintained, hardcodedPLAYWRIGHT_VER. When the two drifted apart (it sat at1.53.1, while released images needed revs1217/1223), the browser revision likec4 looked for was never downloaded. Reporter currently works around it by symlinking the expected revision dir.Fix
.github/workflows/docker.yaml— derive the exact Playwright version frompnpm-lock.yamland pass it as thePLAYWRIGHT_VERbuild arg, so the installed browser always matches likec4's bundled Playwright.pnpm-workspace.yaml— pin theplaywrightcatalog entry to an exact version (1.60.0) instead of^1.58.2, so the publishedlikec4package depends on exactly that version with no install-time drift.e2eand the lockfile are updated accordingly.Dockerfile— keepARG PLAYWRIGHT_VERas a default for local builds, with a comment noting the CI workflow overrides it.Verification
grep -oE 'playwright@[0-9]+\.[0-9]+\.[0-9]+' pnpm-lock.yaml | head -1 | cut -d@ -f2docker.yamlvalidated as well-formed YAML.dockerworkflow (workflow_dispatch), check the build log lineResolved PLAYWRIGHT_VER=…, then runlikec4 export pngagainst the resulting image.🤖 Generated with Claude Code