Skip to content

[Blueprints] Resolve recommended Blueprint v2 PHP versions - #3895

Merged
adamziel merged 1 commit into
trunkfrom
resolve-v2-runtime-php-recommended
Jul 3, 2026
Merged

[Blueprints] Resolve recommended Blueprint v2 PHP versions#3895
adamziel merged 1 commit into
trunkfrom
resolve-v2-runtime-php-recommended

Conversation

@adamziel

@adamziel adamziel commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

What

Uses phpVersion.recommended from Blueprint v2 PHP constraint objects when resolving RuntimeConfiguration.phpVersion. Constraints without a recommended version keep the current default behavior.

Why

Blueprint v2 already lets callers express a preferred PHP version inside a constraint object. This lets Playground honor that explicit runtime choice without adding full constraint solving yet.

Testing

  • npm run format:uncommitted
  • npm exec nx run playground-blueprints:test:vite -- --testFiles=packages/playground/blueprints/src/tests/v2/resolve-runtime-configuration.spec.ts
  • npm exec nx run playground-blueprints:typecheck
  • npm exec nx run playground-blueprints:lint
  • git diff --check

Part of #2592.

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.

This PR updates Blueprint v2 runtime resolution to honor an explicit phpVersion.recommended when phpVersion is provided as a constraint object, while preserving the existing default behavior when no recommended version is provided.

Changes:

  • Resolve RuntimeConfiguration.phpVersion from phpVersion.recommended for Blueprint v2 constraint objects.
  • Refactor PHP version parsing/validation into a shared helper.
  • Update/add tests for recommended-vs-default constraint behavior.

Reviewed changes

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

File Description
packages/playground/blueprints/src/lib/resolve-runtime-configuration.ts Adds support for phpVersion.recommended and factors string validation into a helper.
packages/playground/blueprints/src/tests/v2/resolve-runtime-configuration.spec.ts Adjusts tests to cover recommended resolution and default fallback.
Comments suppressed due to low confidence (1)

packages/playground/blueprints/src/tests/v2/resolve-runtime-configuration.spec.ts:1

  • The test expects phpVersion: '8.2', but the provided constraint object does not include a recommended field. With the new resolver logic, this will fall back to RecommendedPHPVersion, so this assertion should fail. Add recommended: '8.2' to the constraint object (or change the expectation to RecommendedPHPVersion if the intent is to validate the default behavior).
import { StreamedFile } from '@php-wasm/stream-compression';

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

});
});

it('uses the default PHP version for constraints without a recommended version', async () => {
@adamziel
adamziel merged commit bd09aa7 into trunk Jul 3, 2026
52 checks passed
@adamziel
adamziel deleted the resolve-v2-runtime-php-recommended branch July 3, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment