Skip to content

[Bug] Getting 'Property 'tag' not found on type 'GitVersion.Configuration.BranchConfiguration'.' when using version 6.0.0 #3789

@Constantin07

Description

@Constantin07

Describe the bug
It works fine with gittools/gitversion:5.12.0-alpine.3.14-6.0 docker image.
It fails with the gittools/gitversion:6.0.0-alpine.3.17-6.0 docker image.
Same GitVersion.yml config file.

Expected Behavior

It should work with newer version too.

Actual Behavior

Getting error:

[Pipeline] dir
Running in /var/lib/jenkins/workspace/kubernetes/hello-kubernetes/deploy/pipelines/kubernetes/hello-kubernetes/deploy
[Pipeline] {
[Pipeline] sh
+ /tools/dotnet-gitversion /output buildserver
INFO [11/16/23 21:54:24:28] Working directory: /var/lib/jenkins/workspace/kubernetes/hello-kubernetes/deploy/pipelines/kubernetes/hello-kubernetes/deploy
INFO [11/16/23 21:54:24:29] Project root is: /var/lib/jenkins/workspace/kubernetes/hello-kubernetes/deploy/
INFO [11/16/23 21:54:24:29] DotGit directory is: /var/lib/jenkins/workspace/kubernetes/hello-kubernetes/deploy/.git
INFO [11/16/23 21:54:24:29] Branch from build environment: master
INFO [11/16/23 21:54:24:29] Begin: Normalizing git directory for branch 'master'
  INFO [11/16/23 21:54:24:36] One remote found (origin -> '[email protected]:Constantin07/simple-k8s-app.git').
  INFO [11/16/23 21:54:24:36] Skipping fetching, if GitVersion does not calculate your version as expected you might need to allow fetching or use dynamic repositories
  INFO [11/16/23 21:54:24:37] Updating local branch master to match ref master
  INFO [11/16/23 21:54:24:45] Skipping update of 'refs/remotes/origin/dependabot/github_actions/dot-github/workflows/actions/checkout-4' as it already matches the remote ref.
  INFO [11/16/23 21:54:24:45] Creating local branch from remote tracking 'refs/remotes/origin/develop'.
  INFO [11/16/23 21:54:24:48] HEAD points at branch 'refs/heads/master'.
  INFO [11/16/23 21:54:24:48] End: Normalizing git directory for branch 'master' (Took: 193.24ms)
  INFO [11/16/23 21:54:24:50] Begin: Loading version variables from disk cache
    INFO [11/16/23 21:54:24:50] Cache file /var/lib/jenkins/workspace/kubernetes/hello-kubernetes/deploy/.git/gitversion_cache/145D863E76F6AEED62C7AAED94AE527532A1A905.yml not found.
  INFO [11/16/23 21:54:24:50] End: Loading version variables from disk cache (Took: 0.75ms)
  INFO [11/16/23 21:54:24:50] Using latest commit on specified branch
  WARN [11/16/23 21:54:25:01] An error occurred:
Could not build the configuration instance because following exception occurred: 'Property 'tag' not found on type 'GitVersion.Configuration.BranchConfiguration'.' Please ensure that the /overrideconfig parameters are correct and the configuration file is in the correct format.
INFO [11/16/23 21:54:24:14] Applicable build agent found: 'Jenkins'.
INFO [11/16/23 21:54:24:28] Working directory: /var/lib/jenkins/workspace/kubernetes/hello-kubernetes/deploy/pipelines/kubernetes/hello-kubernetes/deploy
INFO [11/16/23 21:54:24:29] Project root is: /var/lib/jenkins/workspace/kubernetes/hello-kubernetes/deploy/
INFO [11/16/23 21:54:24:29] DotGit directory is: /var/lib/jenkins/workspace/kubernetes/hello-kubernetes/deploy/.git
INFO [11/16/23 21:54:24:29] Branch from build environment: master
INFO [11/16/23 21:54:24:29] Begin: Normalizing git directory for branch 'master'
  INFO [11/16/23 21:54:24:36] One remote found (origin -> '[email protected]:Constantin07/simple-k8s-app.git').
  INFO [11/16/23 21:54:24:36] Skipping fetching, if GitVersion does not calculate your version as expected you might need to allow fetching or use dynamic repositories
  INFO [11/16/23 21:54:24:37] Updating local branch master to match ref master
  INFO [11/16/23 21:54:24:45] Skipping update of 'refs/remotes/origin/dependabot/github_actions/dot-github/workflows/actions/checkout-4' as it already matches the remote ref.
  INFO [11/16/23 21:54:24:45] Creating local branch from remote tracking 'refs/remotes/origin/develop'.
  INFO [11/16/23 21:54:24:48] HEAD points at branch 'refs/heads/master'.
  INFO [11/16/23 21:54:24:48] End: Normalizing git directory for branch 'master' (Took: 193.24ms)
  INFO [11/16/23 21:54:24:50] Begin: Loading version variables from disk cache
    INFO [11/16/23 21:54:24:50] Cache file /var/lib/jenkins/workspace/kubernetes/hello-kubernetes/deploy/.git/gitversion_cache/145D863E76F6AEED62C7AAED94AE527532A1A905.yml not found.
  INFO [11/16/23 21:54:24:50] End: Loading version variables from disk cache (Took: 0.75ms)
  INFO [11/16/23 21:54:24:50] Using latest commit on specified branch
  WARN [11/16/23 21:54:25:01] An error occurred:
Could not build the configuration instance because following exception occurred: 'Property 'tag' not found on type 'GitVersion.Configuration.BranchConfiguration'.' Please ensure that the /overrideconfig parameters are correct and the configuration file is in the correct format.
  INFO [11/16/23 21:54:25:06] Done writing 

Possible Fix

Have no idea.

Steps to Reproduce

Config file used:

---
mode: Mainline
increment: Patch
major-version-bump-message: '\+semver:\s?(breaking|major)'
minor-version-bump-message: '\+semver:\s?(feature|minor)'
patch-version-bump-message: '\+semver:\s?(fix|patch)'
continuous-delivery-fallback-tag: ''
branches:
  master:
    tag: ''
  develop:
    tag: ''
ignore:
  sha: []
merge-message-formats: {}

Jenkins pipeline stage snippet:

    stage('Get version') {
      agent {
        docker {
          image 'gittools/gitversion:6.0.0-alpine.3.17-6.0'
          args "--entrypoint="
        }
      }
      steps {
        dir(env.DIRECTORY) {
          sh '/tools/dotnet-gitversion /output buildserver'
          script {
            def props = readProperties file: 'gitversion.properties'
            version = props.GitVersion_SemVer
            println "Version: $version"
            currentBuild.description = version
          }
        }
      }
    }
$ git tag
0.0.1
0.0.2
0.0.3
0.0.4
0.0.5
0.0.6
0.0.7
0.1.0
0.1.2

$ git branch -a
  develop
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/develop
  remotes/origin/master

Context

Broken pipeline as it cannot generate versions anymore.

Your Environment

Jenkins CI. All requirements are met from https://gitversion.net/docs/reference/build-servers/jenkins.

  • Version Used: 6.0.0-alpine.3.17-6.0
  • Operating System and version: Ubuntu 22.04.3 LTS

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions