Fix phpMyAdmin after opening Adminer - #4144
Conversation
|
|
||
| const path = (filename: string) => new URL(filename, import.meta.url).pathname; | ||
| const path = (filename: string) => | ||
| fileURLToPath(new URL(filename, import.meta.url)); |
There was a problem hiding this comment.
This fix was necessary to enable testing from a worktree with a space in its path.
brandonpayton
left a comment
There was a problem hiding this comment.
I'm leaving some comments for Codex.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes a regression where phpMyAdmin can fail to open after Adminer on the same Playground site by ensuring runtime-installed tool files are shared across overlapping PHP processes, and adds an E2E regression test for the exact user flow.
Changes:
- Share
/toolsbetween PHP instances so secondary processes can see runtime-installed phpMyAdmin files. - Use
config.inc.phpas the phpMyAdmin “installed” marker instead of just checking for the directory. - Add a Playwright regression test covering “Open Adminer” then “Open phpMyAdmin”, and fix dev asset path resolution for worktrees containing spaces.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/playground/website/src/components/site-manager/site-database-panel/phpmyadmin-button.tsx | Detect installation via config.inc.php marker. |
| packages/playground/website/playwright/e2e/website-ui.spec.ts | Adds regression E2E test for Adminer → phpMyAdmin flow. |
| packages/playground/tools/src/phpmyadmin/index.ts | Centralizes phpMyAdmin config path constant and uses it during install. |
| packages/playground/remote/vite.config.ts | Fixes dev path resolution for spaces using fileURLToPath(). |
| packages/playground/remote/src/lib/playground-worker-endpoint.ts | Shares /tools boundary across PHP instances. |
| packages/playground/personal-wp/src/components/site-manager/site-database-panel/phpmyadmin-button.tsx | Mirrors install detection via config.inc.php marker. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This reads fine and tests well. Let's merge. I did notice there is a problem opening phpMyAdmin within Personal WP, but that also exists on trunk. An agent is looking into that issue now. |
What problem does this fix?
The Database panel offers both Adminer and phpMyAdmin. phpMyAdmin opens when it is
used first, but it can fail after Adminer has opened on the same Playground site.
Playground can use a second PHP process when requests overlap. Each process starts
with its own in-memory filesystem, and Playground explicitly shares a few important
directories between them.
Adminer is installed inside the WordPress document root, which was already shared.
phpMyAdmin is installed under
/tools/phpmyadmin, outside that root, and exposed bythe
/phpmyadminURL alias. A phpMyAdmin request handled by the second PHP processtherefore could not see the installed files.
How does the fix work?
/toolsis Playground's filesystem boundary for tools installed at runtime. Thischange adds that boundary to the standard directories shared with every secondary
PHP process, alongside
/tmp, the WordPress document root, and Playground'sinternal shared directories.
This is intentionally based on filesystem ownership rather than URL aliases. URL
aliases can point anywhere, so their parent depth cannot be inferred safely. An
earlier version mounted the exact
/tools/phpmyadminalias target. The full CIsuite showed that a nested mount interfered with recycled secondary web runtimes,
causing unrelated repeated
proc_open()and shutdown-prefetch tests to hang. Usingthe existing
/toolsboundary removes that nested mount and gives all runtime toolsthe same consistent sharing rule.
The phpMyAdmin buttons also use the generated
config.inc.phpas the installationmarker. This prevents a partially created directory from being mistaken for a
complete installation.
Regression coverage
The browser test opens Adminer through the Database panel first, then opens
phpMyAdmin on the same site and confirms both tools can read the WordPress tables.
Its inline comment links back to this PR and explains why that order matters.
The previous static helper test was removed. It only repeated a configuration value
and could not catch the runtime failure; the browser sequence protects the actual
user-visible contract.
Development asset follow-up
While reproducing this in a worktree whose path contains a space, WordPress loaded
without CSS or JavaScript. This was a separate remote Vite configuration problem:
using
URL.pathnameleft spaces encoded as%20, so Vite looked in a directorythat did not exist. The config now uses Node's
fileURLToPath()to produce a validnative filesystem path.
This only changes development asset resolution. Production asset URLs are
unchanged.
Validation
playground-remoteunit tests: 38 passed.playground-remotelint and typecheck: passed.playground-remoteproduction build: passed.repeated
proc_open(php)and shutdown loopback prefetch.WebKit in the previous CI run.
Manual test steps
npm run dev.wp_poststable is visible.wp_posts.There are no intentional breaking API changes.