Repository navigation
Migrate AzureRepos.Git.GetSourceLinkUrl to multithreaded task model - #1732
Merged
ViktorHofer merged 3 commits intoJul 3, 2026
Merged
Conversation
Add the MSBuild multithreadable task marker and IMultiThreadableTask support so GetSourceLinkUrl can receive a TaskEnvironment. Route the BUILD_REPOSITORY_URL_MAP lookup through TaskEnvironment.GetEnvironmentVariable, preserving fallback process-environment behavior for direct unit-test construction. Call-chain audit: grep found TryGetEnvironmentUriMap only at its private declaration in GetSourceLinkUrl.cs, so it is currently uncalled dead code and no new behavioral unit test was added. The file has no direct Environment.*, Directory.GetCurrentDirectory, or Path.GetFullPath usage remaining. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Contributor
Author
|
Automated MT review (MT-migration reviewer + expert code review): both approved, no blocking issues. The only nit raised — dropping the |
JanProvaznik
approved these changes
Jun 30, 2026
tmat
requested changes
Jun 30, 2026
tmat
left a comment
Member
There was a problem hiding this comment.
TryGetEnvironmentUriMap is unused. You can delete it.
Per @tmat, the private TryGetEnvironmentUriMap method was dead code (no callers; pre-existing, gated behind a "confirm design" TODO for dotnet#2). Deleting it removes the task's only TaskEnvironment consumer, so this migration is now attribute-only: keep [MSBuildMultiThreadableTask] and drop the unused IMultiThreadableTask interface, the TaskEnvironment property, the now-unused UrlMapEnvironmentVariableName const, and the usings only that method needed (System.Collections.Generic, System.IO, System.Linq). The base GetSourceLinkUrlGitTask performs no environment/file/process operations, so no TaskEnvironment plumbing is required. Co-authored-by: Copilot <[email protected]>
Contributor
Author
|
Thanks, done @tmat ! |
tmat
approved these changes
Jul 1, 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.
Summary
[MSBuildMultiThreadableTask]toMicrosoft.SourceLink.AzureRepos.Git.GetSourceLinkUrl.IMultiThreadableTaskwithTaskEnvironment.Fallbackso direct unit-test construction preserves current behavior.BUILD_REPOSITORY_URL_MAP*lookup inTryGetEnvironmentUriMap()withTaskEnvironment.GetEnvironmentVariable(...)for MT-safe environment access.Audit
grep -rn "TryGetEnvironmentUriMap" src/only finds the private method declaration insrc/SourceLink.AzureRepos.Git/GetSourceLinkUrl.cs; it is currently uncalled dead code with an existing TODO. Because there is no active behavior to exercise, no new behavioral unit test was added.Environment.*,Directory.GetCurrentDirectory, orPath.GetFullPathusage remains in this file.TaskEnvironment.Fallbackreads the process environment.References dotnet/msbuild#14093.
Validation
./build.sh --restore --buildPATH="$PWD/.dotnet:$PATH" dotnet test src/SourceLink.AzureRepos.Git.UnitTests/Microsoft.SourceLink.AzureRepos.Git.UnitTests.csproj -f net11.0 --no-restore