Do not trigger build on check-in comment

Answered

I want TeamCity to ignore a VCS check-in event if the check-in comment contains the string '#tcignore#' - I have the following VCS trigger rule set on my build configuration: -:comment=#tcignore#:** but this doesn't seem to be working because TeamCity goes ahead and starts the build anyway. Is there something wrong with my command or are there any other trigger rules that I should be enabling/disabling?

7 comments

Hi James,

 

The configured VCS trigger rule looks correct, I've tested it and it works for me as expected. 

What TeamCity version do you use? Could you please attach screenshot of the configured VCS trigger, and also screenshots illustrating the issue.

0

Hi, I am using 9.1.7. Here is a screenshot of my VCS trigger page:

Note I have two rules to see if the '#' character was affecting the trigger. Here is an example of a build that ran:

For example this build had only a documentation change, so my colleague did not want the full integration tests to run so he added the #tcignore# string to his check-in comment, but the build still ran anyway?

0

Are you sure that this build was triggered by VCS trigger? Does this build configuration have any dependencies configured or any configuration depends on it? 

Please open the build overview page and check "Triggered by" section.

Also you can attach teamcity-vcs.log file and write the build number that was triggered incorrectly, so we will investigate the case.

0

Ok so I have checked the 'Triggered by' and it seems this build was triggered by one of it's dependent builds? Could you clarify for me why this might be happening? I have 3 build configurations defined in my project and I have them set up like this:

 

Customer deployment --> Windows 7 Integration --> Windows 10 Integration

Here's how I have my dependency set up, is this wrong?

 

Windows 7 Integration:

Windows 10 Integration:

0

Hi James,

You have the following build chain:

                                         Win 7 Integration

                                      /

Customer deployment 

                                      \

                                         Win 10 Integration

In this case, e.g. if the build Win7 Integration is triggered, all builds up the chain are also triggered. It means that Customer deployment + Win7 builds will be added to the queue. For more details, please see the article.

Is it what you want to achieve? 

0

Thanks for explaining - what I want is customer deployment to only ever be triggered by a VCS check-in, that does not have the #tcignore# comment, I then want the integration builds to run (actually it doesn't matter which is first, they both have a shared resource defined so only one can run at a time anyway). The integration builds should only run on a completed successful build of the 'Customer Deployment' build configuration.

I'm still not sure I understand why a build of Win 7 or Win 10 Integration could trigger a build of customer deployment? I am assuming the build chain is uni-directional, i.e. Customer Deployment can trigger builds of Win 7 or 10 but a build of Win 7 or 10 cannot trigger a build of customer deployment, yet in my example that seems to be what has happened?

0

If you have the following build chain (A2 snapshot depends on An and so on):

If a build of A1 is triggered, the whole build chain A1...AN is added to the build queue, but not vice versa! - if build An is triggered, it doesn't affect anyhow the build chain, only An is run.

Builds run sequentially starting from AN to A1. Build A(k-1) won't start until build Ak finishes successfully.

In you case, you can configure one VCS trigger with trigger rules in 'Customer Deployment' build configuration and configure Finish build triggers in Win7/10 configurations to trigger them after successful completion of 'Customer Deployment'. 

However in this case if you manually trigger Win7 or Win10, still the whole chain will be added to the queue. When Win7/10 starts it should be sure that all builds up the chain has run on the same sources snapshot, in other words that there is the suitable 'Customer Deployment' build.

0

Please sign in to leave a comment.