Set milestone on PRs after cherry-picking to release branch#76652
Conversation
When cherry-picking PRs to a Gutenberg release branch (e.g. release/22.7), automatically update the PR's milestone to match (e.g. "Gutenberg 22.7"). This only applies to Gutenberg RC backports (label: "Backport to Gutenberg RC"), not WP Core backports. It prevents backported PRs from appearing in the wrong release's changelog due to having an outdated milestone.
|
Size Change: 0 B Total Size: 8.76 MB ℹ️ View Unchanged
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Flaky tests detected in 8264a65. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/23270680195
|
…nch (#76652) When cherry-picking PRs to a Gutenberg release branch (e.g. release/22.7), automatically update the PR's milestone to match (e.g. "Gutenberg 22.7"). This only applies to Gutenberg RC backports (label: "Backport to Gutenberg RC"), not WP Core backports. It prevents backported PRs from appearing in the wrong release's changelog due to having an outdated milestone. ---- Co-authored-by: dsas <dsas@git.wordpress.org> Co-authored-by: tyxla <tyxla@git.wordpress.org>
…nch (#76652) When cherry-picking PRs to a Gutenberg release branch (e.g. release/22.7), automatically update the PR's milestone to match (e.g. "Gutenberg 22.7"). This only applies to Gutenberg RC backports (label: "Backport to Gutenberg RC"), not WP Core backports. It prevents backported PRs from appearing in the wrong release's changelog due to having an outdated milestone. ---- Co-authored-by: dsas <dsas@git.wordpress.org> Co-authored-by: tyxla <tyxla@git.wordpress.org>
…nch (#76652) When cherry-picking PRs to a Gutenberg release branch (e.g. release/22.7), automatically update the PR's milestone to match (e.g. "Gutenberg 22.7"). This only applies to Gutenberg RC backports (label: "Backport to Gutenberg RC"), not WP Core backports. It prevents backported PRs from appearing in the wrong release's changelog due to having an outdated milestone. ---- Co-authored-by: dsas <dsas@git.wordpress.org> Co-authored-by: tyxla <tyxla@git.wordpress.org>
What?
Automatically sets the GitHub milestone on PRs after they are cherry-picked to a Gutenberg release branch.
Why?
During the 22.8 release, several PRs that were backported to the previous release still appeared in the 22.8 changelog because their milestone wasn't updated. The changelog generation script uses milestones to determine which PRs belong to which release, so stale milestones cause PRs to appear in the wrong changelog.
How?
Added a
getMilestoneFromBranch()function that derives the milestone name from the current release branch (e.g.release/22.7→Gutenberg 22.7). After a successful cherry-pick, when the label isBackport to Gutenberg RC, the script updates the PR's milestone viagh pr edit --milestone. This does not run for WP Core backports (Backport to WP Beta/RC).Testing Instructions
Testing requires a fork since the script modifies PRs on GitHub.
Setup
WordPress/gutenbergto your account (e.g.youruser/gutenberg).origin:https://github.com/youruser/gutenberg/milestones/newand createGutenberg 99.0.Backport to Gutenberg RClabel on the fork if it doesn't exist.Apply and commit the changes on the release branch
const REPO = 'WordPress/gutenberg'toconst REPO = 'youruser/gutenberg'inbin/cherry-pick.mjs.release/99.0.Create a test PR to cherry-pick
Backport to Gutenberg RClabel, and squash-merge it.Run the cherry-pick
Gutenberg 99.0.Cleanup
git remote rename origin fork && git remote rename upstream originUse of AI Tools
Claude Code was used to assist with implementing the feature, setting up the fork-based test environment, and drafting this PR.