Skip to content

Fetch app.config from mirror repo at exact build commit during insertion#15737

Merged
nohwnd merged 9 commits intomicrosoft:mainfrom
nohwnd:insert-into-rocksteady
May 5, 2026
Merged

Fetch app.config from mirror repo at exact build commit during insertion#15737
nohwnd merged 9 commits intomicrosoft:mainfrom
nohwnd:insert-into-rocksteady

Conversation

@nohwnd
Copy link
Copy Markdown
Member

@nohwnd nohwnd commented May 5, 2026

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.

nohwnd and others added 8 commits May 5, 2026 11:02
- 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>
Copilot AI review requested due to automatic review settings May 5, 2026 14:05
@nohwnd nohwnd enabled auto-merge (squash) May 5, 2026 14:07
@nohwnd nohwnd merged commit 64cb8a0 into microsoft:main May 5, 2026
2 checks passed
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 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-tools output 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.config from 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants