2

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?

Cœur
  • 37,241
  • 25
  • 195
  • 267
George Polevoy
  • 7,450
  • 3
  • 36
  • 61

2 Answers2

1

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.

SteveChapman
  • 3,051
  • 1
  • 22
  • 37
  • Can you elaborate on the refs/heads requirement, how is it relevant to the problem stated? – George Polevoy Mar 02 '16 at 16:50
  • 1
    Thinking being that the logical branch name of `develop-automerge` was not being evaluated due to the branch specs not matching the actual branch name in git (with refs/heads/). I've not seen branch specs without before; and the documentation certainly leans towards including the full path. – SteveChapman Mar 02 '16 at 16:58
  • Worked for me. But i haven't changed master to refs/heads/master – Evgeny Gorbovoy May 06 '20 at 14:00
-1

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.

Yaegor
  • 1,771
  • 9
  • 12
  • 1
    I tried including the target branch in branch specification as reflected in the original answer. The branch actually exists in VCS (Git), and i can see the builds of this branch. – George Polevoy Mar 02 '16 at 11:37