Fix blueprint creation from read-only directories and remove redundant native-php e2e jobs - #3889
Conversation
📊 Performance Test ResultsComparing 2ce7b63 vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
There was a problem hiding this comment.
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_RUNTIMEenv 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.
| fallbackTempDir = await createBlueprintTempDir(); | ||
| tmpPath = path.join( fallbackTempDir, blueprintFilename ); | ||
| await fs.promises.writeFile( tmpPath, serializedBlueprint ); |
Related issues
How AI was used in this PR
Diagnosed and implemented with Claude Code. From the failing CI log, Claude traced an
EACCESraised 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
EACCESand 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_RUNTIMEenv. 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
apps/studio/e2e/blueprints.test.ts) creates sites from fixtures in the read-only checkout; it previously failed withEACCES … studio-blueprint-<id>.jsonand now passes. The test itself is unchanged — the fix is in the runtime..jsonblueprint placed in a read-only directory — it should succeed instead of erroring.grep STUDIO_RUNTIME .buildkite/pipeline.ymlreturns nothing.Pre-merge Checklist
🤖 Generated with Claude Code