Open
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the existing GitHub Actions automation which labels issues closed by merged PRs, extending it to also move those closed issues from the Backlog milestone (or no milestone) to the milestone for the current major version derived from eng/Versions.props.
Changes:
- Read
VersionPrefixfromeng/Versions.propson the PR target branch to determine the major-version milestone (e.g.11.0.0). - Query closing issues via GraphQL including their milestone, and update milestones when needed.
- Improve logging and aggregate per-issue failures into a single workflow failure.
Comments suppressed due to low confidence (3)
.github/workflows/label-and-milestone-issues.yml:118
- The workflow now throws when no matching preview/RC
release/*branches are found (or when the latest major has no preview/RC branches). Since this job runs on every merged PR tomain, this change can turn a previously benign 'skip' case into a failing workflow run, creating noisy failures during periods without preview/RC branches. Consider logging and returning (skip) instead of throwing here, unless a failing workflow run is explicitly desired.
.github/workflows/label-and-milestone-issues.yml:168 listMilestonesis called withstate: 'open'and only the first page (per_page: 100) is fetched. This can cause the workflow to fail for servicing branches where the${majorVersion}.0.0milestone may already be closed (or if there are >100 milestones), even though GitHub still allows assigning a closed milestone to issues. Consider listing milestones withstate: 'all'and paginating (or usinggithub.paginate) before searching by title.
.github/workflows/label-and-milestone-issues.yml:50parseInt(versionPrefixMatch[1])should pass a radix (e.g. 10) for consistent parsing and to avoid edge cases if the string ever includes a leading zero or other prefix.
You can also share your feedback on Copilot code review. Take the survey.
AndriySvyryd
reviewed
Mar 6, 2026
Comment on lines
+150
to
+170
| // Look up the target milestone number (e.g. "11.0.0") if any issue needs a milestone update | ||
| const targetMilestoneName = `${majorVersion}.0.0`; | ||
| let targetMilestoneNumber = null; | ||
| const needsMilestoneUpdate = closingIssues.some( | ||
| issue => !issue.milestone || issue.milestone.title === 'Backlog' | ||
| ); | ||
|
|
||
| if (needsMilestoneUpdate) { | ||
| const { data: milestones } = await github.rest.issues.listMilestones({ | ||
| owner, | ||
| repo, | ||
| state: 'open', | ||
| per_page: 100 | ||
| }); | ||
| const targetMilestone = milestones.find(m => m.title === targetMilestoneName); | ||
| if (targetMilestone) { | ||
| targetMilestoneNumber = targetMilestone.number; | ||
| } else { | ||
| throw new Error(`Milestone '${targetMilestoneName}' not found`); | ||
| } | ||
| } |
AndriySvyryd
approved these changes
Mar 6, 2026
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.
Continues the previous work for applying preview version labels: this now also sets the closed issue's milestone, for both vnext on main (e.g. 11.0.0) and for release (servicing) PRs.