Skip to content

[Feature] Group configuration under calculation and output sections with migration support #5131

Description

@arturcic

Summary

Restructure GitVersion configuration into calculation and output sections, add POSIX migration tooling, and provide a one-release fallback for the legacy flat configuration.

This umbrella is implemented through #5132, #5133, and #5134. The cross-feature release matrix and selector lifecycle are governed by #5135.

Proposed structure

calculation:
  workflow: GitFlow/v1
  tag-prefix: '[vV]?'
  semantic-version-format: Strict
  strategies: [ConfiguredNextVersion, MergeMessage, TaggedCommit]
  ignore:
    sha: []
    paths: []
  branches:
    main:
      regex: ^master$|^main$
      mode: ContinuousDelivery
      label: ''
      increment: Patch

output:
  assembly-versioning-scheme: MajorMinorPatch
  assembly-file-versioning-scheme: MajorMinorPatch
  assembly-informational-format: '{InformationalVersion}'
  commit-date-format: yyyy-MM-dd
  tag-pre-release-weight: 60000
  update-build-number: true
  branches:
    main:
      custom-version-format: '{SemVer}'
      pre-release-weight: 55000

Setting ownership

calculation contains semantic-version and Git-history inputs:

  • workflow, next-version, tag-prefix, and version-in-branch-pattern
  • version-bump and no-bump message patterns
  • merge-message-formats, semantic-version-format, strategies, and ignore
  • calculation branch defaults and calculation.branches: mode, label, increment, prevent-increment, merge tracking, commit-message incrementing, regex/source relationships, and branch classification

label remains a calculation setting because it changes SemVer and FullSemVer.

output contains generated-variable and output-integration settings:

  • assembly versioning schemes and formats
  • assembly-informational-format, commit-date-format, tag-pre-release-weight, and update-build-number
  • output branch defaults and output.branches: custom-version-format and pre-release-weight

Calculation and output entries for the same branch are merged logically. Output configuration may target a branch supplied by a built-in workflow without repeating its calculation configuration.

Configuration model and validation

  • Represent both sections explicitly in the configuration model.
  • Resolve v6 and v7 representations to equivalent effective runtime configuration during v7.0.
  • Reject documents mixing flat and nested settings.
  • Keep calculation consumers independent of output-only settings where practical.
  • Update built-in workflows, builders, inheritance, serialization, --show-config, overrides, caching, schemas, and public API baselines.

POSIX migration command

Add to the stable System.CommandLine parser:

gitversion config migrate
gitversion config migrate --config GitVersion.yml
gitversion config migrate --config GitVersion.yml --output GitVersion.v7.yml
gitversion config migrate --config GitVersion.yml --in-place
  • Default input uses normal configuration discovery and default output is stdout.
  • --output refuses overwrite without --force; --in-place explicitly replaces the input; both are mutually exclusive.
  • Migration is deterministic and idempotent and preserves all configured values.
  • Warn before in-place migration if comments cannot be preserved.
  • Explicit input does not require repository discovery or normalization.
  • The command exists only in the stable POSIX parser, not LegacyArgumentParser or experimental new-cli.
  • A positional directory named config uses the unambiguous --target-path config form.

Release matrix

Use GITVERSION_CONFIGURATION_VERSION=v6|v7 as specified by #5135:

  • v7.0 defaults to nested v7 configuration; v6 is an explicit temporary fallback.
  • v7.1 removes runtime support for flat v6 configuration. v6 produces an actionable error directing users to gitversion config migrate.
  • Explicit v7 remains accepted as a no-op throughout v7.x.
  • Remove feature-selector environment variables #5136 removes the selector entirely in v8.

--show-config emits the selected format. In v7 mode, --override-config uses nested paths and rejects legacy paths with replacement guidance; v6 mode does the inverse.

Acceptance criteria

  • Every current setting has an explicit calculation or output destination.
  • custom-version-format and pre-release-weight work as output defaults and under output.branches.
  • v6 and v7 configurations have calculation/output parity in v7.0.
  • v7.0 defaults to v7, provides an explicit v6 fallback, and warns when that fallback loads a user file.
  • v7.1 removes v6 runtime loading while retaining migration tooling.
  • Migration, overrides, workflows, --show-config, caching, serialization, schemas, docs, and public APIs are tested and updated.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions