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

ServiceFabricUpdateManifests Task always fails to find the ApplicationManifest.xml #5736

Closed
jcleavel opened this issue Oct 30, 2017 · 6 comments

Comments

@jcleavel
Copy link

jcleavel commented Oct 30, 2017

The new version of the VSTS ServiceFabricUpdateManifests task can never find the ApplicationManifest.xml file when trying to compare the current build to a previous build's artifacts.

The issue appears to be here:
The previous build's artifacts are downloaded into a folder in the $(Agent.WorkFolder)\tmp\ directory:
Ex. C:\agent\_work\tmp\

https://github.com/Microsoft/vsts-tasks/blob/a641ccf39643408c33fcd288dd1e371dc3981fcf/Tasks/ServiceFabricUpdateManifests/Get-VstsBuild.psm1#L63

Whereas, the next step attempts to compare this directory to the new build's by trimming characters from the previous build artifact's directory path equal to the length of the path for $(Build.SourcesDirectory).
Ex.

$(Build.SourcesDirectory)            => C:\agent\_work\1\s
Previous Build Artifact Directory => C:\agent\_work\tmp\applicationpackage

!!TRIM!!

Result => \applicationpackage

You can see this operation here:
https://github.com/Microsoft/vsts-tasks/blob/2c02c93bb7899f53d2b07a8487a13ccb4f776010/Tasks/ServiceFabricUpdateManifests/Update-ApplicationVersions.psm1#L59

This will always cause failures because the relative paths will never compare correctly.

@kuvinodms
Copy link

Hi Nathan,
I can see that Jason Ricke has updated the related code in PR #5287 which is causing this issue. Please have a look at it and update.

@NCarlsonMSFT
Copy link
Member

The task is working for my own builds. I think you are experiencing the same issue as in #5592

The issue we found in that case is that the task always assumes the $(build.artifactstagingdirectory) folder will be published as the artifact and can't handle a sub-folder. Are you publishing some other folder as your artifact?

FYI: I am planning a fix around the bad path assumption, but I won't be able to get it out for a few weeks.

@jcleavel
Copy link
Author

jcleavel commented Nov 8, 2017

Yeah, that's definitely the issue.

I'm not really in any hurry for a fix, to be honest. Based on the new "Download Build Artifacts" task that is in preview, it looks like you folks are starting to move in the direction of encouraging selective download of build artifacts.

I like the way that my builds are setup currently, so I can wait a few weeks for a more durable fix.

@bishal-pdMSFT
Copy link
Contributor

FYI: I am planning a fix around the bad path assumption, but I won't be able to get it out for a few weeks.

@NCarlsonMSFT , is this among your next planned items?

@NCarlsonMSFT
Copy link
Member

Yes, this is currently on my plate.

@jcleavel
Copy link
Author

Awesome, thanks folks!

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

No branches or pull requests

5 participants