Skip to content

[Client] Use wordpressInstallMode for Playground boot#3599

Merged
adamziel merged 2 commits into
trunkfrom
fix/use-wordpress-install-mode
May 18, 2026
Merged

[Client] Use wordpressInstallMode for Playground boot#3599
adamziel merged 2 commits into
trunkfrom
fix/use-wordpress-install-mode

Conversation

@ashfame
Copy link
Copy Markdown
Member

@ashfame ashfame commented May 5, 2026

What it does

Uses wordpressInstallMode as the single boot control for WordPress installation and PHP-only Playground sessions.

Breaking change: shouldBootWordPress is removed from the client and worker boot options. Use wordpressInstallMode: 'do-not-attempt-installing' to skip WordPress boot setup.

Rationale

shouldInstallWordPress and shouldBootWordPress split one decision across two booleans and make PHP-only boot paths harder to reason about. wordpressInstallMode already names the behavior directly:

  • download-and-install for fresh WordPress installs
  • install-from-existing-files-if-needed for saved or mounted WordPress files
  • do-not-attempt-installing for PHP-only sessions

Implementation

The Blueprints v1 client resolves a concrete wordpressInstallMode before booting the remote worker. Inline Blueprints with preferredVersions.wp: false resolve to do-not-attempt-installing unless the caller explicitly requested WordPress, in which case the handler throws a conflict error.

Website and Personal WP boot clients now pass wordpressInstallMode directly. The remote worker uses that mode to decide whether to download WordPress, run WordPress setup, or stop after mounting a PHP-only runtime.

shouldInstallWordPress remains accepted for compatibility, but is deprecated and translated into wordpressInstallMode.

Testing instructions

npm exec nx -- test playground-client --testFile=blueprints-v1-handler.spec.ts
npm exec nx -- test playground-remote --testFile=playground-worker-endpoint-blueprints-v1.spec.ts
npm exec nx -- run-many -t typecheck --projects=playground-client,playground-remote,playground-website,playground-personal-wp

@adamziel
Copy link
Copy Markdown
Collaborator

adamziel commented May 5, 2026

Thank you! We should also completely remove any trace of shouldBootWordPress and just rely on wordpressInstallMode: "do-not-attempt-installing".

if (
(shouldInstallWordPress === true || shouldBootWordPress === true) &&
declarativeOptOut
wordpressWasRequestedExplicitly({
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need a helper method, this could be just a const

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tend agree but more for the reason that the helper method has the same complex boolean expression that could have been inserted here. What about we keep the helper method but change the boolean expression to simple ones with return statements.?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's see what that expression looks like once there's no more shouldBootWordPress – I feel like it complicates the data flow.

Copy link
Copy Markdown
Collaborator

@adamziel adamziel May 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems not great and not terrible now. I'll go ahead and merge. We can keep iterating in a follow-up but I want to get rid of shouldBootWordPress before people start to use it.

@akirk
Copy link
Copy Markdown
Member

akirk commented May 6, 2026

From my perspective we can make this ready for review.

@adamziel
Copy link
Copy Markdown
Collaborator

adamziel commented May 7, 2026

@akirk we're already reviewing it anyway :-)

@adamziel
Copy link
Copy Markdown
Collaborator

adamziel commented May 9, 2026

@ashfame poke

@adamziel adamziel force-pushed the fix/use-wordpress-install-mode branch from 87b310e to a658572 Compare May 18, 2026 22:54
@adamziel adamziel force-pushed the fix/use-wordpress-install-mode branch from a658572 to ea1b0f0 Compare May 18, 2026 23:16
@adamziel adamziel marked this pull request as ready for review May 18, 2026 23:41
@adamziel adamziel requested review from a team, bgrgicak and Copilot and removed request for Copilot May 18, 2026 23:41
@adamziel adamziel changed the title Use wordpressInstallMode for Playground boot [Client] Use wordpressInstallMode for Playground boot May 18, 2026
@adamziel adamziel merged commit 8ffc6cc into trunk May 18, 2026
55 checks passed
@adamziel adamziel deleted the fix/use-wordpress-install-mode branch May 18, 2026 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants