build: pin the wp-env WordPress core and plugin versions - #636
Draft
jkmassel wants to merge 1 commit into
Draft
Conversation
`.wp-env.json` pointed at `latest.zip` and unversioned plugin zips, so every CI run installed whatever shipped that day. A third-party release could therefore turn every open PR red without a line of code changing, and did: a Jetpack release began bundling `@wordpress/ui` 0.21, whose ThemeProvider shim reads `window.wp.theme` at module-evaluation time and throws when it is missing, so no Jetpack block registered and the third-party block E2E tests failed on every branch predating #614. Pin all three to the versions CI is passing with today. The trade is a manual bump — nothing watches these, since Dependabot does not read `.wp-env.json` — in exchange for an upgrade being a reviewable change with an attributable failure rather than a surprise on an unrelated PR.
XCFramework BuildThis PR's XCFramework is available for testing. Add the following to your .package(url: "https://github.com/wordpress-mobile/GutenbergKit", branch: "pr-build/636")Built from 95c5f6a |
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.
What?
Pins
.wp-env.jsonto explicit versions instead oflatest.zipand unversioned plugin zips.Why?
wp-env downloads whatever the URL resolves to, so every CI run installed whatever shipped that day. A third-party release could turn every open PR red without a line of code changing — and did.
A Jetpack release began bundling
@wordpress/ui0.21, whoseThemeProvidershim readswindow.wp.themeat module-evaluation time and throws when it is missing. No Jetpack block registered, soe2e/third-party-blocks.spec.jsfailed on every branch that predated #614:Nothing in any affected branch had changed. #594 last passed on Aug 21 and first failed on Sept 3; the only commit between the two deletes a
logErrorcall. The break came from outside the repo, arrived unannounced, and surfaced as a red check on eleven unrelated PRs — where the natural first assumption is that the PR broke something.Trade-off
Pinning is not free, and this is the part worth arguing about.
Cost: nothing watches these versions — Dependabot does not read
.wp-env.json— so they will rot until someone bumps them, and the local environment drifts from what users actually run.Benefit: an upgrade becomes a reviewable change whose failure is attributable to the upgrade, rather than a surprise on someone else's PR.
A lighter alternative, if the bump chore isn't wanted: pin only Jetpack, the third-party dependency we don't control and the one that actually broke, and leave core and Gutenberg tracking latest since those are the surfaces GutenbergKit is meant to stay current with. Happy to cut it back to that.
How?
The three versions are what CI resolved
latestto on a passing run, so this freezes a known-good state rather than proposing an upgrade. Each was confirmed against the WordPress.org API (core/stable-check,plugins/info/1.0), and all three versioned URLs return HTTP 200 — a 404 would break wp-env outright..wp-env.jsonis strict JSON with no comment support, so the rationale and the bump procedure go in docs/code/local-wordpress.md, under the existing "wp-env Configuration" section. That includes the part that bites: bumping requiresmake wp-env-start RESET=1, since an existing environment keeps the version it was created with.Testing Instructions
.wp-env.jsonis valid JSONI have not booted wp-env with these pins locally; the versions match what CI just used and the URLs resolve, but only a green E2E run demonstrates it. Worth watching that check specifically before this merges.
Related
window.wp.theme, the fix for the incident above