Skip to content

[CLI] Use preferredVersions.wp in Playground CLI - #4075

Merged
adamziel merged 1 commit into
trunkfrom
cli-honor-v1-blueprint-runtime-versions
Jul 16, 2026
Merged

[CLI] Use preferredVersions.wp in Playground CLI#4075
adamziel merged 1 commit into
trunkfrom
cli-honor-v1-blueprint-runtime-versions

Conversation

@adamziel

@adamziel adamziel commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

V1 CLI Blueprints can request a specific WordPress release:

{
  "preferredVersions": {
    "wp": "6.2"
  }
}

Before this change, the CLI ignored that value while downloading WordPress. With no --wp flag, it did this:

resolveWordPressRelease(this.args.wp); // undefined → latest

The worker then unzipped that latest archive. Passing wpVersion: '6.2' later did not change the files already in the archive, so the Blueprint silently ran the current WordPress release instead of WordPress 6.2.

This change resolves the Blueprint runtime before downloading WordPress and passes its requested version to resolveWordPressRelease(). The downloaded archive and the running site now match the Blueprint.

The regression test uses a Blueprint requesting WordPress 6.2 and verifies that the CLI resolves WordPress 6.2 before booting the worker.

Testing

Start a V1 CLI Blueprint with preferredVersions.wp set to 6.2. Check that wp-includes/version.php reports WordPress 6.2.

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

Note

Copilot was unable to run its full agentic suite in this review.

Aligns v1 CLI Blueprint artifact preparation with the effective runtime versions (WP/PHP) that will be used to boot the worker, preventing mismatches between downloaded WordPress builds / selected SQLite integration and the actual worker runtime.

Changes:

  • Resolve the effective v1 runtime configuration up-front in the handler and use it for both WordPress release resolution and SQLite integration selection.
  • Update WordPress ZIP resolution to use the effective wpVersion rather than only --wp.
  • Add a Vitest spec ensuring the handler prepares artifacts using Blueprint-declared preferredVersions.

Reviewed changes

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

File Description
packages/playground/cli/src/blueprints-v1/blueprints-v1-handler.ts Uses resolved runtime configuration for WordPress release lookup and SQLite integration selection to match worker boot versions.
packages/playground/cli/tests/blueprints-v1-handler.spec.ts Adds regression coverage asserting WP release resolution + SQLite integration selection follow Blueprint preferredVersions.

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

Comment on lines +12 to +17
cachedDownload: vi.fn(
async () => new File(['WordPress'], 'wordpress.zip')
),
fetchSqliteIntegration: vi.fn(
async () => new File(['SQLite'], 'sqlite.zip')
),
@adamziel
adamziel force-pushed the cli-honor-v1-blueprint-runtime-versions branch from 56c9a53 to dcd6a7c Compare July 16, 2026 14:06
@adamziel adamziel changed the title [CLI] Prepare v1 runtime artifacts for Blueprint versions Jul 16, 2026
@adamziel
adamziel merged commit e753e8f into trunk Jul 16, 2026
53 checks passed
@adamziel
adamziel deleted the cli-honor-v1-blueprint-runtime-versions branch July 16, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment