Migrate GetFileHash tasks to TaskEnvironment API#13111
Merged
JanProvaznik merged 3 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 GetFileHash task to use TaskEnvironment API
Migrate GetFileHash and VerifyFileHash tasks to TaskEnvironment API
Jan 26, 2026
Member
|
@copilot This is supposed to address only GetFileHash, revert the VerifyFileHash |
…kEnvironment API Co-authored-by: JanProvaznik <25267098+JanProvaznik@users.noreply.github.com>
Contributor
Author
JanProvaznik
approved these changes
Jan 26, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the GetFileHash task to use the new TaskEnvironment API for thread-safe path resolution, following the pattern established in PR #12914 for other file I/O tasks.
Changes:
- GetFileHash task now implements
IMultiThreadableTaskand usesTaskEnvironment.GetAbsolutePath()instead of relying on process-global current working directory - All GetFileHash unit tests updated to provide TaskEnvironment instances
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Tasks/FileIO/GetFileHash.cs | Added MSBuildMultiThreadableTask attribute, IMultiThreadableTask interface, TaskEnvironment property, and uses TaskEnvironment.GetAbsolutePath() for thread-safe file path resolution |
| src/Tasks.UnitTests/GetFileHash_Tests.cs | Updated all 5 test methods to set TaskEnvironment property using TaskEnvironmentHelper.CreateForTest() |
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.
[MSBuildMultiThreadableTask]attributeIMultiThreadableTaskinterfaceTaskEnvironmentpropertyTaskEnvironment.GetAbsolutePath()for file path resolutionNote: VerifyFileHash changes reverted per reviewer feedback - only GetFileHash migration is included in this PR.
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.