Closed heaths closed 5 years ago
Looking at the VSTest@2 task source, they use a multiline input type with corresponding code at https://github.com/Microsoft/azure-pipelines-tasks/blob/c35d1e72b74fa72316e3fa35d71a4fad05ce43f2/Tasks/VsTestV2/distributedtest.ts#L101-L115 that seems to support a wider grammar for minimatch patterns than globbing, which is its own benefit but also introduces consistency with built-in tasks.
I don't imagine this would be a breaking change unless globbing and lstat have some slight nuances, but maybe a new major version of the task would be in order? Willing to contribute if you're interested.
Hey @heaths, first of all thank you for the feedback.
I've never used multi-line folders 😞, code implementation from this repository use glob
specification only for a string line and convert all files found into an array.
I used another implementation in my digitalocean-tools-vsts
that is almost equal to this example of yours, but I never tested either. would be great to implement it here:
Code implementation used in digitalocean-tools-vsts
I would be very grateful if you could contribute, since I use semantic-release
, it would be easy to bump major version for this one.
I hope to get to this later today. Any problem with just using the same pattern as other built-in tasks? Consistency improves productivity and reduces errors. Since you document that the tasks supports minimatch patterns, I imagine - as I did - devs would assume it's the same pattern they can use with built-in tasks.
PS: I mistakenly pointed out the wrong reference source earlier. Digging in deeper, I see that built-in tasks use https://github.com/Microsoft/azure-pipelines-task-lib/blob/master/node/task.ts#L1412, which does rely on the minimatch library (as does glob) buts adds a bit more processing.
No problem @heaths, thank you so much for the PR.
I'll release it into our development channel stage to check it out and then make it to production ok.
Tested migrating an release task using 0.5.0 to 1.0.0 and the multiLine new type and worked like a charm.
Thank you again.
Bug Report
Describe the bug When using multiple minimatch patterns like most other tasks, no assets are uploaded. E.g.
To Reproduce
Define a YAML build def with task like the one above, such that minimatch patterns should discover multiple artifacts.
Repo: https://github.com/heaths/caffeine Build: https://dev.azure.com/heaths/public/_build/results?buildId=100&view=logs
Expected behavior All files matching all minimatch patterns should be used. Ideally, the input control for the task is higher as well, or the documentation for the field at least clarifies that only one line works, but that is certainly not ideal since you'd need multiple tasks to upload multiple artifacts with different patterns.
Enviroment