Skip to content

feat(configuration): modernize YAML configuration handling#4886

Open
arturcic wants to merge 6 commits intomainfrom
feature/sharpyaml
Open

feat(configuration): modernize YAML configuration handling#4886
arturcic wants to merge 6 commits intomainfrom
feature/sharpyaml

Conversation

@arturcic
Copy link
Member

Summary

  • migrate configuration YAML handling to SharpYaml across the branch changes
  • align configuration deserialization behavior and related tests
  • add a reusable prompt template for creating issues from branch deltas

Why

  • modernize YAML processing and improve long-term maintainability
  • support the goal tracked in the linked issue

Issue

Resolves #4369

Copilot AI review requested due to automatic review settings March 19, 2026 16:26
@arturcic arturcic force-pushed the feature/sharpyaml branch from 158c927 to 49ffff6 Compare March 19, 2026 16:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@arturcic arturcic force-pushed the feature/sharpyaml branch 8 times, most recently from c41987f to 1b8a1c9 Compare March 20, 2026 12:47
@arturcic arturcic force-pushed the feature/sharpyaml branch from 1b8a1c9 to 784abd8 Compare March 20, 2026 13:57
@sonarqubecloud
Copy link

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.

[FEATURE]: Modernize YAML configuration serialization strategy

2 participants