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] GitVersion not incrementing anymore #2467

Closed
KenBonny opened this issue Nov 25, 2020 · 8 comments
Closed

[Bug] GitVersion not incrementing anymore #2467

KenBonny opened this issue Nov 25, 2020 · 8 comments
Labels

Comments

@KenBonny
Copy link

KenBonny commented Nov 25, 2020

Describe the bug
My predecessor set up the GitVersion so I'm not entirely familiar with what he did. I have used it successfully in the past, but today when I checked a change in, it reset to version 4.0.0 (that is configured in the GitVersion.yml file). I don't know if I did something wrong (I haven't changed the setup in any way).

Expected Behavior

After my merge with my new code, I added +semver:patch to increment the patch version from 4.0.26 to 4.0.27.

Actual Behavior

The versioning reset to 4.0.0. When I add +semver:patch or +semver:minor, I still get the version 4.0.0. When I tag my feature branch with a tag 4.0.27 or v4.0.27, I again get version 4.0.0. When I use branches named feature/blabla-4.0.27 or plain release/4.0.27, I again get version 4.0.0.

Steps to Reproduce

No idea, I have not changed the setup of GitVersion. It's worked fine before today.

Context

Your Environment

I'm running this on Azure DevOps. This is the content of the GitVersion.yml file:

assembly-versioning-scheme: MajorMinorPatch
mode: Mainline
next-version: 4.0.27
branches: {}
ignore:
  sha: []
merge-message-formats: {}

This is the output of the step:

Telemetry

The .NET tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.

Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry


Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
Learn about HTTPS: https://aka.ms/dotnet-https

Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli

You can invoke the tool using the following command: dotnet-gitversion
Tool 'gitversion.tool' (version '5.5.1') was successfully installed.
Caching tool: GitVersion.Tool 5.5.1 x64
Prepending PATH environment variable with directory: C:\hostedtoolcache\windows\GitVersion.Tool\5.5.1\x64
C:\hostedtoolcache\windows\GitVersion.Tool\5.5.1\x64\dotnet-gitversion.exe D:/a/1/s /output buildserver /nofetch
INFO [11/25/20 10:52:10:36] Working directory: D:/a/1/s
INFO [11/25/20 10:52:10:46] Branch from build environment: refs/heads/master
INFO [11/25/20 10:52:10:46] Project root is: D:\a\1\s
INFO [11/25/20 10:52:10:46] DotGit directory is: D:\a\1\s.git
INFO [11/25/20 10:52:10:46] Begin: Normalizing git directory for branch 'refs/heads/master'
INFO [11/25/20 10:52:10:52] One remote found (origin -> 'git repo origin redacted').
INFO [11/25/20 10:52:10:53] Skipping fetching, if GitVersion does not calculate your version as expected you might need to allow fetching or use dynamic repositories
INFO [11/25/20 10:52:10:54] Creating local branch refs/heads/master
INFO [11/25/20 10:52:10:59] Creating local branch from remote tracking 'refs/remotes/origin/b380d763ffd68450a84968c9cd4656c993412f26'.
INFO [11/25/20 10:52:10:63] HEAD points at branch 'refs/heads/master'.
INFO [11/25/20 10:52:10:63] End: Normalizing git directory for branch 'refs/heads/master' (Took: 163.75ms)
INFO [11/25/20 10:52:10:68] Begin: Loading version variables from disk cache
INFO [11/25/20 10:52:10:68] Cache file D:\a\1\s.git\gitversion_cache\54AAF4CFFFC4ED4F7AE59AB20B16C29AC45D11A8.yml not found.
INFO [11/25/20 10:52:10:68] End: Loading version variables from disk cache (Took: 1.24ms)
INFO [11/25/20 10:52:10:95] Using latest commit on specified branch
INFO [11/25/20 10:52:11:04] Running against branch: master (b380d763ffd68450a84968c9cd4656c993412f26)
INFO [11/25/20 10:52:11:04] Begin: Calculating base versions
INFO [11/25/20 10:52:11:08] NextVersion in GitVersion configuration file: 4.0.0 with commit count source External Source
INFO [11/25/20 10:52:11:25] Base version used: NextVersion in GitVersion configuration file: 4.0.0 with commit count source ad7ee20610481c6f31fbcef0d62c025bfa0aec4d
INFO [11/25/20 10:52:11:25] End: Calculating base versions (Took: 211.01ms)
INFO [11/25/20 10:52:11:25] Begin: Using mainline development mode to calculate current version
INFO [11/25/20 10:52:11:26] Found possible mainline branches: master
INFO [11/25/20 10:52:11:26] Mainline for current branch is master
INFO [11/25/20 10:52:11:27] 40 commits found between ad7ee20610481c6f31fbcef0d62c025bfa0aec4d and b380d763ffd68450a84968c9cd4656c993412f26
INFO [11/25/20 10:52:11:27] End: Using mainline development mode to calculate current version (Took: 17.07ms)
INFO [11/25/20 10:52:11:28] Begin: Creating dictionary
INFO [11/25/20 10:52:11:29] End: Creating dictionary (Took: 17.12ms)
INFO [11/25/20 10:52:11:30] Begin: Storing version variables to cache file D:\a\1\s.git\gitversion_cache\54AAF4CFFFC4ED4F7AE59AB20B16C29AC45D11A8.yml
INFO [11/25/20 10:52:11:36] End: Storing version variables to cache file D:\a\1\s.git\gitversion_cache\54AAF4CFFFC4ED4F7AE59AB20B16C29AC45D11A8.yml (Took: 52.89ms)
Executing GenerateSetVersionMessage for 'AzurePipelines'.
Executing GenerateBuildLogOutput for 'AzurePipelines'.
INFO [11/25/20 10:52:11:40] Done writing
Async Command Start: Update Build Number
Update build number to 4.0.0 for build 1006
Async Command End: Update Build Number
Finishing: UseGitVersion

@KenBonny KenBonny added the bug label Nov 25, 2020
@asbjornu
Copy link
Member

This is a duplicate of #2441. A solution is to remove next-version and use git tag instead.

@KenBonny
Copy link
Author

Thanks for the quick reply. You can close this bug then. I had searched high and low for this, but I could not find a solution. Got stack overflow answers and bugs from 2016 and 2017, but nothing from a month ago. :)

@asbjornu
Copy link
Member

I would appreciate if you could confirm that replacing next-version with a git tag solves the problem. If it does, please close.

@KenBonny
Copy link
Author

I have removed next-version and first I created a branch release/4.0.28. (I released 4.0.27 with the next-version syntax). This has reset my versioning to 0.3.2.

Then I added a tag v4.0.28 and now my version is 0.3.3.

@asbjornu
Copy link
Member

Where did you add the tag v4.0.28?

@KenBonny
Copy link
Author

On the branch where I performed the update. The rough order of git commands was:

  • checkout -b feature/update-version
  • git add *
  • git commit ...
  • git tag v4.0.28
  • git push

Then I merged in Azure DevOps and it started the build.

@asbjornu
Copy link
Member

Can you try adding the git tag on a prior commit on the master (or main) branch?

@KenBonny
Copy link
Author

Yes, that fixed it. Thank you so much!

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

2 participants