Skip to content

Fix blueprint creation from read-only directories and remove redundant native-php e2e jobs - #3889

Merged
bcotrim merged 7 commits into
trunkfrom
fix-blueprint-e2e-readonly-dir
Jun 18, 2026
Merged

Fix blueprint creation from read-only directories and remove redundant native-php e2e jobs#3889
bcotrim merged 7 commits into
trunkfrom
fix-blueprint-e2e-readonly-dir

Conversation

@bcotrim

@bcotrim bcotrim commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

Diagnosed and implemented with Claude Code. From the failing CI log, Claude traced an EACCES raised while applying a blueprint to the native runtime writing a temporary sidecar file next to the uploaded blueprint, and to Linux CI's user-remapped Docker checkout being read-only. I directed the approach — fix it in the runtime (mirroring the temp-dir pattern blueprint bundles already use) rather than working around it in the test, and separately drop the now-redundant native-php e2e jobs. Claude made the edits and verified them (eslint, YAML validity); the fix is exercised by the existing blueprint e2e suite, which fails on Linux without it. I reviewed the diff.

Proposed Changes

Since native PHP became the default runtime (#3786), creating a site from a blueprint runs the native path, which writes a temporary sidecar file next to the blueprint as it applies it. If that blueprint lives in a read-only directory — a locked-down or mounted location for a real user, or the user-remapped Docker checkout on Linux CI — the write fails with EACCES and site creation aborts.

The native runtime now falls back to a private temp directory when the blueprint's own directory isn't writable (and keeps co-locating when it is, so a bundle's sibling resources still resolve). Creating a site from a blueprint now works regardless of where the blueprint file lives; there's no other user-visible behavior change.

Separately, this removes the two "… with native PHP" e2e jobs and their STUDIO_RUNTIME env. That variable's consumer was deleted when the beta runtime toggle was removed, so the jobs were redundant no-ops — the regular e2e jobs already exercise native PHP now that it's the default.

Testing Instructions

  • e2e (Linux is the meaningful platform): the blueprint suite (apps/studio/e2e/blueprints.test.ts) creates sites from fixtures in the read-only checkout; it previously failed with EACCES … studio-blueprint-<id>.json and now passes. The test itself is unchanged — the fix is in the runtime.
  • Manual: create a site from a .json blueprint placed in a read-only directory — it should succeed instead of erroring.
  • Pipeline: the E2E group shows only the regular jobs (no "… with native PHP" variants); grep STUDIO_RUNTIME .buildkite/pipeline.yml returns nothing.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

🤖 Generated with Claude Code

@bcotrim
bcotrim requested a review from a team as a code owner June 18, 2026 15:05
@bcotrim bcotrim changed the title Fix blueprint e2e on Linux and remove redundant native-php e2e jobs Jun 18, 2026
@wpmobilebot

wpmobilebot commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 2ce7b63 vs trunk

app-size

Metric trunk 2ce7b63 Diff Change
App Size (Mac) 2357.83 MB 2357.83 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk 2ce7b63 Diff Change
load 1089 ms 1073 ms 16 ms ⚪ 0.0%

site-startup

Metric trunk 2ce7b63 Diff Change
siteCreation 6476 ms 6512 ms +36 ms ⚪ 0.0%
siteStartup 6976 ms 7517 ms +541 ms 🔴 7.8%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

Copilot AI 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.

Pull request overview

This PR fixes native-PHP blueprint application failing when the blueprint file lives in a read-only directory (e.g., Linux CI Docker checkouts) by falling back to a private temp directory when it can’t write a sidecar JSON next to the original blueprint. It also removes redundant Buildkite E2E jobs that previously forced a “native PHP” runtime via an env var that is no longer used.

Changes:

  • Add a write-to-blueprint-dir fallback to a temp directory for native-PHP blueprint execution.
  • Clean up the fallback temp directory after blueprint execution.
  • Remove redundant “E2E … with native PHP” Buildkite jobs and the unused STUDIO_RUNTIME env usage.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
apps/cli/lib/native-php/blueprints.ts Falls back to a temp directory when the blueprint’s directory isn’t writable, then cleans up generated files/dirs.
.buildkite/pipeline.yml Removes redundant native-PHP E2E jobs now that native PHP is the default runtime.
Comments suppressed due to low confidence (1)

.buildkite/pipeline.yml:100

  • The Linux E2E comment block appears twice, and the first copy is less-indented than the surrounding steps: list. YAML parsers ignore comment indentation, but this is still confusing to read/maintain.

Remove the duplicate (less-indented) copy and keep the correctly-indented one above the linux step.

  # Linux E2E tests run on the shared `default` queue inside a Debian Node
  # container — the same pattern the Linux build/unit-test steps use. Kept as
  # a separate step (rather than another matrix entry on *e2e_config) because
  # Mac and Windows share queue/plugin defaults that Linux doesn't.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/cli/lib/native-php/blueprints.ts Outdated
Comment on lines +60 to +62
fallbackTempDir = await createBlueprintTempDir();
tmpPath = path.join( fallbackTempDir, blueprintFilename );
await fs.promises.writeFile( tmpPath, serializedBlueprint );
@bcotrim
bcotrim requested a review from a team June 18, 2026 17:19
@bcotrim
bcotrim merged commit 497728f into trunk Jun 18, 2026
11 checks passed
@bcotrim
bcotrim deleted the fix-blueprint-e2e-readonly-dir branch June 18, 2026 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants