Prevent triggering builds for branches with no changes
Our team has been dealing with agents being overloaded recently and I've identified one of the issues being that branches that are created via JIRA or Bitbucket without changes are triggering builds. We have two build configurations for each project, a Feature and a Versioned build. The Feature build builds for every non-release branch and the Versioned build builds the release branches and publishes artifacts.
Although TeamCity seems to do the work of checking if there have been changes, it only does it per build configuration. This makes sense in most cases, but it causes a problem for us. If someone branches off of master but master hasn't been built with the Feature configuration for a while (usually a manual build to test changes to the configuration), then it sees all the changes since the last time it was built and determines that it does need to be built.
Our workflow maintains a linear history, so each of these master commits has definitely been built by the Feature configuration, but it seems to only associate the master tag with the commit that it pointed to the last time master was built rather than the current location of master. Is there any way to change that? We were hopeful that the "Exclude default branch changes from other branches" and/or "Allow builds in the default branch" options would help, but that doesn't seem to be the case. Any thoughts?
Please sign in to leave a comment.
Hi Braden,
Your assumption on TeamCity is correct, we keep track of the branches and not the commits per se. If a commit is rebased into master, then it usually won't be built in master (as it correctly identifies it was built in another branch), but master will notice that there are pending changes for it that it hasn't built. Also, new branches will track all those changes as pending as well, for the reason you have mentioned.
Exclude default branch changes from other branches should help here, what is not working with it exactly?