ci: derive the wp-phpunit constraint from the downloaded WordPress core - #291
Merged
Merged
Conversation
The `latest` integration lane hardcoded `wp-phpunit/wp-phpunit:^7.0`. That is correct only while `latest` stays inside the 7.x series: once WordPress 8.0 ships, the lane would download 8.0 core and pair it with the 7.x test suite, so the drift lane would stop being a drift lane. Read the version back off the core that was actually downloaded instead, and fail the step loudly if that lookup comes up empty rather than falling through to an unconstrained `wp-phpunit:.*`. Also record the tested-up-to version in the README requirements.
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.
Follow-up to a WordPress 7.1 compatibility check. The package itself needed no changes: the drift lane already runs green against real WP 7.1 (58 tests, 158 assertions), and the 7.1 field guide lists no deprecation or removal touching any API Sproutset uses. This PR fixes the one real problem the check surfaced, which is in the harness rather than the library.
The problem
The
latestintegration lane hardcoded the wp-phpunit constraint:That holds only while
lateststays inside the 7.x series. Once WordPress 8.0 ships, the lane downloads 8.0 core and pairs it with the 7.x test suite. The job would either break confusingly or, worse, pass while testing a mismatched pair. Either way the drift lane stops detecting drift, which is the only thing it exists to do.The change
Read the series back off the core that was actually downloaded, and use it for both lanes:
SERIES=$(wp core version --path=/tmp/wordpress | cut -d. -f1,2)wp core versionis annotated@when before_wp_loadand readswp-includes/version.phpdirectly, so it works on a barewp core downloadwith no wp-config and no database, which is exactly the state of/tmp/wordpressat that point in the job.The empty-string guard matters: without it, a failed lookup would fall through to
wp-phpunit:.*and quietly install whatever Composer felt like.The pinned
6.7lane is unaffected in behaviour, it just takes the same code path now instead of its own branch.Verification
Checked before pushing:
7.1gives7.1.*,6.7.2gives6.7.*,6.7gives6.7.*.7.1.0and6.7.7), so neither lane loses its suite.The rest is what CI proves on this PR. Both integration lanes need to go green.
Also
README requirements now read
WordPress 6.7+ (tested up to 7.1).No PHP changed, so lint, types and Pest are untouched.
ci:anddocs:are not inchangelog-sections, so this is changelog-silent and does not move the version.