You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix Git test output capture and make JSON/DI contracts explicit - #5393
Concurrent stdout/stderr callbacks in the Git test helper can corrupt its shared
buffer or abort the test process. Serialize those writes and retain a regression
that checks every line from both streams.
Use source-generated JSON contracts for configuration-validation results and
AppVeyor requests, preserving field names, nulls, escaping and the GitVersion_
variable prefix. Register the seven built-in version strategies and fifteen
build agents explicitly, with tests preserving the complete discovery order.
These three commits are extracted from #5391 and apply directly to main. The
ordinary CLI continues to support LibGit2Sharp and managed Git with existing
release defaults. NativeAOT publication, build flags, backend restrictions,
configuration/YAML and version-formatting work remain in #5391. Rebase #5391
after this PR lands to remove the shared changes.
Development for #5210: these backend-neutral runtime/serialization improvements
can land independently of the managed-only NativeAOT work in #5391.
Validation
Base: bde36696007d412195a0f2dd5f43d6ae820de025 (main).
Validated head: 61a047930 on macOS ARM64, SDK 11.0.100-rc.2.26504.105, with GITVERSION_GIT_BACKEND=libgit2.
All six relevant project/framework runs passed with LibGit2Sharp selected:
Suite
net10.0
net11.0
Core (full suite)
36,492 passed
36,492 passed
CLI (full suite)
659 passed
659 passed
Build agents (full suite)
111 passed
111 passed
Total: 74,524 passed, 0 failed, 0 skipped in the completed passing runs.
JUnit reports were parsed and checked for the exact extracted regression names.
An initial net10 CLI run had one failure in BeingOnBuildServerWithOutputJsonDoesNotFail: an INFO line from stderr was
interleaved into JSON in the test helper's combined output. That test, its
capture helper and combined-output parser are unchanged from main. The focused
four-case rerun and a complete 659-test CLI rerun both passed without changes.
The initial failed report is retained locally; it is not counted as passing.
Requirement
Evidence
Preserve concurrent Git command output
ExecuteGitCmdPreservesConcurrentStandardOutputAndError checks 10,000 stdout and 10,000 stderr lines. Its original failure was reproduced before the synchronization fix.
Preserve configuration-validation JSON
ValidationEnvelopePreservesFieldNamesNullsAndDiagnosticDetails, SuccessfulValidationPreservesEmptyDiagnostics, YamlDiagnosticPreservesNumericLocationAndEscapedUnicodePath pin the wire contract.
Preserve AppVeyor requests
BuildNumberRequestPreservesWireNameAndVersion, VariableRequestPreservesWireNamesAndEscaping pin request names, values and escaping.
Preserve strategy/build-agent selection order
VersionStrategiesPreserveTheCompleteDiscoveryOrder, BuildAgentsPreserveTheCompleteDiscoveryOrder compare the complete registration sequences and singleton lifetimes.
Reproduction with the pinned SDK available on PATH:
CodeRabbit CLI completed the entire 11-file diff against origin/main with zero
findings. The extracted files exactly match their reviewed #5391 counterparts. git diff --check passes. No validation workflow or harness is added.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.
📝 Walkthrough
The changes add source-generated JSON serialization for configuration validation results and AppVeyor requests, replace reflection-based registrations with explicit singleton registrations, and synchronize stdout and stderr collection in ExecuteGitCmd.
Changes: Configuration validation JSON
Layer / File(s)
Summary
Validation result serialization src/GitVersion.App/ConfigurationValidationJsonContext.cs, src/GitVersion.App/ConfigurationValidationExecutor.cs, src/GitVersion.App.Tests/ConfigurationValidationJsonTests.cs
The executor serializes typed validation results through a source-generated JSON context. Tests check null fields, diagnostic details and escaping, empty diagnostics, and numeric YAML locations.
Build-number and variable requests use typed models and source-generated serialization. Tests check wire names, values, and handling of empty, quoted, and newline-containing values.
The JSON expectations retain their prior behavior; no issue identified here prevents merging after normal checks.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 6.25% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 11 files.
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title accurately summarizes the main changes: fixing Git test output capture and making JSON and dependency-injection contracts explicit.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
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
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.
Description
Concurrent stdout/stderr callbacks in the Git test helper can corrupt its shared
buffer or abort the test process. Serialize those writes and retain a regression
that checks every line from both streams.
Use source-generated JSON contracts for configuration-validation results and
AppVeyor requests, preserving field names, nulls, escaping and the
GitVersion_variable prefix. Register the seven built-in version strategies and fifteen
build agents explicitly, with tests preserving the complete discovery order.
These three commits are extracted from #5391 and apply directly to main. The
ordinary CLI continues to support LibGit2Sharp and managed Git with existing
release defaults. NativeAOT publication, build flags, backend restrictions,
configuration/YAML and version-formatting work remain in #5391. Rebase #5391
after this PR lands to remove the shared changes.
Development for #5210: these backend-neutral runtime/serialization improvements
can land independently of the managed-only NativeAOT work in #5391.
Validation
Base:
bde36696007d412195a0f2dd5f43d6ae820de025(main).Validated head:
61a047930on macOS ARM64, SDK11.0.100-rc.2.26504.105, withGITVERSION_GIT_BACKEND=libgit2.All six relevant project/framework runs passed with LibGit2Sharp selected:
Total: 74,524 passed, 0 failed, 0 skipped in the completed passing runs.
JUnit reports were parsed and checked for the exact extracted regression names.
An initial net10 CLI run had one failure in
BeingOnBuildServerWithOutputJsonDoesNotFail: an INFO line from stderr wasinterleaved into JSON in the test helper's combined output. That test, its
capture helper and combined-output parser are unchanged from main. The focused
four-case rerun and a complete 659-test CLI rerun both passed without changes.
The initial failed report is retained locally; it is not counted as passing.
ExecuteGitCmdPreservesConcurrentStandardOutputAndErrorchecks 10,000 stdout and 10,000 stderr lines. Its original failure was reproduced before the synchronization fix.ValidationEnvelopePreservesFieldNamesNullsAndDiagnosticDetails,SuccessfulValidationPreservesEmptyDiagnostics,YamlDiagnosticPreservesNumericLocationAndEscapedUnicodePathpin the wire contract.BuildNumberRequestPreservesWireNameAndVersion,VariableRequestPreservesWireNamesAndEscapingpin request names, values and escaping.VersionStrategiesPreserveTheCompleteDiscoveryOrder,BuildAgentsPreserveTheCompleteDiscoveryOrdercompare the complete registration sequences and singleton lifetimes.Reproduction with the pinned SDK available on PATH:
CodeRabbit CLI completed the entire 11-file diff against
origin/mainwith zerofindings. The extracted files exactly match their reviewed #5391 counterparts.
git diff --checkpasses. No validation workflow or harness is added.Codex responding on behalf of @arturcic.
Summary by CodeRabbit
Bug Fixes
Refactor
Tests