Skip to content

Fix milestone detection for inflight PRs that missed release cutoff#35237

Closed
PureWeen wants to merge 1 commit into
mainfrom
fix/milestone-inflight-tag-check
Closed

Fix milestone detection for inflight PRs that missed release cutoff#35237
PureWeen wants to merge 1 commit into
mainfrom
fix/milestone-inflight-tag-check

Conversation

@PureWeen
Copy link
Copy Markdown
Member

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Description

Fixes milestone detection for PRs that merge to inflight/* branches but miss the release tag cutoff.

Problem

When a PR merges to inflight/current or inflight/candidate, the milestone script reads Versions.props at the merge commit to determine the version. But Versions.props only tells us what version was being developed — not whether the PR actually shipped. PRs that merge to inflight after the candidate cutoff get incorrectly milestoned to the already-shipped release.

Example: PR #34959 merged to inflight/candidate during the SR6 development period. But the April 14th candidate (#34885) merged to main after the 10.0.60 tag was cut, so #34959 did not ship in SR6. The script was incorrectly milestoning it to SR6.

Fix

After detecting the version from Versions.props, check if the PR number appears in the tag's commit range (searching commit messages for (#NNNNN) patterns — the same approach the tag-based mode uses). If the tag exists but the PR is not in the range, advance to the next SR version.

This correctly handles:

  • ✅ Inflight PRs that shipped via a candidate merge (found in tag range → keep version)
  • ✅ Inflight PRs that missed the cutoff (not in tag range → advance to next SR)
  • ✅ PRs merged directly to main (no inflight check needed)
  • ✅ PRs found on release branches (detected by Find-ReleaseBranchForCommit)

When a PR merges to inflight/* branches, the script previously trusted
Versions.props to determine the milestone. But Versions.props only
indicates what version was being developed, not whether the PR actually
shipped. PRs that merge to inflight after the candidate cutoff would be
incorrectly milestoned to the already-shipped release.

Now checks if the PR number appears in the tag's commit range (via
candidate merge commit messages). If the tag exists but the PR is not
in the range, it advances to the next SR version.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 29, 2026 20:50
@github-actions
Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 35237

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 35237"

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the milestone drift correction script to more accurately determine the shipped milestone for PRs merged into inflight/* branches, by verifying whether the PR actually appears in the release tag’s commit range before assigning that release’s milestone.

Changes:

  • Adds an inflight-specific verification step that checks whether the PR number appears in the detected release tag’s commit range.
  • If the PR is not found in that tag range, advances the detected release tag to the next servicing release to avoid mis-milestoning.

Comment on lines +603 to +621
$prev = Find-PreviousTag $ReleaseTag $allTags
$prsInTag = if ($prev) {
Get-PrNumbersBetweenTags $prev $ReleaseTag $Repo
} else {
Get-PrNumbersReachableFromTag $ReleaseTag $Repo
}
if ($PrNum -notin $prsInTag) {
# PR number not found in the tag range — PR missed this release
$patch = Get-PatchVersion $ReleaseTag
$major = if ($ReleaseTag -match '^(\d+)\.') { [int]$Matches[1] } else { $detectedMajor }
$nextPatch = $patch + 10
$nextTag = "$major.0.$nextPatch"
Write-Host " ⚠️ PR #$PrNum merged to $($pr.BaseRef) but is NOT in tag $ReleaseTag — advancing to $nextTag"
$ReleaseTag = $nextTag
$versionInfo = $null # Clear so downstream uses $ReleaseTag
$preLabel = $null
$preIter = 0
} else {
Write-Host " ✅ PR #$PrNum merged to $($pr.BaseRef) and found in tag $ReleaseTag (via candidate)"
# PR number not found in the tag range — PR missed this release
$patch = Get-PatchVersion $ReleaseTag
$major = if ($ReleaseTag -match '^(\d+)\.') { [int]$Matches[1] } else { $detectedMajor }
$nextPatch = $patch + 10
@PureWeen
Copy link
Copy Markdown
Member Author

Closing — main already has a fix for this using a different approach (reads Versions.props from origin/main HEAD instead of merge commit). Verified both approaches produce correct results.

@PureWeen PureWeen closed this Apr 29, 2026
@PureWeen PureWeen deleted the fix/milestone-inflight-tag-check branch April 29, 2026 21:19
@github-actions github-actions Bot locked and limited conversation to collaborators May 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants