Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Porting logic of handling negative patterns for DownloadBuildArtifacts and DownloadPipelineArtifacts tasks #3664

Merged
merged 5 commits into from
Dec 22, 2021

Conversation

denis-tikhomirov
Copy link
Contributor

Ported logic of pre-handling minimatch patterns from azure-pipelines-task-lib (PS version / TS version).
The logic allows to handle negative minimatch patterns correctly.
Also reporting of excluded items was moved from GetFilteredItems to GetArtifactItems.

Checked cases:

  • download all (like **)
  • download all (like **) except 1or 2 file (like !**/file.1.nupkg)
  • download all (like **) except group of files (like !**/file.*.nupkg)
  • download all (like **) except directory (like !**/folder1/**)
  • download directory (like **/folder1/**) except 1 file (like !**/folder1/file.1.nupkg)
  • download group files (like **/file.*.nupkg) except 1 file (like !**/file.1.nupkg)
  • download all (like **) except directory (like !**/folder1/**) but with downloading 1 file from the directory (like !!**/folder1/file.1.nupkg)
  • using of whitespaces in start and end of pattern
  • using of sharp (#) in pattern
  • using of empty pattern
  • using of pattern without asterisks (full path to file in artifact)

Checklist:

  • There’s no risky dependency updates

    • Corrected function is used by 2 tasks. And both these tasks work correctly with the changes.
  • Changes has been tested

    • Yes. The changes are tested by 22 cases (2 affected tasks, 11 cases for each task) by build in prepared pipeline. Also test with 7 cases was added in these PR to cover corrected function.
  • Enough test coverage for changes, and current test coverage for task doesn't look poor

    • Yes, test with 7 cases was added in these PR to cover corrected function. Most cases of using the function are covered.
  • We understand how tasks is working, how changes affect task behavior

    • Yes. The changes allow to collect list of files which should be downloaded from artifact. Previously all files are downloaded.
  • There is no breaking changes

    • No breaking changes.
  • There is no any other concerns

    • No concerns. Corrected function is used by 2 tasks. And both these tasks work correctly with the changes.
  • I have not discovered any new uncovered test/use cases

    • Yes, I don't uncovered test/use cases for corrected function.

@denis-tikhomirov denis-tikhomirov requested a review from a team December 15, 2021 12:24
@denis-tikhomirov denis-tikhomirov self-assigned this Dec 15, 2021
@EzzhevNikita EzzhevNikita requested a review from a team December 15, 2021 13:51
@denis-tikhomirov denis-tikhomirov merged commit 7ea0203 into master Dec 22, 2021
@denis-tikhomirov denis-tikhomirov changed the title Porting logic of handling negative patterns for DownloadBuildArtifacts task Porting logic of handling negative patterns for DownloadBuildArtifacts and DownloadPipelineArtifacts tasks Jan 28, 2022
@dpaquette
Copy link
Contributor

It appears that this is a breaking change when using DownloadBuildArtifact.

We did not have a Matching Pattern specified. After the pipeline agent updated to 2.198.2, this caused all files from our artifact to be excluded.
image

Changing the Matching Pattern to ** resolved the issue for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants