[WIP] Update release scripts#2545
Draft
westonruter wants to merge 9 commits into
Draft
Conversation
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>
…sed in 1.0.0-beta3
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>
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
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.