Closed thoemmi closed 6 years ago
Hi @thoemmi
yes it seems that it for some reason cannot figure out the id of the build. I'll put it on my todo list that I will fail the task when this happens and have a better logging around this.
Now the question is why this happens, looking the code there is actually a check when we try to get the build id for the name:
if (result.count === 0) {
throw new Error(`Did not find any build definition with this name: ${buildDefinitionName}
- checked following url: ${options.baseUrl}${requestUrl}`);
}
apparently this is still ok but then
return result.value[0].id;
returns undefined...
Could you try to query your TFS in a browser and post the resulting JSON. The url would be (given your demo data) like this: https://thoemmi.visualstudio.com/DefaultCollection/Demo/_apsi/build/definitions?api-version=2.0&name=EchoBuild
Hello @huserben, I've identified the issue: In the secondary build definition, EchoBuild, an empty agent queue was configured. Because of this no build can be queued automatically. If I queue a build manually, I have to change the agent queue. I changed the build definition to use a working agent queue, and your build task was able to queue a new build. So no issue on your side 😉
I don't close this issue now because I don't know if you want to keep it open as a reference, in case you plan to improve the error handling.
Hi
alright cool, good to know and probably something to put into the documentation at least :-) I will keep it open for reference and maybe I can even figure out this situation and fail if this is the case.
Anyway thanks for reporting this and helping on improve the Task.
I started my own implementation a couple of weeks ago, until I stumbled over your task recently. It's more feature-rich than mine, so I dropped my attempt. Thanks for sharing your awesome task :+1:
Thanks for the nice words 👍
I looked at the problem with the empty agent queue and added a general error handling which is checked after we triggered the build. There is a general validation concept and I will fail the Task if there are any validation errors:
The messages I display I take directly from the response I get from TFS (see here an example viewed in Postman):
This generic approach has the advantage that we can generally handle problems that might arise when triggering the build, however the error message provided might not be so specific.
I will check this change during this week. Thanks again for your help in identifying the issue.
Hi
I just updated the Task to version 2.2 which adds the proper validation output.
I tried the Trigger Build task (v2.1) with my VSTS repository. Unfortunately, it does not trigger a build. In the log of the task you see this line
Queued new Build for definition EchoBuild: https://thoemmi.visualstudio.com/Demo/_build/index?buildId=undefined
. To me it looks like the task is not able to determine the id of the build definition "EchoBuild".Here's the complete log of the task with
system.debug="true"
. Is there any other information I can provide you with to narrow it down?