Skip to content

Tests: Exempt @wordpress packages from the Vitest consumers release age - #87888

Merged
ciampo merged 1 commit into
trunkfrom
fix/vitest-consumers-release-age
Dec 3, 2026
Merged

ciampo merged 1 commit into
trunkfrom
fix/vitest-consumers-release-age

Conversation

@ciampo

@ciampo ciampo commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

What?

Stops the "Vitest consumers" check from failing on every pull request for a day after each npm release.

Why?

The check installs packed @wordpress/scripts and @wordpress/eslint-plugin in a standalone project, under the same min-release-age = 1 policy as the repository. The packed packages pin their @wordpress dependencies to the versions in the checkout. Right after a release, those versions are less than a day old, so the install fails:

npm error notarget No matching version found for @wordpress/prettier-config@5.3.0 with a date before 12/2/2026, 9:17:48 AM.

Since @wordpress/prettier-config@5.3.0 was published on 2026-12-02 at 16:36 UTC, all 9 jobs have failed on every run, on unrelated pull requests such as #87862. Before that, every run since 2026-11-26 passed. The failure goes away on its own after a day, so it's only noise.

How?

The consumer's .npmrc exempts @wordpress/* from the release-age window with min-release-age-exclude, which npm supports from 11.17. The repository requires npm 11.18 or later. The window still applies to third-party packages.

The exemption covers the whole scope, not only the packages the packer pins. Directly or through each other, the two packed packages depend on 25 @wordpress packages, and a release publishes new versions of them together.

Testing Instructions

  1. Find the date of the latest @wordpress release: npm view @wordpress/prettier-config time --json | tail -2.
  2. On trunk, in tools/validation/fixtures/vitest-consumer/.npmrc, set min-release-age to one more than the number of days since that release. This puts the release inside the window, as it is for a day after every release. Run npm run test:unit:consumers. The install fails with notarget for a @wordpress package.
  3. Make the same change on this branch and run the command again. The check passes.
  4. Revert the min-release-age change.

The "Vitest consumers" jobs also run on this pull request, because it changes the fixture.

Use of AI Tools

Written with Claude Code (Claude Opus 5.5), at my direction: Claude found the cause, made the change, and drafted this description.

🤖 Generated with Claude Code

The consumer installs packed @wordpress/scripts and @wordpress/eslint-plugin,
which pin their @WordPress dependencies to the versions in the checkout.
After each npm release those versions are newer than min-release-age allows,
so the check failed on every pull request for a day.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground Preview in Storybook

🎉 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: ciampo <mciampini@git.wordpress.org>
Co-authored-by: noruzzamans <noruzzaman@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.

@ciampo ciampo self-assigned this Dec 3, 2026
@ciampo ciampo added the [Type] Build Tooling Issues or PRs related to build tooling label Dec 3, 2026
@ciampo
ciampo marked this pull request as ready for review December 3, 2026 09:43
@ciampo
ciampo requested a review from manzoorwanijk as a code owner December 3, 2026 09:43
@ciampo
ciampo requested review from Mamaduka and aduth December 3, 2026 09:43

@noruzzamans noruzzamans left a comment

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.

Tested this locally by running node tools/validation/test-vitest-consumers.mjs --vite=8.0.0 — all consumer checks (commands, config discovery, jsdom, generated CSS, Jest compatibility, and lint defaults) passed cleanly without hitting the @wordpress/* release-age cooldown.

@ciampo

ciampo commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

I'll merge without formal approval to stop all the CI check errors that are currently happening on all PRs touching package.json

@ciampo ciampo added the Require PR update Forces open PRs to update from trunk label Dec 3, 2026
@ciampo
ciampo merged commit 6f29087 into trunk Dec 3, 2026
114 checks passed
@ciampo
ciampo deleted the fix/vitest-consumers-release-age branch December 3, 2026 10:10
@github-actions github-actions Bot added this to the Gutenberg 24.7 milestone Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Require PR update Forces open PRs to update from trunk [Type] Build Tooling Issues or PRs related to build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants