Skip to content

Align v7 feature selectors and legacy lifecycle #5135

Description

@arturcic

Summary

Align the v7 feature selectors with the implementations that shipped, log each
resolved selection, and remove the v6 parser/configuration compatibility paths
on their approved lifecycle. Keep the Git backend lifecycle tied to the
managed-Git roadmap rather than removing libgit2 prematurely.

Blocked by #5134.

Environment variables

Concern Environment variable Values v7.0 default
Argument parser GITVERSION_ARGUMENT_PARSER_VERSION v6, v7 v7
Configuration structure GITVERSION_CONFIGURATION_VERSION v6, v7 v7
Git backend GITVERSION_GIT_BACKEND libgit2, managed libgit2

Replace:

GITVERSION_USE_V6_ARGUMENT_PARSER=true

with:

GITVERSION_ARGUMENT_PARSER_VERSION=v6

The old boolean variable is removed rather than supported as an alias. If it is
still set, GitVersion fails with a clear message identifying
GITVERSION_ARGUMENT_PARSER_VERSION=v6 as its replacement.

v7 behavior

When the variables are unset in v7.0:

  • Use the POSIX v7 argument parser.
  • Use the nested v7 calculation/output configuration.
  • Use the libgit2 backend. The managed backend remains opt-in until its own
    readiness roadmap changes the default.

Temporary compatibility selections:

GITVERSION_ARGUMENT_PARSER_VERSION=v6
GITVERSION_CONFIGURATION_VERSION=v6

The Git backend selector remains independent:

GITVERSION_GIT_BACKEND=libgit2
GITVERSION_GIT_BACKEND=managed

Selector behavior:

  • Values are trimmed and case-insensitive.
  • Empty values behave as unset.
  • Unknown values fail fast and list the accepted values.
  • Selection is centralized so all applicable composition roots behave
    consistently.
  • The selectors are independent.

Legacy lifecycle

  • Remove the legacy argument parser and flat v6 configuration runtime support
    on the approved v7.x lifecycle while retaining gitversion config migrate.
  • Keep retired parser/configuration selector values recognizable long enough to
    emit actionable diagnostics.
  • Do not remove LibGit2Sharp or its selector in this issue. Its default flip,
    soak period, and removal remain governed by the managed-Git roadmap.
  • Remove feature-selector environment variables #5136 tracks major-version cleanup of compatibility selectors after their
    prerequisites are complete.

Selection logging

Log all resolved selections at information level, using the actual effective
values, for example:

Argument parser version: v7
Configuration version: v7
Git backend: libgit2
  • Log the effective selection whether it came from the default or an
    environment variable.
  • Do not include these messages in machine-readable JSON, YAML, or
    single-variable stdout.
  • Make configuration-version logging available to non-CLI entry points such as
    MSBuild where normal logging exists.
  • Do not log credentials or unrelated environment values.

Documentation sweep

Replace the remaining GITVERSION_USE_V6_ARGUMENT_PARSER references when the
new selector is implemented:

  • BREAKING_CHANGES.md
  • docs/input/docs/migration/v6-to-v7.md (migration warning and environment
    variable table)
  • docs/input/docs/usage/cli/arguments.md (selector introduction and
    config migrate availability)

Acceptance criteria

  • Tests cover unset, empty, case-insensitive, whitespace-padded, valid, and
    invalid values.
  • v7.0 defaults select the v7 parser, v7 configuration, and libgit2 backend.
  • Explicit parser/configuration fallbacks remain functional until their
    approved removal point.
  • GITVERSION_USE_V6_ARGUMENT_PARSER is rejected with its replacement.
  • All resolved selections are logged without contaminating machine-readable
    stdout.
  • Parser/configuration legacy removal produces actionable diagnostics and does
    not remove gitversion config migrate.
  • Git backend behavior and documentation stay aligned with the managed-Git
    implementation roadmap.
  • Documentation and migration guidance use the aligned selector names.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions