Skip to content

fix: align Docker image Playwright browsers with bundled version#3032

Merged
davydkov merged 3 commits into
mainfrom
fix-png-export-with-docker
Jun 5, 2026
Merged

fix: align Docker image Playwright browsers with bundled version#3032
davydkov merged 3 commits into
mainfrom
fix-png-export-with-docker

Conversation

@davydkov

@davydkov davydkov commented Jun 4, 2026

Copy link
Copy Markdown
Member

Fixes #2961

Problem

likec4 export png (and jpg) fail inside the published Docker image:

browserType.launch: Executable doesn't exist at
/root/.cache/ms-playwright/chromium_headless_shell-1217/chrome-headless-shell-linux64/chrome-headless-shell

The likec4 package bundles playwright as a runtime dependency, and that bundled version dictates which Chromium revision it launches (via import('playwright')chromium.executablePath()). The Dockerfile, however, installed the browser binaries with a hand-maintained, hardcoded PLAYWRIGHT_VER. When the two drifted apart (it sat at 1.53.1, while released images needed revs 1217 / 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 from pnpm-lock.yaml and pass it as the PLAYWRIGHT_VER build arg, so the installed browser always matches likec4's bundled Playwright.
  • pnpm-workspace.yaml — pin the playwright catalog entry to an exact version (1.60.0) instead of ^1.58.2, so the published likec4 package depends on exactly that version with no install-time drift. e2e and the lockfile are updated accordingly.
  • Dockerfile — keep ARG PLAYWRIGHT_VER as a default for local builds, with a comment noting the CI workflow overrides it.

Verification

  • Workflow extraction returns the expected version: grep -oE 'playwright@[0-9]+\.[0-9]+\.[0-9]+' pnpm-lock.yaml | head -1 | cut -d@ -f2
  • docker.yaml validated as well-formed YAML.
  • Full end-to-end confirmation: trigger the docker workflow (workflow_dispatch), check the build log line Resolved PLAYWRIGHT_VER=…, then run likec4 export png against the resulting image.

🤖 Generated with Claude Code

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-bot

changeset-bot Bot commented Jun 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 577d257

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 22 packages
Name Type
likec4 Patch
@likec4/docs-astro Patch
likec4-vscode Patch
@likec4/playground Patch
@likec4/style-preset Patch
@likec4/styles Patch
@likec4/config Patch
@likec4/core Patch
@likec4/diagram Patch
@likec4/generators Patch
@likec4/language-server Patch
@likec4/language-services Patch
@likec4/layouts Patch
@likec4/leanix-bridge Patch
@likec4/spa Patch
@likec4/log Patch
@likec4/lsp Patch
@likec4/mcp Patch
@likec4/react Patch
@likec4/tsconfig Patch
@likec4/vite-plugin Patch
@likec4/vscode-preview Patch

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>
@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 910b4145-09f2-4887-91ab-399b5dbfcbbc

📥 Commits

Reviewing files that changed from the base of the PR and between f763b24 and 577d257.

📒 Files selected for processing (1)
  • .github/workflows/docker.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/docker.yaml

📝 Walkthrough

Walkthrough

This 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.

Changes

Playwright Version Upgrade and Docker Integration

Layer / File(s) Summary
Release note documentation
.changeset/fix-png-export-with-docker.md
Adds a changeset entry documenting the patch-level fix for PNG/JPG export failures in the Docker image due to Playwright and Chromium browser version synchronization.
Workspace dependency catalog
pnpm-workspace.yaml
The pnpm workspace catalog entry is updated to reference Playwright 1.60.0.
Package and Docker defaults
e2e/package.json, Dockerfile
e2e/package.json updates @playwright/test from ^1.58.2 to ^1.60.0. The Dockerfile runner stage default PLAYWRIGHT_VER is changed to 1.60.0 with comments noting workflow override and workspace sync.
Docker CI workflow synchronization
.github/workflows/docker.yaml
Workflow trigger quoting adjusted; the "Read version" step validates and exports LIKEC4_VER, parses and validates PLAYWRIGHT_VER from pnpm-lock.yaml, exports/logs it, and passes PLAYWRIGHT_VER as a Docker build-arg.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR fully addresses #2961 (Docker export failures due to Playwright version mismatch) through version pinning and CI automation, but #39 (Next.js bump) is unrelated to these changes. Remove #39 from the linked issues or confirm if it should be addressed in this PR; currently only #2961 requirements are met.
Out of Scope Changes check ⚠️ Warning The PR introduces an unrelated linked issue (#39 Next.js dependency bump) that is not addressed by any code changes, making it an out-of-scope objective. Either implement the Next.js bump to 13.3.4 or remove #39 from the linked issues to keep the scope focused on the Docker/Playwright alignment fix.
Description check ❓ Inconclusive The PR description comprehensively covers the problem, fix, and verification steps, but does not follow the repository's required checklist template with checkboxes. Follow the description template by including the checklist with checkbox items (rebased, tests added, typecheck/test verified, changesets added, etc.) to confirm compliance with contribution guidelines.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: aligning Docker image Playwright browsers with the bundled version to fix export failures.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-png-export-with-docker

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot 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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 55dc799 and f763b24.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (5)
  • .changeset/fix-png-export-with-docker.md
  • .github/workflows/docker.yaml
  • Dockerfile
  • e2e/package.json
  • pnpm-workspace.yaml

Comment thread .github/workflows/docker.yaml Outdated
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>
@davydkov davydkov merged commit 5cd3a43 into main Jun 5, 2026
18 checks passed
@davydkov davydkov deleted the fix-png-export-with-docker branch June 5, 2026 07:11
@likec4-ci likec4-ci Bot mentioned this pull request Jun 5, 2026
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.

png export with docker container fails

1 participant