Skip to content

Changed label-prefix to tag-prefix #3324

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

Closed
wants to merge 1 commit into from

Conversation

roryprimrose
Copy link

GitVersion 5.11.1 CLI does not understand label-prefix. It appears that the correct usage is tag-prefix.

Description

Using the CLI with a yml file that contains label-prefix resulted in

YamlDotNet.Core.YamlException: (Line: 1, Col: 1, Idx: 0) - (Line: 1, Col: 1, Idx: 0): Exception during deserialization
 ---> System.Runtime.Serialization.SerializationException: Property 'label-prefix' not found on type 'GitVersion.Model.Configuration.Config'.
   at YamlDotNet.Serialization.TypeInspectors.TypeInspectorSkeleton.GetProperty(Type type, Object container, String name, Boolean ignoreUnmatched)
   at YamlDotNet.Serialization.NodeDeserializers.ObjectNodeDeserializer.YamlDotNet.Serialization.INodeDeserializer.Deserialize(IParser parser, Type expectedType, Func`3 nestedObjectDeserializer, Object& value)
   at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
   --- End of inner exception stack trace ---
   at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
   at YamlDotNet.Serialization.ValueDeserializers.AliasValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
   at YamlDotNet.Serialization.Deserializer.Deserialize(IParser parser, Type type)
   at YamlDotNet.Serialization.Deserializer.Deserialize[T](IParser parser)
   at YamlDotNet.Serialization.Deserializer.Deserialize[T](TextReader input)
   at GitVersion.Configuration.ConfigSerializer.Read(TextReader reader) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Configuration\ConfigSerializer.cs:line 11
   at GitVersion.Configuration.ConfigFileLocator.ReadConfig(String workingDirectory) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Configuration\ConfigFileLocator.cs:line 49
   at GitVersion.Configuration.ConfigProvider.Provide(String workingDirectory, Config overrideConfig) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Configuration\ConfigProvider.cs:line 43
   at GitVersion.Configuration.ConfigProvider.Provide(Config overrideConfig) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Configuration\ConfigProvider.cs:line 36
   at GitVersion.GitVersionContextFactory.Create(GitVersionOptions gitVersionOptions) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitVersionContextFactory.cs:line 29
   at GitVersion.GitVersionCoreModule.<>c__DisplayClass0_0.<RegisterTypes>b__1() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\GitVersionCoreModule.cs:line 37
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.get_Value()
   at GitVersion.VersionCalculation.NextVersionCalculator.get_Context() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\VersionCalculation\NextVersionCalculator.cs:line 18
   at GitVersion.VersionCalculation.NextVersionCalculator.FindVersion() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\VersionCalculation\NextVersionCalculator.cs:line 38
   at GitVersion.GitVersionCalculateTool.CalculateVersionVariables() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitVersionCalculateTool.cs:line 52
   at GitVersion.GitVersionExecutor.RunGitVersionTool(GitVersionOptions gitVersionOptions) in D:\a\GitVersion\GitVersion\src\GitVersion.App\GitVersionExecutor.cs:line 66

Related Issue

Motivation and Context

How Has This Been Tested?

Validated using the CLI that the correct configuration name is tag-prefix.

Screenshots (if appropriate):

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@asbjornu
Copy link
Member

asbjornu commented Jan 2, 2023

main is now reserved for v6, where tag-prefix was renamed to label-prefix in #3315. In v5 (which we maintain in the support/5.x branch), the property is still named tag-prefix.

@asbjornu asbjornu closed this Jan 2, 2023
@asbjornu
Copy link
Member

asbjornu commented Jan 2, 2023

Ah, but this is about the documentation, which is also published from main. Perhaps unfortunate while v6 is still only in alpha. Perhaps we should publish the docs from support/5.x until v6 becomes stable? Thoughts @arturcic?

@roryprimrose
Copy link
Author

@asbjornu yes that is correct. I installed the latest CLI tooling and then went to the doco site because I knew there was a config option for the version tag prefix. That's when things went sideways.

@asbjornu
Copy link
Member

asbjornu commented Jan 3, 2023

@roryprimrose, Thanks for poking us about it! I've created #3325 to track this out-of-sync-issue.

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

Successfully merging this pull request may close these issues.

2 participants