Skip to content

Build: Add CI check for workspace peer dependency version ranges - #85386

Merged
simison merged 3 commits into
trunkfrom
simison/ci-version-range-check-a18daa
Nov 12, 2026
Merged

simison merged 3 commits into
trunkfrom
simison/ci-version-range-check-a18daa

Conversation

@simison

@simison simison commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Depends on #85383 #85388

Follow-up to manual range-widening changes:

What?

Fails when a workspace peer range excludes the peer's current version, or the next breaking version once its changelog announces breaking changes.

Why?

The major version of @wordpress/theme gets bumped via tooling, but the peer dependency range of @wordpress/wp-build kept the old range. That causes issues with plugins using the build tool package.

Packages where peer deps need updating accordingly:

  • wp-build
  • stylelint-config
  • theme-build-tools

To avoid missing updates, we should automate or lint it. I resorted in linting to leave bumping up to folks doing the updates for now.

How?

New step in static checks compares each published package’s peer ranges on workspace packages with the target’s current version and the version its Unreleased changelog will release as.

Testing Instructions

Not much more beyond npm run lint:peer-ranges and npm run test:unit -- tools/validation/check-peer-version-ranges.test.ts

Testing Instructions for Keyboard

Use of AI Tools

Claude

@simison
simison requested a review from a team October 22, 2026 12:34
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: simison <simison@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: manzoorwanijk <manzoorwanijk@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

📦 Bundle size

Size Change: 0 B

Total Size: 8.64 MB

7f20f22 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 95a4a74 trunk % Change
timeToFirstByte 55.95 ms +4.38% -2.59% 55.4 ms +12.36% -2.98% 0.99%
largestContentfulPaint 90 ms +2.22% -6.67% 88 ms +9.09% -4.55% 2.27%
lcpMinusTtfb 30.5 ms +24.75% -6.07% 30.3 ms +19.97% -8.42% 0.66%
wpBeforeTemplate 29.06 ms +3.44% -2.03% 29.34 ms +15.92% -3.31% -0.95%
wpTemplate 22.76 ms +2.72% -6.37% 22.37 ms +6.35% -3.62% 1.74%
wpTotal 52 ms +4.67% -2.75% 51.3 ms +13.7% -2.83% 1.36%
wpMemoryUsage 7.72 MB +0% -0% 7.68 MB +0% -0% 0.43%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric 95a4a74 trunk % Change
timeToFirstByte 47.7 ms +8.18% -2.41% 47 ms +5.11% -2.13% 1.49%
largestContentfulPaint 84 ms +4.76% -0% 84 ms +2.38% -4.76% 0%
lcpMinusTtfb 36.55 ms +3.56% -1.64% 34.8 ms +6.75% -2.01% 5.03%
wpBeforeTemplate 26.85 ms +6.18% -1.38% 27.01 ms +1.67% -2.7% -0.59%
wpTemplate 17.43 ms +3.33% -2.58% 16.83 ms +3.62% -1.25% 3.57%
wpTotal 44.52 ms +8.47% -2.58% 43.74 ms +5.44% -1.94% 1.78%
wpMemoryUsage 6.41 MB +0% -0% 6.37 MB +0% -0% 0.53%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric 95a4a74 trunk % Change
mediaProcessingJpeg 403.46 ms +0.79% -0.62% 403.6 ms +0.68% -0.54% -0.03%
mediaProcessingAvif 6211 ms +0.12% -0.57% 6195.2 ms +0.32% -0.24% 0.26%
mediaProcessingJpegToAvif 4283.2 ms +0.63% -0.12% 4252.21 ms +0.66% -0.12% 0.73%

media-upload

Metric 95a4a74 trunk % Change
jpegUploadProcessing 2010.28 ms +1% -2.75% 1954.57 ms +1.44% -20.31% 2.85%
pngUploadProcessing 298.43 ms +3.82% -2.99% 278.87 ms +5.87% -2.26% 7.01%
largeJpegUploadProcessing 1983.19 ms +1.08% -1.61% 1981.57 ms +1.27% -20.47% 0.08%
multipleImageUploadProcessing 2140.44 ms +0.69% -1.07% 2084.64 ms +1.27% -0.32% 2.68%

post-editor

Metric 95a4a74 trunk % Change
serverResponse 300.79 ms +11.63% -3.68% 338.82 ms +0.5% -9.14% -11.22%
firstPaint 350.72 ms +7.81% -10.58% 329.86 ms +4.75% -2.98% 6.32%
domContentLoaded 663.47 ms +8.24% -3.46% 650.54 ms +2.03% -0.47% 1.99%
loaded 664.63 ms +8.2% -3.51% 651.57 ms +2.01% -0.48% 2%
firstContentfulPaint 379 ms +9.09% -3.49% 369.95 ms +2.55% -0.9% 2.45%
firstBlock 1766.99 ms +4.14% -0.49% 1715.18 ms +3.67% -1.76% 3.02%
type 15.08 ms +7.89% -9.88% 15.32 ms +4.24% -9.73% -1.57%
typeWithoutInspector 15.45 ms +7.06% -8.8% 14.87 ms +10.02% -4.77% 3.9%
typeWithTopToolbar 19.68 ms +8.84% -5.89% 19.25 ms +3.79% -10.86% 2.23%
typeContainer 7.46 ms +16.09% -11.53% 6.84 ms +9.8% -9.36% 9.06%
focus 103.93 ms +1.96% -7.08% 92.64 ms +14.64% -1.13% 12.19%
firstFocus 220.22 ms +0% -0% 209.07 ms +0% -0% 5.33%
selectAll 312.31 ms +0.67% -0.05% 300.35 ms +3.51% -0.03% 3.98%
undo 24.51 ms +4.24% -4.32% 24.25 ms +5.32% -4.66% 1.07%
listViewOpen 64.13 ms +6.21% -3.9% 59.66 ms +6% -7.74% 7.49%
inserterOpen 32.54 ms +10.48% -2.3% 35.74 ms +4% -9.96% -8.95%
inserterHover 10.99 ms +11.01% -12.65% 10.22 ms +7.53% -12.43% 7.53%
inserterSearch 6.69 ms +15.84% -6.43% 6.54 ms +12.39% -0.76% 2.29%
loadPatterns 507.01 ms +7.7% -0.47% 520.07 ms +5.21% -2.42% -2.51%
wpTotal 292.2 ms +11.98% -3.76% 330.12 ms +0.33% -9.43% -11.49%
wpMemoryUsage 14.77 MB +0% -0% 14.74 MB +0% -0% 0.24%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric 95a4a74 trunk % Change
serverResponse 406.55 ms +1.08% -7.27% 410.97 ms +0.44% -0.98% -1.08%
firstPaint 421.32 ms +7.5% -8.01% 412.15 ms +8.46% -3.29% 2.22%
domContentLoaded 816.32 ms +0.92% -1.04% 835.68 ms +0.74% -1.32% -2.32%
loaded 817.52 ms +0.88% -1.05% 836.65 ms +0.76% -1.33% -2.29%
firstContentfulPaint 451.12 ms +0.95% -0.75% 467.43 ms +1.23% -2.81% -3.49%
firstBlock 2415.24 ms +1.85% -1.27% 2462.78 ms +0.65% -0.8% -1.93%
type 18.02 ms +2.39% -10.65% 17.62 ms +4.03% -10.27% 2.27%
navigate 117.39 ms +6.42% -2.62% 121.53 ms +4.75% -3.39% -3.41%
loadPatterns 1299.96 ms +15.09% -14.27% 1349.76 ms +8.8% -2.64% -3.69%
loadPages 938.38 ms +2.11% -1.63% 944.99 ms +1.44% -1.74% -0.7%
wpTotal 397.35 ms +1.09% -7.45% 401.81 ms +0.44% -1.03% -1.11%
wpMemoryUsage 12.79 MB +0% -0% 12.75 MB +0% -0% 0.27%
wpDbQueries 45 +0% -0% 45 +0% -0% 0%

7f20f22 Run

🏁 Flaky tests

Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

Actions are reachable via RIGHT/LEFT arrow keys in /test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeFocused() failed

Locator:  getByRole('row', { name: 'Page One Edit Actions' }).getByRole('button', { name: 'Edit' })
Expected: focused
Received: inactive
Timeout:  5000ms

Call log:
  - Expect "toBeFocused" getByRole('row', { name: 'Page One Edit Actions' }).getByRole('button', { name: 'Edit' }) with timeout 5000ms
  - waiting for getByRole('row', { name: 'Page One Edit Actions' }).getByRole('button', { name: 'Edit' })
    14 × locator resolved to <button type="button" tabindex="-1" class="components-button is-small" id="view-list-0-195-primary-action-edit-post">Edit</button>
       - unexpected value "inactive"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js:172:5

7f20f22 Run

@simison
simison force-pushed the simison/ci-version-range-check-a18daa branch from b5ac869 to c23728e Compare October 26, 2026 17:10
@simison
simison force-pushed the simison/ci-version-range-check-a18daa branch from adbcefd to a86b1cc Compare October 26, 2026 17:43
@simison
simison requested a review from jsnajdr November 10, 2026 14:37
@simison
simison force-pushed the simison/ci-version-range-check-a18daa branch from a86b1cc to e495637 Compare November 10, 2026 14:40
@simison
simison marked this pull request as ready for review November 10, 2026 14:40
@simison

simison commented Nov 10, 2026

Copy link
Copy Markdown
Member Author

With #85388 now merged and @wordpress/theme-build-tools released to NPM this is now relevant again, so that we don't in future miss updating peer deps in three packages:

  • wp-build
  • stylelint-config
  • theme-build-tools

Comment thread .github/workflows/static-checks.yml Resolved
@simison simison added the [Type] Build Tooling Issues or PRs related to build tooling label Nov 10, 2026
@@ -0,0 +1,173 @@
#!/usr/bin/env node
/*

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could syncpack cover this? lint:deps already runs in static checks, and this group (first in versionGroups) flags a peer range that excludes the workspace version:

{
	label: 'Peer ranges on workspace packages must admit the workspace version.',
	dependencies: [ '@wordpress/**' ],
	dependencyTypes: [ 'peer', 'local' ],
	policy: 'sameRange',
},

I tried it with syncpack 15.3.1: it passes on this branch, and narrowing the @wordpress/theme peer of @wordpress/build to ^3.0.0 fails with SameRangeMismatch.

Syncpack does not read changelogs, so the lookahead to the next release version is the only part it cannot do. Is that worth a custom script and a dependency on the release tool internals?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I'm not really familiar with Syncpack as a tool yet; testing it in another PR:

Looks promising!

Syncpack does not read changelogs, so the lookahead to the next release version is the only part it cannot do. Is that worth a custom script and a dependency on the release tool internals?

I actually don't have experience with the official GB release process beyond rolling out next package releases, to tell exactly if the Syncpack thing would be enough. Probably? I'm assuming this will now add the work to package release manager, rather than anyone opening/merging breaking-change PRs between releases.

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.

The proposed syncpack rule covers the current-version check. This script also catches a pending breaking release in the PR that adds its changelog entry, so replacing it means giving up that earlier check. I'd keep the script if we want peer updates in those breaking-change PRs.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good!

One option is also do both and just leave the changelog reading to the script but at that point I think it's easier to keep everything in one place; less mysterious.

@manzoorwanijk manzoorwanijk Nov 11, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good.

IMHO we should seriously consider the better approaches out there for changelog management, which then affects the released versions. Changesets is probably the best candidate for us. We could use its updateInternalDependencies option to ensure that any dependent packages get bumped automatically. It also gets rid of the changelog conflicts we often have to deal with.

@ciampo ciampo Nov 11, 2026 •

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.

IMHO we should seriously consider the better approaches out there for changelog management

@talldan has been trying out an approach in #85369

One option is also do both

Agreed, I'd keep both checks together here. Catching stale peer ranges in the breaking-change PR makes the extra script worthwhile.

@simison
simison force-pushed the simison/ci-version-range-check-a18daa branch from 22a564c to f6f4f6f Compare November 10, 2026 18:32
Fails when a workspace peer range excludes the peer's current version, or the next breaking version once its changelog announces breaking changes.
Also adds @types/semver and cites the PR in the touched changelogs.
… on wp/next

Prerelease versions such as 2.1.2-next.v.… are checked as the stable version they lead to. The step is also skipped on wp/next.
@simison
simison force-pushed the simison/ci-version-range-check-a18daa branch from f6f4f6f to 7f20f22 Compare November 11, 2026 09:06

@ciampo ciampo 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.

I don't have additional feedback on my end 🚀 Thank you for working on this!

@simison
simison merged commit d114ab3 into trunk Nov 12, 2026
101 of 102 checks passed
@simison
simison deleted the simison/ci-version-range-check-a18daa branch November 12, 2026 08:00
@github-actions github-actions Bot added this to the Gutenberg 24.5 milestone Nov 12, 2026
@Mamaduka

Copy link
Copy Markdown
Member

I noticed failure on trunk - https://github.com/WordPress/gutenberg/actions/runs/43180585746/job/131055283331

@simison

simison commented Nov 12, 2026 •

Copy link
Copy Markdown
Member Author

FYI I followed up with fix to above in now merged #86720 Mamaduka you were a minute faster than when I noticed it. :-D

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

Labels

[Type] Build Tooling Issues or PRs related to build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants