-
Notifications
You must be signed in to change notification settings - Fork 654
Fix [ISSUE]: Overrideconfig for strategies returns 'unknown key' error #4329 #4405
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
Conversation
src/GitVersion.Core/VersionCalculation/VersionStrategiesConverter.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
6cfa740
to
c81f5b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for fixing this
Thank you @schickst for your contribution! |
This pull request tries to fix [ISSUE]: Overrideconfig for strategies returns 'unknown key' error. Closes #4329.
Description
There are multiple issues when using /overrideconfig with the 'strategies' property.
First:
The overrideconfig uses a different format that the normal config. And they are then fed differently into the deserializer.
The second issue is that a cast from string[] to VersionStrategies[] has to happen.
My approach was to implement a custom type converter and registered it with the deserializer. The type converter then detects the config format and parses it accordingly.
In my tests it worked for both configuration sources. I am unsure if the location where I put the converter is the right place. I would prefer to avoid YamlDotNet as a direct dependency.
Also I hope that there is a simpler solution and avoid the converter all-together. Maybe this splitting behavior of the value beforehand can be improved.
Related Issue
#4329
Motivation and Context
How Has This Been Tested?
A test case has been added for the related overrideconfig strategies property. There are also many other test cases that might break, if the serialization/deserialization is wrong.
Checklist: