Teamcity automerge cannot find destination branch

925 Views Asked by At

I'm trying to set up automated merge of changes for a teamcity build. TeamCity Professional 9.1.6 (build 37459)

I want all the changes in branches release/* to be merged into the following branch:

develop-automerge

VCS root specification:

Default branch

master

Branch specification

+:(develop)
+:(feature/*)
+:(bugfix/*)
+:(hotfix/*)
+:(release/*)

Automatic merge:

Watch builds in branches

+:release/(*)

Merge into branch

develop-automerge

I'm getting the error:

Automatic merge failed: Cannot find destination branch to merge into: no VCS branch maps to the 'develop-automerge' logical branch name according to the VCS root branch specification

I have also tried including develop-automerge in branch specification:

Branch specification

+:(develop-automerge)
+:(develop)
+:(feature/*)
+:(bugfix/*)
+:(hotfix/*)
+:(release/*)

The branch develop-automerge exists, and there are builds of this branch.

Getting the same error message after the builds in release/*

What's wrong with this setup?

2

There are 2 best solutions below

3
On

The branch specifications look like they're missing the git refs/heads path, try this:

+:refs/heads/(develop-automerge)
+:refs/heads/(develop)
+:refs/heads/(feature/*)
+:refs/heads/(bugfix/*)
+:refs/heads/(hotfix/*)
+:refs/heads/(release/*)

Also default branch should probably be

refs/heads/master instead of master

The logical branch name of develop-automerge looks OK, as it should match the logical part of the branch spec.

1
On

The target auto-merge branch should be built in the same build configuration, so you need to include the target branch into the branch specification and the branch should be present in VCS. This might be changed in the future TeamCity versions.