feat(configuration): modernize YAML configuration handling#4886
Merged
feat(configuration): modernize YAML configuration handling#4886
Conversation
158c927 to
49ffff6
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR modernizes GitVersion’s YAML configuration pipeline by migrating from YamlDotNet to SharpYaml (including source-generated serialization metadata) while updating workflow snapshots/docs to match the new serializer output.
Changes:
- Replace YamlDotNet-based config serialization/deserialization with SharpYaml + a generated
YamlSerializerContext. - Update configuration model types to be settable to support SharpYaml deserialization.
- Refresh approved workflow YAML snapshots and documentation snippets to reflect SharpYaml’s emitted YAML format.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/GitVersion.Configuration/VersionStrategiesConverter.cs | Re-implements strategies YAML conversion using SharpYaml tokens and adds scalar-list parsing. |
| src/GitVersion.Configuration/PreventIncrementConfiguration.cs | Switches properties from internal init to set for YAML binding. |
| src/GitVersion.Configuration/IgnoreConfiguration.cs | Makes ignore fields settable and updates commits-before string binding to use a setter. |
| src/GitVersion.Configuration/GitVersionConfiguration.cs | Makes core configuration properties settable to support SharpYaml deserialization. |
| src/GitVersion.Configuration/GitVersion.Configuration.csproj | Swaps YAML dependency from YamlDotNet to SharpYaml. |
| src/GitVersion.Configuration/ConfigurationYamlContext.cs | Adds SharpYaml source-generation context for configuration types and converter registration. |
| src/GitVersion.Configuration/ConfigurationSerializer.cs | Replaces YamlDotNet serializer with SharpYaml options + generated-context deserialization path. |
| src/GitVersion.Configuration/ConfigurationProvider.cs | Updates exception type reference to SharpYaml’s YamlException. |
| src/GitVersion.Configuration/ConfigurationHelper.cs | Adjusts override merge handling for SharpYaml’s list types. |
| src/GitVersion.Configuration/BranchConfiguration.cs | Makes branch configuration properties settable for YAML binding. |
| src/GitVersion.Configuration.Tests/Workflows/approved/TrunkBased/preview1.yml | Updates approved workflow YAML output to match new serializer formatting/escaping. |
| src/GitVersion.Configuration.Tests/Workflows/approved/GitHubFlow/v1.yml | Updates approved workflow YAML output to match new serializer formatting/escaping. |
| src/GitVersion.Configuration.Tests/Workflows/approved/GitFlow/v1.yml | Updates approved workflow YAML output to match new serializer formatting/escaping. |
| src/GitVersion.Configuration.Tests/Configuration/IgnoreConfigurationTests.cs | Updates YAML exception type import and adds test for scalar strategies override format. |
| src/GitVersion.Configuration.Tests/Configuration/ConfigurationProviderTests.CanWriteOutEffectiveConfiguration.approved.txt | Updates approved effective-configuration output to match new YAML formatting. |
| src/Directory.Packages.props | Adds SharpYaml version and removes YamlDotNet version. |
| docs/input/docs/workflows/TrunkBased/preview1.yml | Updates docs workflow YAML snippet to match new serializer formatting/escaping. |
| docs/input/docs/workflows/GitHubFlow/v1.yml | Updates docs workflow YAML snippet to match new serializer formatting/escaping. |
| docs/input/docs/workflows/GitFlow/v1.yml | Updates docs workflow YAML snippet to match new serializer formatting/escaping. |
| docs/input/docs/reference/configuration.md | Refreshes embedded workflow snippets/output to match updated YAML samples. |
| .github/prompts/create-issue-from-branch.prompt.md | Adds a reusable prompt template for creating/updating issues from branch deltas. |
c41987f to
1b8a1c9
Compare
1b8a1c9 to
784abd8
Compare
|
Contributor
|
Thank you @arturcic for your contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Why
Issue
Resolves #4369