Skip to content

[Bug] Incrementing steps does not occur when I expect them #2285

Closed
@Tiraflo

Description

@Tiraflo

Dear all,

First of all, I would like to apologize if the following description comes from a misunderstanding.

Describe the bug

  1. Using the below yml configuration (with the continuous deployment mode), no increment is applied after tagging when tag has format "M.m.p-ciCommitsSinceVersionSourcePadded" (this behaviour suits my needs but I don't want to take advantage of it if this really a bug).
    image

  2. If I add a bump message (excepted the major bump message) or/and a next-version value in the configuration file, it's not applied (+semver: patch in the below image).
    image
    next-version: 1.2.1

Expected Behavior

  1. Since the HighestTagBaseVersionStrategy strategy is used, ShouldIncrement is true and I expect that GitVersion returns 1.3.0-ci0001 (because increment: Minor for the master branch).

  2. At least, I would expect next-version to be prior to the increment field (or somehow it overrides it) so that the next GitVersion output would be 1.2.1-ci0001.
    Does GitVersion select the highest tag among all the strategies ?

Actual Behavior

  1. GitVersion returns 1.2.0-ci0002 (it's fine for me because I would like automated tagging from the build server but I'm a bit puzzled).

  2. GitVersion returns 1.3.0-ci0001.

Steps to Reproduce

  • Create a Git repo (git init) without any particular flow (only one branch master). All of this can be done locally without remote.
  • Use the below GitVersion.yml file
  • Create dummy commits and simulate the automated tagging behaviour (use the NuGetVersionV2 output when simulating a successful build)
  • (Optional) Simulate some human decisions by creating release tags (format "M.m.p")
  • See an example in section Environment

Context

We are a small team of three persons working on a railway simulator using Unity3D.
Because Unity introduced packages (npm-like) recently, we think it's time to have a modular approach to ease maintenance and progress. Going a bit further, thoses packages will use .Net Standard libraries (assemblies) for multiple reasons: cross-platform, decoupling logic from UI (graphical engine) and so on...
Based on this vision and on our small number (each one almost responsible for a dedicated task during a given period), I consider that using the centralized Git flow (a single branch, the most basic one) is still applicable for most cases (for now).

Because GitVersion is popular and still maintained regarding MSBuild (from my short experience, many MSBuild tasks projects are not maintained anymore and do not work properly those days ; therefore I'm planning to use Nuke but I like thinking in a standard way as well for fallback purposes).

As a result, I'm trying to find out a proper GitVersion strategy/configuration for a centralized workflow.
I wish to use a build server in a way that successful builds would lead to a new tag. Is this approach still valuable today? What else could I do to get a similar result?
So far, in my opinion, documentation gives freedom to interpretation regarding the way GitVersion should handle the build number coming from a build server (and that's pretty normal).

From my perspective, section Incrementing per commit and its linked blog post are the most valuable info for people looking for automated continuous building (whatever it's continuous integration/delivery/deployment). That's why I chose the continuous deployment mode even if we will only do continuous integration for starters (as result, I get the impression mode names are not appropriate and a mode is not picked up according to the adopted continuous approach)

Environment

Windows 10
GitVersion.Portable v5.3.4
GitVersion.yml:

#next-version: 1.1.1
mode: ContinuousDeployment
branches: 
  master:
    regex: ^master
    increment: Minor
ignore:
  sha: []
merge-message-formats: {}

Test project history (local Git repo):
image
Tags with format "M.m.p-ciCommitsSinceVersionSourcePadded" would be tags automatically created by the build server in case of success while building (& testing). It uses the NugetVersionV2 GitVersion output.
Tags with format "M.m.p" are tags manually created (corresponding to actual releases).

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