Skip to content

Add Behat scenarios for wp cli update --stable / --nightly PHP version checks - #1093

Open
swissspidy wants to merge 1 commit into
mainfrom
fix/update-manifest-check
Open

Add Behat scenarios for wp cli update --stable / --nightly PHP version checks#1093
swissspidy wants to merge 1 commit into
mainfrom
fix/update-manifest-check

Conversation

@swissspidy

@swissspidy swissspidy commented Jul 28, 2026

Copy link
Copy Markdown
Member

Accompanying test suite update for wp-cli/wp-cli#6362, which gates wp cli update --stable and wp cli update --nightly on the minimum PHP version specified in the build channel manifest files (wp-cli.manifest.json and wp-cli-nightly.manifest.json).

These scenarios ensure that WP-CLI Phar self-updates abort early with a descriptive error message when a user's PHP version does not meet the manifest requirement, preventing broken Phar updates during PHP version floor bumps.

Changes

Added two new Behat scenarios to features/cli.feature:

  • Prevent stable update when PHP version requirement is not met: Stubs an HTTP response for wp-cli.manifest.json with "requires_php": "99.0.0" and verifies that {PHAR_PATH} cli update --stable --yes exits with status 1 and reports the requirement.
  • Prevent nightly update when PHP version requirement is not met: Stubs an HTTP response for wp-cli-nightly.manifest.json with "requires_php": "99.0.0" and verifies that {PHAR_PATH} cli update --nightly --yes exits with status 1 and reports the requirement.

Summary by CodeRabbit

  • Bug Fixes
    • CLI updates now stop safely when the selected stable or nightly release requires an unsupported PHP version.
    • Clear error messages are shown instead of proceeding with an incompatible update.

@swissspidy
swissspidy requested a review from a team as a code owner July 28, 2026 09:40
@swissspidy swissspidy added the scope:testing Related to testing label Jul 28, 2026
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c92aa6bd-e8ae-4050-a917-eeca029ea38f

📥 Commits

Reviewing files that changed from the base of the PR and between 5315443 and 0da3cc6.

📒 Files selected for processing (1)
  • features/cli.feature

📝 Walkthrough

Walkthrough

Adds CLI feature scenarios verifying that stable and nightly updates fail when their manifests require an unavailable PHP version.

Changes

Update gating validation

Layer / File(s) Summary
Stable and nightly PHP requirement scenarios
features/cli.feature
Mocks stable and nightly manifests requiring PHP 99.0.0, then verifies the expected STDERR message and exit code 1 for both update commands.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: brianhenryie, ernilambar, janw-me

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the added Behat scenarios covering PHP version checks for stable and nightly update flows.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/update-manifest-check

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request scope:testing Related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant