Commit f4fb086
Add preview/RC milestone support with release branch detection (dotnet#34999)
<!-- Please let the below note in for people that find this PR -->
> [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!
## Summary
Follow-up to dotnet#34686. Adds preview/RC milestone support and release
branch detection to the milestone drift fixer.
## Problem
PRs merged to \`net11.0\` were not being milestoned because
\`Versions.props\` on that branch always has
\`PreReleaseVersionIteration=1\` regardless of which preview the PR
actually ships in. The iteration is only bumped on release branches.
## Solution
### Release Branch Detection (Primary)
New detection step checks release branches first using \`merge-base
--is-ancestor\`. For each PR, it finds the **earliest** release branch
containing the merge commit:
| Release Branch | Milestone |
|---|---|
| \`release/10.0.1xx\` | \`.NET 10.0 GA\` |
| \`release/10.0.1xx-sr5\` | \`.NET 10 SR5\` |
| \`release/11.0.1xx-preview1\` | \`.NET 11.0-preview1\` |
| \`release/11.0.1xx-preview3\` | \`.NET 11.0-preview3\` |
| \`release/12.0.1xx-rc1\` | \`.NET 12.0-rc1\` |
### Detection Order
1. **Explicit \`-Tag\`** — if provided
2. **Release branches** — \`merge-base --is-ancestor\` against
\`release/{Major}.0.1xx-*\` branches, earliest match wins
3. **Versions.props** at merge commit — fallback for PRs not yet on any
release branch
4. **Tag range search** — last resort
### Preview/RC Milestone Mapping
\`ConvertTo-Milestone\` now accepts optional pre-release label and
iteration:
| Input | Milestone |
|---|---|
| \`11.0.0 + preview + 3\` | \`.NET 11.0-preview3\` |
| \`12.0.0 + rc + 1\` | \`.NET 12.0-rc1\` |
| \`10.0.60\` (stable) | \`.NET 10 SR6\` (unchanged) |
## Validated Results
| PR | Base | Current Milestone | Script Result | Method |
|---|---|---|---|---|
| dotnet#33524 | net11.0 | .NET 11.0-preview1 | .NET 11.0-preview1 ✅ | Release
branch |
| dotnet#33233 | net11.0 | .NET 11.0-preview1 | .NET 11.0-preview1 ✅ | Release
branch |
| dotnet#30132 | net11.0 | .NET 11.0-preview3 | .NET 11.0-preview3 ✅ | Release
branch |
| dotnet#33834 | net11.0 | .NET 11.0-preview3 | .NET 11.0-preview3 ✅ | Release
branch |
| dotnet#34214 | net11.0 | .NET 11.0-preview2 | .NET 11.0-preview3 ✅ | Release
branch (drift caught!) |
| dotnet#34945 | net11.0 | .NET 11.0-preview4 | preview1 (fallback) |
Versions.props (no p4 branch yet) |
| dotnet#34620 | main | .NET 10 SR6 | .NET 10 SR6 ✅ | Release branch |
| dotnet#34047 | main | .NET 10 SR4.1 | .NET 10 SR5 ✅ | Release branch (drift
caught!) |
PR dotnet#34214 is a real drift example: milestoned preview2 by a human, but
actually on the preview3 release branch.
## Test Suite
88 Pester tests (11 new):
- 6 for \`ConvertTo-Milestone\` preview/RC mapping
- 5 for \`ConvertBranchToMilestone\` (GA, SR, preview, RC, non-release)
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 3c06583 commit f4fb086
File tree
3 files changed
+260
-40
lines changed- .github
- scripts
- workflows
3 files changed
+260
-40
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
57 | 72 | | |
58 | 73 | | |
59 | 74 | | |
| |||
157 | 172 | | |
158 | 173 | | |
159 | 174 | | |
160 | | - | |
| 175 | + | |
| 176 | + | |
161 | 177 | | |
162 | 178 | | |
163 | 179 | | |
164 | | - | |
| 180 | + | |
165 | 181 | | |
166 | 182 | | |
167 | 183 | | |
| |||
173 | 189 | | |
174 | 190 | | |
175 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
176 | 199 | | |
177 | 200 | | |
| 201 | + | |
178 | 202 | | |
179 | 203 | | |
180 | 204 | | |
| |||
245 | 269 | | |
246 | 270 | | |
247 | 271 | | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
248 | 301 | | |
249 | 302 | | |
250 | 303 | | |
| |||
257 | 310 | | |
258 | 311 | | |
259 | 312 | | |
260 | | - | |
| 313 | + | |
261 | 314 | | |
262 | 315 | | |
263 | 316 | | |
264 | 317 | | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
265 | 323 | | |
266 | 324 | | |
| 325 | + | |
267 | 326 | | |
268 | 327 | | |
269 | | - | |
270 | | - | |
| 328 | + | |
271 | 329 | | |
272 | 330 | | |
273 | 331 | | |
| |||
0 commit comments