Skip to content

track-merge-target in branch config not working #1789

Closed
@rose-a

Description

@rose-a

I'm trying to create a GitVersion config for GitLab Flow.

In GitLab Flow master is effectively the development branch and the production branch resembles master in Git Flow.

Since GitLab allows the automatic creation of issue branches from within its GUI (branch name starting with the GitLab issue number), I created a new branch type for them borrowing the feature branch config.

The resulting config looks like this:

mode: ContinuousDeployment
branches:
  master:   
    tag: alpha
    regex: ^master$
    increment: Minor
    prevent-increment-of-merged-branch-version: false
    track-merge-target: true
    tracks-release-branches: true
    is-release-branch: false
    is-mainline: false
    source-branches: []
  production:
    tag: ''
    increment: Patch
    prevent-increment-of-merged-branch-version: true
    track-merge-target: false
    regex: ^production$
    source-branches:
    - master
    - develop
    - release
    tracks-release-branches: false
    is-release-branch: false
    is-mainline: true
  issue:
    tag: issue-{BranchName}
    increment: Inherit
    prevent-increment-of-merged-branch-version: false
    regex: ^(?=\d+-)
    source-branches:
    - master
    - develop
    - feature
    - hotfix
    - support
    - issue
    - production
ignore:
  sha: []

The one thing which is currently not working is track-merge-target: true on the master branch config, which, according to the docs should do the following:

track-merge-target

Strategy which will look for tagged merge commits directly off the current branch. For example develop → release/1.0.0 → merge into master and tag 1.0.0. The tag is not on develop, but develop should be version 1.0.0 now.

So with the provided config I would expect master → merge into production and tag 1.0.0 to result in master incrementing to 1.1.0 on the next commit.

Do I understand the intention of the track-merge-target setting correctly?

PS: Trying to understand the behaviour from the source code I stumbled upon the following:

grafik

So basically the setting is read but never used! Is this feature actually implemented?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions