Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Constantin07 opened this issue Nov 16, 2023 · 6 comments
Labels

Comments

@Constantin07
Copy link

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
@arturcic
Copy link
Member

@Constantin07 in version 6.x that is still in beta, we made some configuration changes, one of them was to rename the tag to label
#3315

@Constantin07
Copy link
Author

Thanks for details @arturcic .

@EmilAlipiev
Copy link

what is the last decision here? when I use "tag" instead "label" it doesnt fail, but when I use "continuous-delivery-fallback-tag" instead of "continuous-delivery-fallback-label", it fails. It seems like that it was merged into 5.12.0 version. Can you please update the documentation as well? it is pretty confusing

@EmilAlipiev
Copy link

and this is also giving error as "System.Runtime.Serialization.SerializationException: Property 'continuous-delivery-fallback-label' not found on type 'GitVersion.Model.Configuration.BranchConfig'."

What is the latest stand here v5.12.0?

@JDCain
Copy link

JDCain commented Jul 22, 2024

It does not seem that all of the props were updated as if I change tag-prefix to label-prefix I get the error: 'Property 'label-prefix' not found on type 'GitVersion.Configuration.

@asbjornu
Copy link
Member

asbjornu commented Aug 3, 2024

@JDCain: The word tag in tag-prefix refers to a git tag, not to the "prelease tag" or "prelease label" in a Semantic Version number. You can read about the discussion and conclusion to rename "prerelease tag" to label in #1054 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants