Skip to content

[Blueprints] Reject unsatisfied Blueprint v2 PHP constraints - #3898

Merged
adamziel merged 1 commit into
trunkfrom
reject-v2-runtime-php-unsatisfied
Jul 3, 2026
Merged

[Blueprints] Reject unsatisfied Blueprint v2 PHP constraints#3898
adamziel merged 1 commit into
trunkfrom
reject-v2-runtime-php-unsatisfied

Conversation

@adamziel

@adamziel adamziel commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

What

Throws a clear error when a Blueprint v2 PHP constraint object cannot match any supported Playground PHP runtime.

Why

After resolving min/max constraints, falling back to the default PHP version would hide invalid or unsatisfiable constraints. This keeps runtime resolution honest before booting WordPress.

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.

Adds explicit rejection (with a clear error) when a Blueprint v2 phpVersion constraint object cannot be satisfied by any supported Playground PHP runtime, preventing silent fallback to the recommended version.

Changes:

  • Throw an error when constraint-object PHP version resolution fails instead of falling back to the recommended PHP version.
  • Add a regression test ensuring unsatisfiable min/max constraints are rejected.

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 Throws when Blueprint v2 PHP constraint objects can’t be resolved to a supported PHP version.
packages/playground/blueprints/src/tests/v2/resolve-runtime-configuration.spec.ts Adds a test asserting unsatisfiable PHP constraints reject with a helpful error.

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

@adamziel
adamziel force-pushed the reject-v2-runtime-php-unsatisfied branch from 4de7b06 to c0f452b Compare July 3, 2026 14:01
@adamziel
adamziel merged commit cb99cf9 into trunk Jul 3, 2026
52 of 53 checks passed
@adamziel
adamziel deleted the reject-v2-runtime-php-unsatisfied branch July 3, 2026 14:42
adamziel added a commit that referenced this pull request Jul 3, 2026
## What

Adds `compileBlueprintForExecution()` as a small v1-only facade that
returns the compiled Blueprint together with the normalized declaration
and `run` function.

## Why

Consumers that need to support multiple Blueprint execution paths need
an entrypoint shaped around execution, not the legacy v1-only
`compileBlueprint()` alias. This introduces the public shape without
adding Blueprint v2 compiler behavior yet.

Replaces #3899, which was closed when the lower stacked base branch was
deleted after #3898 merged.

## Testing

- `npm run format:uncommitted`
- `npm exec nx run playground-blueprints:test:vite --
--testFiles=packages/playground/blueprints/src/tests/compile.spec.ts`
- `npm exec nx run playground-blueprints:typecheck`
- `npm exec nx run playground-blueprints:lint`
- `git diff --check`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment