Finish Build Trigger only triggered by builds in the default branch
Hello,
I've seen many posts around this topic. Unfortunately, none of them seem to address the issue I have.
Take BCA (Build Config A) and BCB (Build Config B), for example.
BCA's default branch is ‘develop’, but it also has ‘staging’ and ‘master’ branches being built in TeamCity.
BCB's default and only branch is ‘master’. BCB is a test config that should run after successful BCA builds.
I have the following trigger on BCB:
Finish Build Trigger. Wait for a successful build in: BCA. Branch filter: +:develop, +:staging, +:master.
Note: branch filters above are all specified in new lines as expected. I used commas and spaces here for simplicity only.
BCB builds trigger successfully and as expected when BCA builds complete successfully on BCA's develop (default) branch.
However, no BCB build is triggered when BCA builds complete successfully on BCA's staging/master (non-default) branches.
What am I missing here?
I would like BCB builds to trigger for BCA builds that complete successfully on staging and master branches as well, as we are expected to run those tests against BCA builds in those branches too.
Please sign in to leave a comment.
Please take a look at the limitations of Finish Build Triggers. It looks like they apply to your configuration and scenario: https://www.jetbrains.com/help/teamcity/2024.03/configuring-finish-build-trigger.html#Triggering+Settings.
It seems like configuring Snapshot Dependency appropriately may suit your requirements: https://www.jetbrains.com/help/teamcity/2024.03/snapshot-dependencies.html.
Please let me know if you have additional questions.
Best regards,
Anton
Hi Anton, thanks for your reply!
I've read that page extensively. None of those limitations are a potential problem to me, and they don't explain the behavior I detailed. If I'm wrong, could you please point to the exact limitation that may be coming into effect in my use case?
Plus I don't believe Snapshot Dependencies suit my case.
Correct me if I'm wrong but, given my scenario, snapshot dependencies would do one of the following:
None of this is what I want. BCB is a test configuration for BCA. BCB needs to trigger after every successful BCA build.
Furthermore, BCA has VCS triggers that start a new build every time a developer pushes changes to the repo it tracks.
So, I don't want BCB builds running ahead of BCA builds, because what good is to run tests before your test target is built? And I want BCB builds to trigger automatically, for the finished BCA builds. I don't want to trigger BCB manually, and having that trigger yet another BCA build that would have no changes in it when compared to the last one triggered by VCS changes.
Cheers.
The snapshot dependencies queue the builds at the same time, and runs the build with dependency after the dependent build is finished and is guaranteed to use the same revision as the dependent build. So from my understanding, setting the snapshot dependency on BCB to be dependent on BCA and triggering BCB is what you need. It will run tests in BCB after the BCA is finished. If my understanding of your scenario is correct, then snapshot dependency is a recommended way to configure it.
Best regards,
Anton
Hey Anton,
Just to clarify, BCA and BCB do not have the same VCS root. They do not track the same repository.
BCA tracks our product-code GitHub repository. BCB tracks our testing-code GitHub repository.
We don't need BCA and BCB having the same revision, since they build (BCA) and execute (BCB) different code-bases.
Our the desired workflow is the following:
This is what I am trying to achieve with a Finish Build Trigger in BCB that tracks BCA builds.
The whole process is supposed to be automated and run on its own: Devs push changes > BCA builds product (via VCS trigger) > BCB runs tests (via Finish Build Trigger). My team is not expected to queue any builds manually, be they BCA or BCB.
With snapshot dependencies, we would have to trigger BCB builds manually, and the BCA build they would queue to run before them is entirely unnecessary, because they wouldn't have any new changes when compared to the last BCA build that ran via VCS trigger.
In summary, snapshot dependencies would not make our build/test process to run automatically (as we need it to be), and they would queue unnecessary builds, thus significantly increasing our build/test time. Our use case is really for Finish Build Trigger, rather than Snapshot Dependencies.
Cheers.
Sorry for the wait. OK, I assumed that both BCA and BCB monitor the same VCS root; in this case, it would be only logical to implement snapshot dependency.
In your case, you mentioned that BCA's VCS has ‘develop’, ‘staging’, and ‘master’ branches, and you also specify the branch filter for the finish build trigger to monitor these branches. Could you confirm what will happen if you make the finish build trigger's branch filter to monitor all branches (i.e., +:*)? Specifying the branch filter in your finish build trigger seems excessive, as you already build only ‘develop’, ‘staging’ and ‘master’ branches of BCA.
Best regards,
Anton