Re-triggering on "Unable to collect changes"

We're using Git as the VCS backend and we are verifying commits before merging them into master. This is done by TeamCity's commit status publisher plugin and VCS trigger polling refs/open-reviews/*. Mostly this works fine but sometimes there is some issue with Git-server and the build fails to start either because of 

1. "Unable to collect changes" or

2. "Collecting changes" timeouts.

In these cases commit status publisher plugin does not send any information about the build, at least not to the Gerrit we are using. This is probably because the build does actually start. 

Since these two problems are issues which are not related to commit being tested, I would like to make TeamCity just retry build in case one of these errors occurs. However, I could not find a way to make this happen. Is there any way to retry build when specific problem occurs? I know about Retry-trigger but I don't want that builds which fail for example in running unit tests are retried. Currently we are on TeamCity 2017.2.1 but we will update to latest soon. 

0
1 comment

Hi,

our Retry Build Trigger is thought for this kind of scenarios, but if you only want it under some other conditions, you would need to add a manual check. This can be done in two ways:

-Set up the Retry Build Trigger, then add a first build step that checks on the last build of the same configuration, check its status and decide upon it
-Don't set up a Retry Build Trigger. Instead, set up a build with a snapshot dependency on your chain. It runs even on fail, verifies the last build status and if required, triggers a new build via the REST API.

0

Please sign in to leave a comment.