chamindac / vsts.release.task.download-artifacts

3 stars 1 forks source link

Issue when downloading artifact subfolders #11

Open cervengoc opened 7 years ago

cervengoc commented 7 years ago

We have a Release Definition containing a single Build artifact source. That build publishes an artifact named drop with the path to a network folder where the build result is. I'd like to use this task to download only two sub directories from this directory, so I'd try to configure the task like this

MyArtifactAlias\drop\A;MyArtifactAlias\drop\B

However, when the task wants to resolve the paths, it includes the drop term in it and the download fails because it cannot find the path as drop is not a sub directory but only a virtual name for the build result directory.

This is the returned JSON from the artifacts API call

GET https://myaccount.visualstudio.com/mycollection/_apis/build/builds/xxxxxx/artifacts?api-version=2.0

{"count":1,"value":[{"id":0,"name":"drop","resource":{"type":"FilePath","data":"\\\\a\\b\\c\\d\\Build.xxxxxxx","url":"xxxx","downloadUrl":"file://a/b/c/d/Build.xxxxxxx"}}]}

And this is the error

2017-08-30T07:44:06.3057916Z ##[error]System.Management.Automation.ItemNotFoundException: Cannot find path '\\a\b\c\d\Build.xxxxxxx\drop\A' because it does not exist.

However \\a\b\c\d\Build.xxxxxxx\A does exist and this should be used I guess..

I tried to use MyArtifactAlias\A;MyArtifactAlias\B for the task configuration but that didn't work either as it didn't download anything and failed silently because I guess it didn't find any artifact called A or B.

chamindac commented 7 years ago

@cervengoc Kindly let me know the TFS version you are using this on. Is it 2017 or 2015.2.1? This is since for 2015.2.1 the Download Artifacts (Deprecated) task should be used and for TFS 2017 or VSTS, Download Artifacts (New) should be used. I want to reproduce the issue in the same TFS version you are trying to get it fixed in the relevant task.

For the Download Artifacts (Deprecated) task the path should be specified without the artifact alias. example: drop\subdir1\subdir2

I will test with both the tasks with single build artifact and network share to check the issue on both TFS 2015.2.1 and TFS 2017.2 but would be able to fix it quickly if you could let me know the TFS version

cervengoc commented 7 years ago

Actually finding the exact version seems to be tricky. We have a VSTS subscription where we implicitly use TFS in some way but I have no idea how this process works. I have access only to the VSTS site we have, but there I couldn't find at first glance any versions or about page. Please give me some hints how I could find the exact version.

chamindac commented 7 years ago

@cervengoc if you are using VSTS then you should be using the Download Artifacts (New) task. Could you share me the log of the download task. And a screenshot of how parameters set? I would like to know how your build is making artifacts available as a file share? Could you send screenshots of build artifacts explorer and how your definition is set to publish the build artifacts, as well? my email is chandrasekara.chamindaATgmail.com

screaney commented 6 years ago

@chamindac I'm using the 2.0.2 version of the extension for TFS 2017 on prem, and I'm still seeing the spaces error. I have an artifact named "Dev East", experiencing the same issue, nothing downloads, no errors. 2.0.2 has the fix, right?