Skip to content

refactor(claude-code): bake patch-playwright-mcp into the image (#87) - #88

Merged
gatezh merged 1 commit into
masterfrom
playwright-mcp-in-image
Apr 29, 2026
Merged

gatezh merged 1 commit into
masterfrom
playwright-mcp-in-image

Conversation

@gatezh

@gatezh gatezh commented Apr 29, 2026

Copy link
Copy Markdown
Owner

What

Move the Playwright MCP patch script from a per-project file into the image at /usr/local/bin/patch-playwright-mcp.

Why

#85 made Playwright MCP usable in both image variants but left patch-playwright-mcp.sh as a verbatim copy in every consumer's .devcontainer/. The script has zero project-specific config, so every upstream change had to be manually mirrored. Baking it into the image (same pattern as rtk and ralphex) closes that drift surface and lets the patch flow through the daily-rebuild + pull_policy: always channel.

Boundary rule going forward: project-specific config stays per-project; universal logic moves into the image.

Closes #87.

Changes

  • Dockerfile — COPY --chmod=0755 patch-playwright-mcp.sh /usr/local/bin/patch-playwright-mcp in the base stage so both default and sandbox targets inherit it (single layer, BuildKit-canonical)
  • init-plugins.sh + both devcontainer.json templates — invoke /usr/local/bin/patch-playwright-mcp directly
  • README — drops the script from setup guidance, file-tree, and Playwright Strategy section; adds the boundary-rule note explaining why init-plugins.sh stays per-project but the patch binary doesn't
  • CI verify — test -x /usr/local/bin/patch-playwright-mcp added to all four matrix entries (default + sandbox × amd64 + arm64)

Notes

Consumer migration (one-time, after pulling the new image):

  • delete .devcontainer/patch-playwright-mcp.sh
  • in .devcontainer/init-plugins.sh: replace bash "$(dirname "$0")/patch-playwright-mcp.sh" with /usr/local/bin/patch-playwright-mcp
  • in every devcontainer.json postStartCommand: replace bash .devcontainer/patch-playwright-mcp.sh with /usr/local/bin/patch-playwright-mcp (projects with both default and sandbox variants need both updated)

Pre-merge verification:

  • hadolint clean on the modified Dockerfile
  • docker build --check clean
  • real docker buildx build against the CI build context root (claude-code/.devcontainer) confirmed the COPY source path resolves — the path bug from the original issue's diff (COPY .devcontainer/patch-playwright-mcp.sh …) is fixed here to just COPY patch-playwright-mcp.sh …

COPY --link deliberately not adopted — empirical BuildKit cache-GC and parallel-graph-merge overhead per Depot's 2024–2026 reporting; existing repo doesn't use --link anywhere; would warrant a repo-wide decision rather than a one-off here.

- COPY --chmod=0755 patch-playwright-mcp.sh into /usr/local/bin/ in the
  base stage so both default and sandbox targets inherit it
- switch init-plugins.sh and both devcontainer.json templates to invoke
  /usr/local/bin/patch-playwright-mcp directly
- drop the per-project script from README setup guidance and add the
  boundary rule: project-specific config stays per-project, universal
  logic moves into the image
- add test -x check for the binary to all four CI verify matrix entries
@gatezh
gatezh merged commit 0787ba2 into master Apr 29, 2026
8 checks passed
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.

Bake patch-playwright-mcp.sh into the image so consumer projects don't carry a copy

1 participant