[skill] Use Version.Details.xml as VMR snapshot fallback for manual backflow#124129
[skill] Use Version.Details.xml as VMR snapshot fallback for manual backflow#124129
Conversation
There was a problem hiding this comment.
Pull request overview
Improves reliability of GitHub “skills” automation scripts by (1) making VMR snapshot detection resilient to manual backflow commit message formats and (2) working around a Helix API artifact URI bug for subdirectory files.
Changes:
- Add a fallback to read
eng/Version.Details.xmlon the PR branch to infer the VMR snapshot SHA when commit messages aren’t parseable. - Improve snapshot validation messaging (identify whether snapshot came from commit messages vs
Version.Details.xml). - Rebuild Helix artifact file URIs from
FileNamefor subdirectory artifacts and document the known Helix API issue.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
.github/skills/vmr-codeflow-status/scripts/Get-CodeflowStatus.ps1 |
Adds Version.Details.xml fallback and refines snapshot validation/status output. |
.github/skills/azdo-helix-failures/scripts/Get-HelixFailures.ps1 |
Workaround for broken Helix artifact URIs for files in subdirectories by reconstructing URLs. |
.github/skills/azdo-helix-failures/references/helix-artifacts.md |
Documents the Helix API bug and the script’s workaround. |
.github/skills/vmr-codeflow-status/scripts/Get-CodeflowStatus.ps1
Outdated
Show resolved
Hide resolved
.github/skills/vmr-codeflow-status/scripts/Get-CodeflowStatus.ps1
Outdated
Show resolved
Hide resolved
b9b70b4 to
3090c43
Compare
3090c43 to
3969355
Compare
3969355 to
b5e3166
Compare
2fa670d to
33ae35f
Compare
.github/skills/vmr-codeflow-status/scripts/Get-CodeflowStatus.ps1
Outdated
Show resolved
Hide resolved
.github/skills/vmr-codeflow-status/scripts/Get-CodeflowStatus.ps1
Outdated
Show resolved
Hide resolved
33ae35f to
0062b79
Compare
0062b79 to
c0c18fd
Compare
.github/skills/vmr-codeflow-status/scripts/Get-CodeflowStatus.ps1
Outdated
Show resolved
Hide resolved
.github/skills/vmr-codeflow-status/scripts/Get-CodeflowStatus.ps1
Outdated
Show resolved
Hide resolved
.github/skills/vmr-codeflow-status/scripts/Get-CodeflowStatus.ps1
Outdated
Show resolved
Hide resolved
Version.Details.xml's <Source Sha=...> is the authoritative record of which VMR commit a product repo branch is based on. Previously the script treated it as a fallback after commit message parsing. Now it's checked first, with commit messages as secondary confirmation. This correctly handles: - Manual backflow (darc vmr backflow pushed directly) - Normal codeflow (Maestro-managed) - Conflicted PRs (VD.xml reflects pre-codeflow state) - Forward flow PRs (skips VD.xml, uses commit messages) Tested against sdk#52727 (manual backflow) and sdk#52885 (conflicted).
-CheckMissing now scans open forward flow PRs (product repo → dotnet/dotnet) in addition to missing backflow PRs. For each forward flow PR it detects: - Conflict (Maestro 'Conflict detected' comment) - Staleness (opposite codeflow merged while PR was open) - Healthy (no issues) Summary section now shows both directions. Also fixes: dotnet-maestro comment author matching (gh CLI returns 'dotnet-maestro' not 'dotnet-maestro[bot]' for login field). Tested against dotnet/sdk (4 forward PRs: 2 healthy, 1 stale, 1 conflict) and dotnet/runtime (3 forward PRs: 2 healthy, 1 stale).
5cc04ae to
adc8cb1
Compare
- Use 2>$null instead of 2>&1 for gh pr view to prevent stderr corrupting JSON stream - Wrap ConvertFrom-Json in try/catch for forward flow PR details - Tighten regex fallback to require exactly 40-char hex SHA - Use case-insensitive StringComparison for SHA matching
6daddd0 to
9d21ee3
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
.github/skills/vmr-codeflow-status/scripts/Get-CodeflowStatus.ps1:265
- Forward-flow lookup derives
$repoShortNameby stripping only thedotnet/prefix. If-Repositoryis ever used with a non-dotnet/*repo, this produces an invalid search string (e.g.,dotnet/otherOwner/repo). Consider deriving the repo name via($Repository -split '/',2)[1](or parsing owner/name once) so the search is robust and independent of the owner.
Write-Host " ✅ Open backflow PR #$($openBranches[$branchName]) exists" -ForegroundColor Green
$coveredCount++
| $branchVmrCommit = $null | ||
| $commitMsgVmrCommit = $null | ||
| $versionDetailsVmrCommit = $null | ||
|
|
||
| # First: check eng/Version.Details.xml on the PR branch (authoritative source) |
There was a problem hiding this comment.
Invoke-GitHubApi -Raw currently merges stderr into stdout (2>&1). If gh api emits non-fatal warnings on stderr, they can get mixed into $vdContent and break XML/regex parsing here. Consider changing Invoke-GitHubApi (or this callsite) to keep stderr separate for successful raw responses.
| # Get current branch HEAD (URL-encode branch name for path segments with /) | ||
| $encodedBranch = [uri]::EscapeDataString($vmrBranch) | ||
| $branchHead = Invoke-GitHubApi "/repos/$freshnessRepo/commits/$encodedBranch" | ||
| if ($branchHead) { |
There was a problem hiding this comment.
$vmrCommit.StartsWith($versionDetailsVmrCommit) is case-sensitive by default. Since earlier comparisons use OrdinalIgnoreCase, this can mislabel the snapshot source when the SHA casing differs. Use an explicit StringComparison.OrdinalIgnoreCase (or normalize SHAs) for consistent behavior.
|
|
||
| # --- Forward flow: check PRs from this repo into the VMR --- | ||
| $repoShortName = $Repository -replace '^dotnet/', '' | ||
| Write-Host "" | ||
| Write-Section "Forward flow PRs ($Repository → dotnet/dotnet)" |
There was a problem hiding this comment.
The forward-flow scan can trigger up to 50 per-PR gh pr view calls (each requesting comments). This can be slow and can hit GitHub API rate limits. Consider lowering the search limit and/or avoiding fetching full comment lists unless needed to keep -CheckMissing responsive.
| Write-Host " Branch: $branchName" -ForegroundColor White | ||
| Write-Host " ✅ Open backflow PR #$($openBranches[$branchName]) exists" -ForegroundColor Green | ||
| $coveredCount++ | ||
| } |
There was a problem hiding this comment.
PR description/title focus on Version.Details.xml snapshot fallback, but this hunk also adds a new forward-flow PR scan in -CheckMissing output. Please update the PR description to mention this additional behavior (or split it into a separate PR) so scope/intent are clear.
Follow-up to #124109.
When someone runs
darc vmr backflowmanually and pushes directly (as happened on dotnet/sdk#52727), the PR body metadata stays stale and commit messages don't use the parseableBackflow from ... / <sha>format. The script previously fell back to the stale PR body SHA, giving inaccurate freshness and fix tracing results.This promotes
eng/Version.Details.xml's<Source Sha=...>to the primary snapshot source — it's what the build actually uses and is always updated by any backflow operation. The file is parsed as XML (with regex fallback), and validated as a 40-character SHA.Snapshot priority
eng/Version.Details.xml<Source Sha="...">— ground truth (parsed as XML)Backflow from ... / <sha>— secondary / forward flow primaryBefore (dotnet/sdk#52727 with manual backflow)
After
Also handles
Tested against 5 codeflow PRs across dotnet/sdk, dotnet/roslyn, dotnet/aspnetcore, dotnet/runtime, and dotnet/sourcelink.