Closed lukx closed 7 years ago
Hi
what configuration are you running the Task on? (On Prem, Online, what TFS version). I tested these things with Visual Studio Team Services.
If you use the "Current Team Project" it will try to fetch the URL via this environment variable as described here (https://www.visualstudio.com/en-us/docs/build/define/variables see BUILD_REPOSITORY_URI). As I understand it those variables should automatically be set on your build agent...
You could try to use the "Custom Team Project" and specifiy the url yourselve and see if that works as a first workaround.
Please let me know if this works, otherwise I can try to look deeper into it.
Thanks for your feedback :-)
We are using Online VSTS along with a hosted agent, so whatever Microsoft gives us... I think I see the difference - we have configured the Build step as a part of our release build, where the predefined variables differ (https://www.visualstudio.com/en-us/docs/build/concepts/definitions/release/variables)
We tried to configure it into a build step in VSTS. There, $($tfsServer)
resolves as
https://our-account.visualstudio.com/our-project/_git/our-repo/our-project
so "our-project" (which I chose as a pseudonym) is there twice, yielding a 404 (and adjacent errors). I am suspecting, https://github.com/huserben/TfsExtensions/blob/master/BuildTasks/triggerbuildtask/triggerbuild.ps1#L28 might be unsuitable for VSTS setups, in addition to using the variable that's only available during a Build.
$(System.TeamFoundationCollectionUri) is available in both contexts, maybe that's helpful?
I'll try to find out whether I can somehow help develop the PS1-Script in our VSTS environment
Hi
I wasn't aware that the variables differ depending on the configuration, but then it makes sense. I will have a look at it as soon as I can, but that will probably not happen before the weekend...
Feel free to check out the code and make adjustements yourselve if you feel like it.
Did you as well try specifying the url by hand as part of the "Basic Configuration"?
Thanks, yes we did try that - looks like $(System.TeamFoundationCollectionUri)$(System.TeamProject)
is the correct path at our environment. I could reproduce the API calls from the script manually, too.
Now we get a JSON Parse error, that "." is not a valid json primitive, but that's beyond this ticket, I believe.
Hi
ok, I will try to change that as soon as possible. For the further issues you could maybe send the same request on your local machine, e.g. via a tool like Postman (https://www.getpostman.com/) to the exact same url + with the same authorization and check the return value yourselve. I assume something is wrong either with the URL or the credentials, which will cause the request to be redirected and you will get back HTML rather than the JSON we expect.
Hi
I made the change so that the script uses System.TeamFoundationCollectionUri
now.
The Task was updated and is uploaded to the Marektplace.
Could you please quickly check if it now works and let me know?
Thanks!
The Uri work as expected, you can close this issue now.
Hey In our Visual Studio Team Services build chain, we have chosen the
Trigger Build
-Buildstep to run our integration tests after a successful release, because we appreciated the straightforwardness of its configuration. We are running it as the last step of our Release configuration. However, the variable BUILD_REPOSITORY_URI does not get resolved, and we are out of ideas as to why that might be. Full log is adjacent, but I suspect the rest to be follow-up errors. Could you tell us what we're doing wrong, please? Thanks