Skip to content

[5.0.1] ERROR: Property 'merge-message-formats' not found on type 'GitVersion.Config' #1780

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
wwuck opened this issue Aug 15, 2019 · 9 comments

Comments

@wwuck
Copy link

wwuck commented Aug 15, 2019

I installed GitVersion.CommandLine 5.0.1 and ran GitVersion.exe init, selecting the Continuous Deployment options which resulted in this YAML file:

mode: ContinuousDeployment
branches: {}
ignore:
  sha: []
merge-message-formats: {}

I then tried to build this project on AppVeyor by using the GitVersion.exe init output for appveyor.yml.

install:
  - choco install gitversion.portable -pre -y

assembly_info:
  patch: false

before_build:
  - nuget restore
  - ps: gitversion $env:APPVEYOR_BUILD_FOLDER /l console /output buildserver /updateAssemblyInfo /nofetch /b $env:APPVEYOR_REPO_BRANCH

build:
  project: Project.sln

after_build:
  - cmd: ECHO nuget pack Project\Project.nuspec -version "%GitVersion_NuGetVersion%" -prop "target=%CONFIGURATION%"
  - cmd: nuget pack Project\Project.nuspec -version "%GitVersion_NuGetVersion%" -prop "target=%CONFIGURATION%"
  - cmd: appveyor PushArtifact "Project.%GitVersion_NuGetVersion%.nupkg"

AppVeyor installed GitVersion.Portable 5.0.1 from chocolatey.

The build then failed with the following error in the logs:

ERROR [08/15/19 3:03:45:18] An unexpected error occurred:
YamlDotNet.Core.YamlException: (Line: 1, Col: 1, Idx: 0) - (Line: 1, Col: 1, Idx: 0): Exception during deserialization ---> System.Runtime.Serialization.SerializationException: Property 'merge-message-formats' not found on type 'GitVersion.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](TextReader input)
   at GitVersion.ConfigSerialiser.Read(TextReader reader)
   at GitVersion.ConfigurationProvider.Provide(String workingDirectory, IFileSystem fileSystem, Boolean applyDefaults, Config overrideConfig)
   at GitVersion.ExecuteCore.ExecuteInternal(String targetBranch, String commitId, GitPreparer gitPreparer, IBuildServer buildServer, Config overrideConfig)
   at GitVersion.ExecuteCore.ExecuteGitVersion(String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId, Config overrideConfig, Boolean noCache)
   at GitVersion.SpecifiedArgumentRunner.Run(Arguments arguments, IFileSystem fileSystem)
   at GitVersion.Program.VerifyArgumentsAndRun()

Looking at the commits, I thought merge-message-formats was included in the GitVersion 5.0.0 release?

@wwuck wwuck changed the title Property 'merge-message-formats' not found on type 'GitVersion.Config' ERROR: Property 'merge-message-formats' not found on type 'GitVersion.Config' Aug 18, 2019
@wwuck wwuck changed the title ERROR: Property 'merge-message-formats' not found on type 'GitVersion.Config' [5.0.1] ERROR: Property 'merge-message-formats' not found on type 'GitVersion.Config' Aug 19, 2019
@stale
Copy link

stale bot commented Nov 17, 2019

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 17, 2019
@asbjornu
Copy link
Member

Yes, #1488 was included in 5.0.0. @Kieranties, can you explain why this isn't working?

@stale stale bot removed the stale label Nov 18, 2019
@Kieranties
Copy link
Contributor

Kieranties commented Nov 18, 2019

I've just ran a quick test locally:

> mkdir gitversion
> cd .\gitversion\
> choco install gitversion.portable -pre -y
Installing the following packages:
gitversion.portable
By installing you accept licenses for the packages.
Progress: Downloading GitVersion.Portable 5.1.3-beta1-6... 100%

> git init
> GitVersion.exe init
> cat .\GitVersion.yml
mode: ContinuousDelivery
branches: {}
ignore:
  sha: []
merge-message-formats: {}

> git commit -m test --allow-empty
> GitVersion.exe
{
  "Major":0,
  "Minor":1,
  "Patch":0,
  "PreReleaseTag":"",
  "PreReleaseTagWithDash":"",
  "PreReleaseNumber":"",
   //...
}

Which would give me the impression that things work on the 5.1.3-beta1-6 version.
I've also tested directly with 5.0.1 as well and get the same.

Looking at the chocolatey conversation, there is one user having this issue on AppVeyor too: http://disq.us/p/23pbn24

@asbjornu Is there some alternate processing when the configuration is loaded in AppVeyor?
@wwuck If you remove the merge-message-formats from the config, do you still have the same issue?

@asbjornu
Copy link
Member

I'm not aware of any variance on the handling of the configuration depending on where GitVersion is being executed. To make GitVersion believe it runs under a specific CI, you just need to declare the environment variable GitVersion is looking for. For AppVeyor it's simply called APPVEYOR:

public const string EnvironmentVariableName = "APPVEYOR";

@Kieranties
Copy link
Contributor

After specifying the APPVEYOR environment variable and running with /diag

INFO [11/20/19 12:06:25:08] Running on Windows.
INFO [11/20/19 12:06:25:09] Applicable build agent found: 'AppVeyor'.
INFO [11/20/19 12:06:25:09] Branch from build environment:
INFO [11/20/19 12:06:25:09] Begin: Normalizing git directory for branch ''
...

And I still get successful version output 🤷‍♂️

@stale
Copy link

stale bot commented Feb 18, 2020

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Feb 18, 2020
@asbjornu
Copy link
Member

I don't quite understand what's going on here, tbh.

@stale stale bot removed the stale label Feb 18, 2020
@Kieranties
Copy link
Contributor

Without any input from @wwuck I'm at a loss on what to test - I've not seen this issue reported elsewhere.

@wwuck
Copy link
Author

wwuck commented Feb 24, 2020

Apologies for the delay in getting back to this, but I've tested it again now. The build downloaded the newer GitVersion.Portable 5.1.3 and all seemed to run without error this time.

I guess this can be closed if no-one else has the problem still occurring?

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

No branches or pull requests

4 participants