Skip to content

Skip future-major milestones when milestoning merged PRs - #327

Merged
swissspidy merged 1 commit into
mainfrom
claude/adoring-bohr-xejsok
Dec 3, 2026
Merged

swissspidy merged 1 commit into
mainfrom
claude/adoring-bohr-xejsok

Conversation

@swissspidy

@swissspidy swissspidy commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

After a 3.0.0 release, the milestone workflow put merged PRs into 4.0.0 instead of 3.0.1. The script only ever creates patch bumps, so the 4.0.0 must have been a pre-existing open milestone that became the lowest open one once 3.0.0 was closed.

Changes to reusable-milestone-merged-prs.yml:

  • The latest closed versioned milestone is treated as the latest release.
  • Open milestones are only considered if they are above that release and in the same major version. Future-major milestones (e.g. 4.0.0) and stale older ones (e.g. a leftover 2.12.1) are skipped.
  • When no eligible open milestone exists, the new one is a patch bump of the latest release (3.0.0 → 3.0.1).
  • Repos without any closed versioned milestone keep the previous behavior.

README updated accordingly.

Tested the script locally with mocked API responses:

Milestones Result
3.0.0 closed, 4.0.0 open creates 3.0.1
3.0.0 closed, 4.0.0 + 3.1.0 open uses 3.1.0
3.0.0 closed, 2.12.1 open creates 3.0.1
2.12.0 closed, 2.12.1 open uses 2.12.1
only open milestones uses lowest open

Generated by Claude Code

Summary by CodeRabbit

  • Improvements
    • Milestone automation now selects the lowest eligible open versioned milestone after the latest closed milestone, within the same major version. If there is no closed milestone, any open versioned milestone may be selected.
    • When no eligible open milestone exists, the next milestone title is based on the latest closed milestone, or the highest versioned milestone if none are closed. Future-major milestones are not selected automatically.
  • Documentation
    • Updated the README to describe milestone selection and when automation does nothing.

After a 3.0.0 release, an open 4.0.0 milestone was the lowest open one
and got picked. Now only open milestones above the latest released
(closed) one and within its major are considered, and new milestones
are derived from the latest release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UWTd5oF3kcWP2VKmjcdCWK
@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The workflow filters open versioned milestones using the latest closed milestone when one exists. Its fallback version comes from the latest closed milestone, or the highest versioned milestone when none is closed. The README documents the selection and fallback rules.

Changes: Milestone selection

Layer / File(s) Summary
Milestone selection and fallback
.github/workflows/reusable-milestone-merged-prs.yml, README.md
Open milestones must sort after the latest closed versioned milestone and share its major version. If no closed milestone exists, open versioned milestones are not filtered by these conditions. The fallback uses the latest closed milestone when available, or the highest versioned milestone otherwise. The README describes the selection rules and fallback.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

  • wp-cli/.github#323: Added the milestone selection and fallback logic that this change updates.

Suggested reviewers: schlessera

Merge Risk: Minimal · up to 9b416

The change stops merged PRs from being assigned to a future-major milestone after a release. No concrete merge-blocking risk was identified.

Architecture risk: Low · up to 9b416

When a closed versioned milestone exists, the reusable workflow now limits open candidates to later versions in the same major and bases its fallback on that closed milestone; without one, candidate eligibility and the highest-version fallback remain.

Changed areas: README.md

Review details

Systems and components

  • observed — 1 changed file mapped to README.md.
Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title states the main change: merged PRs are no longer milestoned to a future-major milestone. The raw summary and objectives confirm the workflow now skips open milestones from a later major vers…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title states the main change: merged PRs are no longer milestoned to a future-major milestone. The raw summary and objectives confirm the workflow now skips open milestones from a later major version (e.g., 4.0.0 after 3.0.0 closes) and derives the next patch from the latest release. The title is specific and matches the changeset.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7e9b63e7-9ce6-40ca-b749-bb0f34a7878b
Commits

Reviewing files that changed from the base of the PR and between 1926976 and 9b416e6.

Files selected for processing: 2

  • .github/workflows/reusable-milestone-merged-prs.yml
  • README.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@swissspidy
swissspidy marked this pull request as ready for review December 3, 2026 09:59
@swissspidy
swissspidy requested a review from a team as a code owner December 3, 2026 09:59
Copilot AI balanced review requested due to automatic review settings December 3, 2026 09:59

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@swissspidy
swissspidy merged commit e8087b0 into main Dec 3, 2026
13 checks passed
@swissspidy
swissspidy deleted the claude/adoring-bohr-xejsok branch December 3, 2026 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants