fix to stop removing instances of the artifact name that occur within the FileContainerItem path (issue: azure-pipelines-tasks#16522) #5226
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
For an artifact with name dist, the FileContainerProvider will strip away subdirectories that contain the artifact name in the path
For example:
dist\myapp\config.json
dist\myapp\en-us
dist\myapp\en-us\dist
dist\myapp\en-us\dist\assets
dist\myapp\en-us\dist\assets\feedback\readme.txt
The result of the copy is that it removes the nested folder called dist and we end with a file structure like below. Notice the “assets" directory is now directly under en-us instead of nested in the dist directory:
myapp\config.json
myapp\en-us
myapp\en-us\assets
myapp\en-us\assets\feedback\readme.txt
Addresses the issue reported in:
Download pipeline artifact breaks folder structure when downloading pipeline artifact, reopened #12682
Download pipeline artifact breaks folder structure when downloading pipeline artifact
Description
This code change corrects the behavior to only remove the starting directory name instead of replacing all instances of artifact name in the path.
Risk Assessment (Low / Medium / High)
Low: targeted fix to correct artifact name removal
Unit Tests Added or Updated (Yes / No)
No
Additional Testing Performed
No