Fix milestone detection for inflight PRs that missed release cutoff#35237
Closed
PureWeen wants to merge 1 commit into
Closed
Fix milestone detection for inflight PRs that missed release cutoff#35237PureWeen wants to merge 1 commit into
PureWeen wants to merge 1 commit into
Conversation
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>
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 35237Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 35237" |
Contributor
There was a problem hiding this comment.
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 |
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. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
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/currentorinflight/candidate, the milestone script readsVersions.propsat the merge commit to determine the version. ButVersions.propsonly 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/candidateduring the SR6 development period. But the April 14th candidate (#34885) merged to main after the10.0.60tag 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:
Find-ReleaseBranchForCommit)