Avoid redundant WordPress bootstraps during Playground install/start#3693
Draft
adamziel wants to merge 1 commit into
Draft
Avoid redundant WordPress bootstraps during Playground install/start#3693adamziel wants to merge 1 commit into
adamziel wants to merge 1 commit into
Conversation
7af22ba to
f688514
Compare
f688514 to
fee7041
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Playground CLI startup was doing redundant WordPress boot work around install/start, and Studio also needs a trustworthy signal for whether boot already applied requested admin credentials. Recent profiling also showed two distinct remaining costs:
Implementation
WordPressInstallOptionsand threads them throughrunCLI, the Blueprint v1 worker payload, andbootWordPress.siteTitleas the canonical install option name, while acceptingweblogTitlepluswordpressInstallOptions/ deprecatedstudioInstallOptionsaliases at the CLI integration boundary for compatibility./wp-admin/install.php?step=2installer POST. This intentionally keeps the standard installer request path and does not shortcut towp_install().php.run()after the installer request.wordpressBootResult.adminCredentialsAppliedon the actualrunCLI()server return value, in addition to lower-level boot metadata, so Studio can skip a redundant fallback mutation when boot already handled credentials.bootWordPress, installer request, finalization, Blueprint v1 steps, and secondary worker boot.Compatibility / behavior
install-from-existing-files-if-neededmode.adminCredentialsAppliedis only true when requested credential state verifies afterward.wp_install(), or Defender/ReFS-specific behavior.Security
adminPasswordis not included in the boot result or debug/perf metadata. It is only sent to the installer/finalization paths needed to set credentials.Perf notes
These are local Studio profiling measurements from the investigation that motivated this PR, not CI benchmarks, and I have not remeasured the exact latest commit after adding deferred secondary-worker boot:
STUDIO_WORKERS=1, child startup measured about 9.8s instead of 13.9s with six workers, which is why this PR now defers secondary server workers until after the primary install path.This is still a cleanup/small-to-medium install-path win rather than a full step-change: the standard
/wp-admin/install.php?step=2request remains the largest floor, measuring roughly 5.7-6.8s by itself in those profiling runs. A bigger improvement would need a separate, riskier fast-install path such as guarded directwp_install()or DB seeding.Tests
PATH=/usr/local/opt/node@22/bin:/opt/homebrew/opt/node@22/bin:$PATH npm exec nx run playground-cli:typecheckPATH=/usr/local/opt/node@22/bin:/opt/homebrew/opt/node@22/bin:$PATH npm exec -- vitest run tests/run-cli.spec.ts --config packages/playground/cli/vite.config.ts -t "multi-worker install credentials"PATH=/usr/local/opt/node@22/bin:/opt/homebrew/opt/node@22/bin:$PATH npm exec -- vitest run tests/run-cli.spec.ts --config packages/playground/cli/vite.config.ts -t "blueprint after secondary"PATH=/usr/local/opt/node@22/bin:/opt/homebrew/opt/node@22/bin:$PATH npm exec vitest run src/test/install-options.spec.ts -- --config packages/playground/wordpress/vite.config.tsPATH=/usr/local/opt/node@22/bin:/opt/homebrew/opt/node@22/bin:$PATH npm exec nx run playground-wordpress:lintPATH=/usr/local/opt/node@22/bin:/opt/homebrew/opt/node@22/bin:$PATH npm exec nx run playground-cli:lintPATH=/usr/local/opt/node@22/bin:/opt/homebrew/opt/node@22/bin:$PATH npm exec nx run playground-wordpress:build:bundlePATH=/usr/local/opt/node@22/bin:/opt/homebrew/opt/node@22/bin:$PATH npm exec nx run playground-cli:build:bundleAlso attempted the broader
playground-wordpress:test:vitepath earlier; the new install-options tests passed, but the existingversion-detect.spec.tstrunk runtime case still timed out at 30s.