Remove feature-selector environment variables

オープン
#5,136 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
静か
技術スタック
csharp, git

調査の方向性

まず前提となる issue と selector inventory を確認し、次に src/GitVersion.App/ArgumentParserVersion.cs、src/GitVersion.Core/Configuration/ConfigurationVersion.cs、src/GitVersion.Core/Git/GitBackend.cs、FeatureSelections.cs、および参照されている selector テストを調査します。影響を受ける solution ツリーと ExecFeatureSelectorTests を実行します。修正済みの実装が登録され、廃止された変数が対処可能なエラーを生成し、migration と output isolation が引き続き機能し、v8 のドキュメントが更新されていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

breaking change configuration

Summary

Remove the v7 compatibility selector environment variables in GitVersion v8 after their legacy implementations have been removed in v7.1.

This is the final cleanup following the v7 feature-selector alignment issue.

Progress

  • Complete prerequisite #5135 — v7.0 selector alignment.
  • Complete prerequisite #5188 — v7.1 legacy parser/configuration runtime removal.
  • Complete prerequisite #5040 — remove LibGit2Sharp and native binaries.
  • Remove all three compatibility selectors and their selection abstractions in v8.
  • Register the fixed implementations directly and retain gitversion config migrate.
  • Add actionable diagnostics and tests for retired environment variables.
  • Update v8 breaking-change and migration documentation.

Remove

  • GITVERSION_ARGUMENT_PARSER_VERSION
  • GITVERSION_CONFIGURATION_VERSION
  • GITVERSION_GIT_BACKEND
  • Selector types, parsing, validation, logging branches, compatibility diagnostics, and tests that exist only for these variables.

GitVersion v8 has one implementation for each concern:

  • POSIX argument parser
  • Nested calculation/output configuration
  • Managed Git backend

Register and use those implementations directly rather than passing through feature-selector abstractions.

Behavior

  • The three retired variables no longer influence execution.
  • Prefer failing fast with a clear removal message when a retired variable is set, rather than silently accepting stale deployment configuration.
  • Remove the per-selector informational log lines where they no longer communicate a choice. Retain ordinary diagnostic information where useful, such as identifying the managed Git implementation.
  • Keep gitversion config migrate available for converting old configuration files; migration support does not imply runtime support for the v6 configuration format.

Acceptance criteria

  • No production selection code reads the three variables.
  • No compatibility selector abstractions or no-op selection branches remain.
  • Packaging contains no LibGit2Sharp/native backend artifacts.
  • Legacy argument parsing and legacy configuration loading remain unavailable.
  • Tests verify actionable diagnostics when retired variables are supplied.
  • v8 breaking-change and migration documentation lists the removed variables and fixed implementations.

Cleanup inventory from the v7.0 selector branch

The following inventory comes from arturcic:feature/v7-feature-selectors at 54adbb24e, the implementation of #5135. Implementation PR: #5189, opened from the fork after all four fork workflows passed on that commit. The inventory describes the PR branch; completion of #5135 remains a prerequisite until the PR is merged.

Production inventory for v8 selector removal
  • Remove selection-only code in src/GitVersion.App/ArgumentParserVersion.cs, src/GitVersion.Core/Configuration/ConfigurationVersion.cs and src/GitVersion.Core/Git/GitBackend.cs after #5188/#5040 have removed the legacy implementations.
  • Remove src/GitVersion.Core/FeatureSelector.cs once it has no consumers, and remove its explicit source link from new-cli/GitVersion.Common/GitVersion.Common.csproj together with obsolete source-linked selectors. Build both solution trees to catch dangling links.
  • Remove or simplify src/GitVersion.App/FeatureSelections.cs and its registration/logging through CliHost.cs and GitVersionApp.cs; register fixed implementations directly. Retain ordinary implementation diagnostics where useful.
  • Update GitVersionCacheKeyFactory and any remaining configuration serializer/provider/override consumers of ConfigurationVersionSelector. Preserve configuration-version/cache compatibility where still necessary independently of environment-variable selection.
  • Keep the minimal retired-variable detection needed for actionable errors, separately from runtime selection. Include the old GITVERSION_USE_V6_ARGUMENT_PARSER boolean in the retirement policy instead of leaving a dangling replacement message pointing at a selector that v8 has itself removed.
  • Keep Program.cs clean stderr startup errors, migration's root-level --log-file support and ServiceCollectionExtensions machine-readable-output isolation. These behaviors must survive removal of selector-specific logging.
Tests to adapt rather than indiscriminately delete
  • Retire success/normalization tests that exist only for the removed variables in GitBackendSelectorTests, ConfigurationVersionSelectorTests and FeatureSelectorTests. Replace their selector-routing assertions with fixed-implementation composition tests.
  • Remove SelectionLogUsesCapturedValues when the selection snapshot is removed; retain any ordinary logging behavior under a suitable test.
  • Adapt ExecFeatureSelectorTests: remove selector permutation setup from SelectorCombinationsCalculateAndLogWithoutPollutingOutput and MigrationRetainsYamlStdoutWithEitherConfigurationAndBackend, while retaining JSON, single-variable, show-config and flat-input migration output-isolation regressions.
  • Rewrite InvalidSelectorsFailBeforeHelpWithActionableStderr for the v8 retired-variable policy. Cover all three retired variables, explicit formerly valid values, unknown values and empty values; diagnostics must name the retired variable and explain that only the v7 parser/nested configuration/managed Git remain, without offering v6/libgit2 or removed selectors as a workaround.
  • Adapt DefaultsSelectV7AndManagedWithConsoleLogsOnStderr to assert fixed runtime behavior and any retained logging, without expecting informational choice messages that no longer represent a choice.
  • Keep migration from flat v6 input supported and tested even though neither v6 runtime loading nor selector variables remain.

Sweep the branch's updated BREAKING_CHANGES.md, migration guide, CLI arguments, environment-variable reference and managed-Git design document. Describe retired variables as removals; remove temporary-fallback setup instructions from current v8 guidance while preserving historical v7 documentation where appropriate.

Output-isolation regression added during #5189 review
  • Preserve the buildServer dimension in ExecFeatureSelectorTests.SelectorCombinationsCalculateAndLogWithoutPollutingOutput: JSON, single-variable and show-config stdout must stay free of diagnostics even when build-server output is also selected. This dimension is independent of the parser/configuration/backend selectors being retired.
  • Retain consistent stderr routing for console logs in ServiceCollectionExtensions.ConfigureLogger. Build-server integration commands keep their existing output channel; diagnostic logs must not move back to stdout during cleanup.
  • Keep CLI help (ArgumentParser and, until legacy removal, legacy_help.md) and the CLI/migration documentation consistent with stderr logging.
主要言語
C#
スター
3.1k
フォーク
661
平均マージ
7時間 4分
マージ済み PR(30日)
77

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

GitTools/GitVersion のほかの issue

GitTools/GitVersion の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。