Fetch app.config from mirror repo at exact build commit during insertion#15737
Merged
nohwnd merged 9 commits intomicrosoft:mainfrom May 5, 2026
Merged
Fetch app.config from mirror repo at exact build commit during insertion#15737nohwnd merged 9 commits intomicrosoft:mainfrom
nohwnd merged 9 commits intomicrosoft:mainfrom
Conversation
- Change insertion source branch from rel/18.7 to main (parameter default + schedule trigger) - After roslyn-tools creates the insertion PR, push src/vstest.console/app.config to the PR branch at src/vset/Agile/TestPlatform/RocksteadyCLI/App.config in the VS repo - Parse PR ID from roslyn-tools output to target the correct branch - Auto-detect whether the file needs 'add' or 'edit' changeType - Gracefully skip if PR ID can't be extracted (e.g. no-change insertion) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Reorder regex: match /pullrequest/(\d+) URL first to avoid grabbing timestamps from PR titles - Remove the fallback 'Pull Request #N' pattern that was matching build numbers like 20260505100709 - Error out (exit 1) instead of warning when app.config push fails - Add rocket emoji to step display names - Set DOTNET_NOLOGO and DOTNET_SKIP_FIRST_TIME_EXPERIENCE Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
HEAD is not supported by AzDO items API, causing the check to always throw and default to 'add'. Switch to GET with $format=json and flip the logic: default to 'add', set 'edit' on success. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The file always exists in VS repo — we're overwriting it. The existence check was causing false negatives and using 'add' incorrectly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The pipeline always clones main, but ComponentBranchName can be rel/18.6, rel/18.7, etc. Fetch the file from GitHub raw so we push the correct branch's app.config to VS. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Parse the source commit SHA from roslyn-tools output (markdown link to sources URL), or fall back to resolving it from the build number via dnceng builds API. Fetch the file from the mirror repo instead of GitHub public or the checkout (which is always main). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Extract the dnceng build ID from the 'Updated Updating VS Test Platform from ... to ...' line and resolve the full 40-char commit SHA via builds API. Avoids relying on abbreviated 7-char SHA. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
drognanar
approved these changes
May 5, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes VS insertion behavior so the vstest.console/app.config pushed into the DevDiv insertion PR comes from the exact source commit used for the insertion build (instead of always reading from the pipeline checkout on main), preventing branch-mismatched binding redirects during rel/* insertions.
Changes:
- Parses
roslyn-toolsoutput to resolve the component source build (prefer build ID from the “Updated …” line; fallback to “Found … build number …”). - Uses the resolved build to determine the corresponding source commit SHA.
- Fetches
src/vstest.console/app.configfrom the mirror repo at that commit and pushes it into the VS insertion branch.
Comment on lines
+255
to
+256
| $itemUrl = "$dncengBase/_apis/git/repositories/$mirrorRepoId/items?path=$encodedPath&versionDescriptor.version=$sourceCommit&versionDescriptor.versionType=commit&api-version=7.1" | ||
| $appConfigContent = Invoke-RestMethod -Uri $itemUrl -Headers $dncengHeaders -Method Get |
This was referenced May 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.
The previous PR (#15736) reads app.config from the pipeline checkout directory, which is always main. This breaks rel/* insertions — they'd get main's binding redirects instead of the branch-specific ones.
This fix resolves the source commit from the roslyn-tools output (parses the build ID from the 'Updated' line), then fetches app.config from the mirror repo at that exact commit.
Tested on rel/18.7 → rel/insiders insertion (build 2967511) — pushed file content verified to match GitHub rel/18.7 source.