Migrate VerifyFileHash task to TaskEnvironment API#13112
Merged
JanProvaznik merged 2 commits intomainfrom Jan 29, 2026
Merged
Conversation
Contributor
|
Hello @@copilot, I noticed that you’re changing an .swr file or any file under src/Package/MSBuild.VSSetup.. Please make sure to validate this change by an experimental VS insertion. This is accomplished by pushing to an exp/* branch, which requires write permissions to this repo. |
Co-authored-by: JanProvaznik <25267098+JanProvaznik@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Migrate VerifyFileHash task to use TaskEnvironment API
Migrate VerifyFileHash task to TaskEnvironment API
Jan 26, 2026
JanProvaznik
approved these changes
Jan 26, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the VerifyFileHash task to use the TaskEnvironment API for thread-safe path resolution, enabling safe parallel execution in multithreaded MSBuild builds. This follows the same migration pattern established in PR #12914 for other file I/O tasks.
Changes:
- Adds
[MSBuildMultiThreadableTask]attribute andIMultiThreadableTaskinterface toVerifyFileHashtask - Replaces process-global path resolution (
Path.GetFullPath()via rawFilestring) with thread-safeTaskEnvironment.GetAbsolutePath() - Updates all 5 test methods to provide
TaskEnvironmentviaTaskEnvironmentHelper.CreateForTest()
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Tasks/FileIO/VerifyFileHash.cs | Adds multithreading support via TaskEnvironment API for thread-safe path resolution, enabling safe parallel execution |
| src/Tasks.UnitTests/VerifyFileHash_Tests.cs | Updates all test methods to provide TaskEnvironment instance required by the migrated task |
Member
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Context
Migrates
VerifyFileHashto useTaskEnvironment.GetAbsolutePath()for thread-safe path resolution, following the pattern from #12914. This enables safe parallel execution by avoiding process-global state (Path.GetFullPath()relies on CWD).Changes Made
[MSBuildMultiThreadableTask]attribute andIMultiThreadableTaskinterfaceTaskEnvironmentpropertyTaskEnvironment.GetAbsolutePath(File)instead of rawFilestringfilePath.OriginalValuein error messages to preserve user-provided pathsTaskEnvironmentHelper.CreateForTest()Testing
VerifyFileHashunit tests passNotes
Follows the same pattern as Copy, Delete, MakeDir, RemoveDir, Touch tasks from #12914.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.