0
votes

VSTS build task is getting cancelled in free subscription due to 30 minute fixed build time. I need to display a console message to the user if he is using the vsts free subscription. Is there an API to get this information? Is possible to get this info through vso-node-api library?

1
Don't find the way to get timeout through vso-node-api. Just find jobTimeoutInMinutes member in BuildDefinition (visualstudio.com/en-us/docs/integrate/extensions/reference/…) - starian chen-MSFT
JobTimeoutInMinutes is set to 60 by default in the free subscription, but it get cancelled in 30 minutes when executing the build. Ill try to get the value from build contracts and update you. - Bandara
Yes, I get 60 too. Seems not a related API to get that timeout. - starian chen-MSFT
Yep, I also got the same. - Bandara

1 Answers

0
votes

No, there isn't any API to get this information. As an alternative way, you can display a warning message to remind the user when they use Hosted Pool for the build.

You can use VSTS Node API to get the pool name of the build:

let buildid: number = 1;
let projectname: string = "Project";
let build: bi.Build = await vstsBI.getBuild(buildid, projectname);
console.log(build.queue.name);

For the buildid and project, get it from the build environment variable.