Skip to content

[ISSUE]: TrackReleaseBranches strategy not using version-in-branch-pattern #4947

@FrodeAtSea

Description

@FrodeAtSea

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

GitVersion package

GitVersion.Tool

GitVersion version

6.7.0+Branch.main.Sha.00e59b5f45fe97e2e610a480a860b3a009db9602

Operating system

Windows

What are you seeing?

Using the following configuration

workflow: GitFlow/v1
semantic-version-format: Loose
strategies:
  - TrackReleaseBranches
branches:
  main:
    increment: None
    tracks-release-branches: true

in a repo where release/1.0 branch has been merged to main GitVersion reports MajorMinorPatch as 1.0.0

If I remove semantic-version-format: Loose I get the error "No base versions determined on the current branch."

If I then change the branch name to release/1.0.0 GitVersion reports MajorMinorPatch as 1.0.0 again.

What is expected?

That version-in-branch-pattern: "(?<version>[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*" is used to determine the version number from the merged branch. I.e. second and third number are optional.

semantic-version-format doesn't make any sense for this strategy.

Steps to Reproduce

Create a repo with main, create branch develop, create branch release/1.0 merge branch release/1.0 to main.

RepositoryFixture Test

No response

Output log or link to your CI build (if appropriate).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions