-
Notifications
You must be signed in to change notification settings - Fork 660
Closed
Description
Describe the bug
Since Version 5.6.10 i got the System.FormatException: Input string was not in a correct format
Expected Behavior
GitVersion should calculate the latest semantic Version
Actual Behavior
GitVersion failed to calculate the lastest semantic Version
Steps to Reproduce
The following log shows the error occuring on Version 5.6.10
PS C:\BuildAgent\work\c2e5e5910737ba6b> GitVersion /version
5.6.10+Branch.main.Sha.e9013533474e8e46b6a0ca60d20d02f3680b5980
PS C:\BuildAgent\work\c2e5e5910737ba6b> GitVersion
INFO [06/14/21 8:28:19:66] Working directory: C:\BuildAgent\work\c2e5e5910737ba6b
INFO [06/14/21 8:28:19:70] Project root is: C:\BuildAgent\work\c2e5e5910737ba6b\
INFO [06/14/21 8:28:19:70] DotGit directory is: C:\BuildAgent\work\c2e5e5910737ba6b\.git
INFO [06/14/21 8:28:19:75] Begin: Loading version variables from disk cache
INFO [06/14/21 8:28:19:75] Cache file C:\BuildAgent\work\c2e5e5910737ba6b\.git\gitversion_cache\69AA262C88
9E401EDD585A9F8AAB8638F6A1831D.yml not found.
INFO [06/14/21 8:28:19:75] End: Loading version variables from disk cache (Took: 0.96ms)
INFO [06/14/21 8:28:19:86] Using latest commit on specified branch
INFO [06/14/21 8:28:20:03] Running against branch: develop (a4323f8 Add parameter MailAttachmentPattern by resultrepor
ting)
INFO [06/14/21 8:28:20:04] Begin: Calculating base versions
INFO [06/14/21 8:28:20:23] Fallback base version: 0.1.0 with commit count source 40f4d69b2f1b2bf7187aef41573a1739e18
2a743
INFO [06/14/21 8:28:20:36] Found commit [a4323f8 Add parameter MailAttachmentPattern by resultreporting] matching me
rge message format: Default
INFO [06/14/21 8:28:20:40] Found commit [a4323f8 Add parameter MailAttachmentPattern by resultreporting] matching me
rge message format: Default
INFO [06/14/21 8:28:20:40] Found commit [a4323f8 Add parameter MailAttachmentPattern by resultreporting] matching me
rge message format: Default
INFO [06/14/21 8:28:20:40] Found commit [a4323f8 Add parameter MailAttachmentPattern by resultreporting] matching me
rge message format: Default
INFO [06/14/21 8:28:20:40] Found commit [a4323f8 Add parameter MailAttachmentPattern by resultreporting] matching me
rge message format: Default
INFO [06/14/21 8:28:20:40] Merge message 'Merge branch 'release/2.1144'': 2.1144.0 with commit count source 56cbe7b6
298753f869871be27f3529dc902acbaf
INFO [06/14/21 8:28:20:40] Merge message 'Merge branch 'release/2.1137'': 2.1137.0 with commit count source 959167c6
53c2eff2c2f97696b38a6bb7e8c260a4
INFO [06/14/21 8:28:20:40] Merge message 'Merge branch 'release/2.1136'': 2.1136.0 with commit count source 6ade6d49
8733e71723e7b0639eb13f658aa70258
INFO [06/14/21 8:28:20:40] Merge message 'Merge branch 'release/2.1135'': 2.1135.0 with commit count source 62ed6a26
311c330f28363314cd1ed15253e476a6
INFO [06/14/21 8:28:20:40] Merge message 'Merge branch 'release/2.1135' into develop': 2.1135.0 with commit count so
urce 38bf9866d80f7e2c40c2937f0e95ecba07824ffe
INFO [06/14/21 8:28:20:42] End: Calculating base versions (Took: 380.47ms)
ERROR [06/14/21 8:28:20:42] An unexpected error occurred:
System.FormatException: Input string was not in a correct format.
at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)
at System.Number.ParseInt32(ReadOnlySpan`1 value, NumberStyles styles, NumberFormatInfo info)
at System.Int32.Parse(String s)
at GitVersion.SemanticVersion.TryParse(String version, String tagPrefixRegex, SemanticVersion& semanticVersion)
at GitVersion.RepositoryStore.GetValidVersionTags(String tagPrefixRegex, Nullable`1 olderThan)
at GitVersion.VersionCalculation.TaggedCommitVersionStrategy.GetTaggedVersions(IBranch currentBranch, Nullable`1 olde
rThan)
at GitVersion.VersionCalculation.TaggedCommitVersionStrategy.GetVersions()
at GitVersion.VersionCalculation.BaseVersionCalculator.GetBaseVersions(IVersionStrategy strategy)+MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at GitVersion.VersionCalculation.BaseVersionCalculator.GetBaseVersion()
at GitVersion.VersionCalculation.NextVersionCalculator.FindVersion()
at GitVersion.GitVersionCalculateTool.CalculateVersionVariables()
at GitVersion.GitVersionExecutor.RunGitVersionTool(GitVersionOptions gitVersionOptions)
INFO [06/14/21 8:28:20:42] Attempting to show the current git graph (please include in issue):
INFO [06/14/21 8:28:20:42] Showing max of 100 commits
INFO [06/14/21 8:28:20:64] * a4323f8 3 days ago (HEAD -> develop, origin/develop)
* d1545db 4 weeks ago
* 5642f28 4 weeks ago
* 6d1a065 4 weeks ago
* 017f020 5 weeks ago
* 4d44202 8 weeks ago
|\
| * cb84e5c 12 months ago
| * 85369d6 1 year ago
* | 70da666 9 weeks ago
* | 3b01e55 9 weeks ago
* | a3f7395 9 weeks ago
* | fc24b7b 10 weeks ago (tag: build-2.1147.1-ci.18, origin/master, master)
* | 328a907 3 months ago
* | 1f70254 3 months ago
* | f30ead4 3 months ago
* | 15d1cbf 3 months ago
* | d66c3a4 3 months ago
* | cb0d316 3 months ago
* | 8adb448 3 months ago
* | fc97f76 3 months ago
* | ee7ad2b 3 months ago
|\ \
| * | 72b6d61 3 months ago
* | | d0b3d26 3 months ago
|\ \ \
| * | | d377232 3 months ago
* | | | 6cbf0b1 3 months ago
|\ \ \ \
| | |/ /
| |/| |
| * | | 65f1391 3 months ago
* | | | 9cfa3dc 3 months ago
|\ \ \ \
| |/ / /
|/| | |
| * | | dcc720f 3 months ago
| |\ \ \
| | |/ /
| |/| |
| | * | 3b899b7 3 months ago (tag: build-2.1147.0, tag: 2.1147)
| | |\ \
| | |/ /
| |/| |
* | | | 9b7dbe3 3 months ago
|/ / /
* | | 2f08d5b 4 months ago (tag: build-2.1146.1-ci.36)
|\ \ \
| * | | 34b27f1 4 months ago
* | | | edca010 4 months ago
|\ \ \ \
| |/ / /
| * | | 07dee6c 4 months ago
* | | | fa533be 4 months ago
|\ \ \ \
| |/ / /
|/| | |
| * | | ad816cf 4 months ago
* | | | 76f4b91 4 months ago
* | | | f588d97 4 months ago
* | | | 1fd8636 4 months ago
* | | | cba5356 4 months ago (tag: build-2.1146.1-ci.27)
* | | | e00cd4a 4 months ago
|/ / /
* | | 9283069 4 months ago (tag: build-2.1146.1-ci.25)
* | | 99b0fc2 4 months ago
* | | 74984a1 4 months ago
|\ \ \
| * \ \ b0e7726 4 months ago (tag: build-2.1146.1-ci.21)
| |\ \ \
| | |/ /
| | * | 56cbe7b 4 months ago (tag: build-2.1144.0, tag: 2.1144)
| | |\ \
| | |/ /
| |/| |
* | | | 407cf3f 4 months ago
|/ / /
* | | 2db3db1 4 months ago (tag: build-2.1143.1-ci.29)
* | | 2dab18f 4 months ago (tag: build-2.1143.1-ci.28)
* | | 163f96b 4 months ago
* | | dc24e64 4 months ago (tag: build-2.1143.1-ci.26)
|/ /
* | c01bdfb 7 months ago (tag: build-2.1143.1-ci.25)
* | cf39afe 7 months ago
* | c9c86c1 7 months ago
* | 0aec0a6 7 months ago
* | 49835fd 7 months ago
* | b909e49 7 months ago
* | 3320c0a 8 months ago
* | c13e7bc 8 months ago
* | 2f75005 8 months ago
* | 425634c 8 months ago
* | 72974f1 9 months ago
|\ \
| * | a3428e0 9 months ago
* | | 2923d4e 9 months ago
|\ \ \
| |/ /
| * | 5118d00 9 months ago
* | | 0e5fb1a 10 months ago (tag: build-2.1143.1-ci.11)
* | | b987c53 11 months ago (tag: build-2.1143.1-ci.10, tag: 2.1146)
* | | d98f26d 11 months ago
|\ \ \
| * | | d0b41ce 11 months ago
* | | | 6af0fb0 11 months ago
* | | | 27677bd 11 months ago
|/ / /
* | | 099d4ec 12 months ago
* | | 21ff233 12 months ago
* | | ad6cb1f 1 year ago (tag: 2.1145)
| |/
|/|
* | 61814fb 1 year, 1 month ago
* | f4841dc 1 year, 1 month ago
* | ca55d7c 1 year, 1 month ago (tag: 2.1143)
|\ \
| |/
| * 1fc4c92 1 year, 1 month ago
| * 39547b0 1 year, 1 month ago
| * 1913b50 1 year, 1 month ago
| * ea19980 1 year, 1 month ago
| * e99da54 1 year, 2 months ago (tag: build-2.1142.0, tag: 2.1142)
| |\
| * | cb8fc95 1 year, 2 months ago (tag: build-2.1141.1-ci.1)
| * | fde4e2c 1 year, 2 months ago (tag: build-2.1140.1-ci.17, tag: 2.1141)
| * | 47496d3 1 year, 2 months ago (tag: build-2.1140.1-ci.16)
| * | 5a71685 1 year, 2 months ago
| |\ \
| * \ \ 28c6261 1 year, 2 months ago (tag: build-2.1140.1-ci.7)
| |\ \ \
| * | | | c7ae8c3 1 year, 3 months ago
| * | | | 556ffe0 1 year, 3 months ago (tag: 2.1140)
| |\ \ \ \
| * | | | | f87bbb2 1 year, 3 months ago (tag: build-2.1138.1-ci.22)
| * | | | | b956880 1 year, 3 months ago (tag: build-2.1138.1-ci.21)
* | | | | | f2bc554 1 year, 2 months ago
* | | | | | 7f00d58 1 year, 2 months ago
* | | | | | ec151e1 1 year, 2 months ago
| |_|_|_|/
|/| | | |
* | | | | d198d84 1 year, 2 months ago
| |_|_|/
|/| | |
* | | | 86aabe6 1 year, 2 months ago
|\ \ \ \
| * | | | f3ceed3 1 year, 3 months ago
| | |/ /
| |/| |
* | | | 89d64a4 1 year, 3 months ago
|\ \ \ \
| | |_|/
| |/| |
| * | | d67063a 1 year, 3 months ago
| * | | b22000d 1 year, 3 months ago
After i downgraded GitVersion to Version 5.6.9 with chocolatey the error does not happend anymore.
For now i need to stick to Version 5.6.9 to get my build finished.
PS C:\BuildAgent\work\c2e5e5910737ba6b> choco install gitversion.portable --version 5.6.9 --allow-downgrade
Chocolatey v0.10.8
Installing the following packages:
gitversion.portable
By installing you accept licenses for the packages.
Progress: Downloading GitVersion.Portable 5.6.9... 100%
GitVersion.Portable v5.6.9 [Approved]
gitversion.portable package files install completed. Performing other installation steps.
The package GitVersion.Portable wants to run 'chocolateyInstall.ps1'.
Note: If you don't run this script, the installation will fail.
Note: To confirm automatically next time, use '-y' or consider:
choco feature enable -n allowGlobalConfirmation
Do you want to run the script?([Y]es/[N]o/[P]rint): y
Added C:\ProgramData\chocolatey\bin\gv.exe shim pointed to '..\lib\gitversion.portable\tools\gitversion.exe'.
ShimGen has successfully created a shim for gitversion.exe
The install of gitversion.portable was successful.
Software install location not explicitly set, could be in package or
default install location if installer.
Chocolatey installed 1/1 packages.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
PS C:\BuildAgent\work\c2e5e5910737ba6b> GitVersion /version
5.6.9+Branch.main.Sha.ecf7f70a3d2fc18be561baeaff4eac1d930f8781
PS C:\BuildAgent\work\c2e5e5910737ba6b> GitVersion
{
"Major": 2,
"Minor": 1148,
"Patch": 0,
"PreReleaseTag": "alpha.29",
"PreReleaseTagWithDash": "-alpha.29",
"PreReleaseLabel": "alpha",
"PreReleaseLabelWithDash": "-alpha",
"PreReleaseNumber": 29,
"WeightedPreReleaseNumber": 29,
"BuildMetaData": null,
"BuildMetaDataPadded": "",
"FullBuildMetaData": "Branch.develop.Sha.a4323f8dfc3283f0dc2797808a2fa7ab4a7f815e",
"MajorMinorPatch": "2.1148.0",
"SemVer": "2.1148.0-alpha.29",
"LegacySemVer": "2.1148.0-alpha29",
"LegacySemVerPadded": "2.1148.0-alpha0029",
"AssemblySemVer": "2.1148.0.29",
"AssemblySemFileVer": "2.1148.0.0",
"FullSemVer": "2.1148.0-alpha.29",
"InformationalVersion": "2.1148.0-alpha.29+Branch.develop.Sha.a4323f8dfc3283f0dc2797808a2fa7ab4a7f815e",
"BranchName": "develop",
"EscapedBranchName": "develop",
"Sha": "a4323f8dfc3283f0dc2797808a2fa7ab4a7f815e",
"ShortSha": "a4323f8",
"NuGetVersionV2": "2.1148.0-alpha0029",
"NuGetVersion": "2.1148.0-alpha0029",
"NuGetPreReleaseTagV2": "alpha0029",
"NuGetPreReleaseTag": "alpha0029",
"VersionSourceSha": "3b899b7758e0faa694b2d0e295e122adc43090ed",
"CommitsSinceVersionSource": 29,
"CommitsSinceVersionSourcePadded": "0029",
"UncommittedChanges": 0,
"CommitDate": "2021-06-11"
}
-->
Context
Calculating semantic Version for .net project on a Buildserer
Your Environment
GitVersion.portable installed via chocolatey on Windows Server 2012 R2 / Windows Server 2016 / Windows Server 2019 / latest WIndows 10
- Version Used:
- GitVersion 5.6.10
- Windows Server 2012 R2 / Windows Server 2016 / Windows Server 2019 / latest Windows 10
boexler