Skip to content

[WIP] Update release scripts#2545

Draft
westonruter wants to merge 9 commits into
trunkfrom
update/release-scripts
Draft

[WIP] Update release scripts#2545
westonruter wants to merge 9 commits into
trunkfrom
update/release-scripts

Conversation

@westonruter

Copy link
Copy Markdown
Member

Summary

This automates more of the manual steps in the handbook page for the next release.

Relevant technical choices

Use of AI Tools

Using Claude Code as annotated in commits.

westonruter and others added 9 commits June 21, 2026 23:03
Introduce `npm run bump-versions`, which sets each plugin's version based on
its release milestone instead of editing the files by hand.

A release milestone is an open GitHub milestone whose title is
"<plugin-slug> <version>" (i.e. it does not contain "n.e.x.t") and which has a
due date set; the due date distinguishes a release milestone from a
backlog/planning milestone. For each matching milestone the target version is
applied to:

- the plugin bootstrap PHP file "Version" header,
- the PHP version constant,
- the "Stable tag" in readme.txt, and
- a changelog entry in readme.txt.

The changelog handling relabels an existing "= n.e.x.t =" entry to the version
(preserving any notes accrued during development) rather than inserting a
duplicate, is idempotent when an entry for the version already exists, and
otherwise inserts a new empty entry so the readme stays version-consistent and
is primed for `npm run readme`.

The command warns (rather than skips) when a matched milestone still has open
issues/PRs, errors if two dated milestones target the same plugin, and supports
`--plugin`, `--token`, and `--dry-run`. A reusable `getMilestones()` helper is
added to the milestone lib.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
By default `npm run since` now only resolves "n.e.x.t" tags for plugins that
are actually being released, i.e. those with an open GitHub milestone that has
a due date and whose title does not contain "n.e.x.t". This prevents resolving
"@SInCE n.e.x.t" tags in plugins that are still mid-development (e.g. betas with
no scheduled release).

The release-milestone detection is shared with the `bump-versions` command:
`getReleaseMilestones()` is exported from that command and reused here, mirroring
how `readme` reuses `getChangelog` from `changelog`.

A `--all` flag restores the previous behavior of updating every plugin while
ignoring milestones; combined with `--plugin` it updates that one plugin without
requiring a milestone. A `--token` option is added for the GitHub API request.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The `since` command only resolved the "n.e.x.t" version placeholder in "@SInCE"
tags, leaving "@deprecated n.e.x.t" tags untouched. WordPress uses the same
placeholder in both, so broaden the match to "@SInCE" and "@deprecated".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The logical assignment expression `( byPlugin[ slug ] ??= [] ).push( … )`
was overly clever; expand it into a plain existence check before pushing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WgTbsDpCqxVBrH3yDH65jS
Clear the inspections that PhpStorm surfaces (but the project's tsc config does
not) across the bin/plugin release commands:

- Prefix intentionally-unused regex-replacer callback parameters with an
  underscore so they are recognized as deliberate (TS6133).
- Drop the unused "milestone" parameter from changelog's formatChangelog().
- Remove redundant "\." escapes inside character classes in the version-parsing
  regular expressions.

No behavior change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Turn on `noUnusedParameters` so `tsc` flags unused function parameters the same
way PhpStorm's inspections already do, keeping the two consistent. The codebase
is already clean under this option, so `npm run tsc` continues to pass with no
new errors.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@westonruter westonruter self-assigned this Jun 22, 2026
@github-actions github-actions Bot added the [Plugin] Optimization Detective Issues for the Optimization Detective plugin label Jun 22, 2026
@westonruter westonruter added Infrastructure Issues for the overall performance plugin infrastructure no milestone PRs that do not have a defined milestone for release skip changelog PRs that should not be mentioned in changelogs [Type] Enhancement A suggestion for improvement of an existing feature and removed [Plugin] Optimization Detective Issues for the Optimization Detective plugin labels Jun 22, 2026
@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.03%. Comparing base (5fc2727) to head (5de30e9).

Additional details and impacted files
@@           Coverage Diff           @@
##            trunk    #2545   +/-   ##
=======================================
  Coverage   70.03%   70.03%           
=======================================
  Files          91       91           
  Lines        7803     7803           
=======================================
  Hits         5465     5465           
  Misses       2338     2338           
Flag Coverage Δ
multisite 70.03% <ø> (ø)
single 35.42% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

Infrastructure Issues for the overall performance plugin infrastructure no milestone PRs that do not have a defined milestone for release skip changelog PRs that should not be mentioned in changelogs [Type] Enhancement A suggestion for improvement of an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant