TrimbleSolutionsCorporation / TeamcityTriggerHook

Bitbucket Plugin to Trigger Builds in Teamcity
GNU Lesser General Public License v3.0
14 stars 15 forks source link

Add support for cancelation of builds with snapshot dependencies #78

Closed arnaudmathias closed 3 years ago

arnaudmathias commented 3 years ago

In the current state, the plugin assumes that if a target build in the queue, it will always run the latest revision and will not try to cancel it.

This is not always the case for builds with snapshot dependency. Based on the teamcity configuration, a snapshot dependencies can enforce the revision of a queued build if one of the dependencies has already started

For example: Triggering a build A with a snapshot dependency B configured with "Enforce revisions synchronization". As soon as B leave the queue, it will enforce the revision on the build A, if the VCS root is the same for both builds

The plugin now will ensure the revision of the target build is correct before skipping it and will cancel any non reused dependencies.

jmecosta commented 3 years ago

thanks for this, quick question. now by default for each push for example on a Pull request the hook will send several more rest requests to teamcity to find the dependencies right? if this is the case, we have some network constraints and our infra will start bothering us why we are sending more http requests from the application... Can this be a opt in option? We don't really use dependencies so the extra requests just slows us down

arnaudmathias commented 3 years ago

If the target build doesn't have any dependencies, it will be one more request to TeamCity. But I understand the network constraints, I will make the cancel of dependencies an opt-in option

jmecosta commented 3 years ago

release https://marketplace.atlassian.com/manage/apps/1215178/versions/300000280/details

thanks for this pull request