Repository navigation
Query individual effective v7 configuration properties - #5259
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (7)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe change adds ChangesConfiguration property resolution
CLI query command
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant ArgumentParser
participant GitVersionExecutor
participant ConfigurationProvider
participant ConfigurationSerializer
participant ConfigurationPropertyQuery
ArgumentParser->>GitVersionExecutor: Pass parsed property path and options
GitVersionExecutor->>ConfigurationProvider: Resolve effective v7 configuration
ConfigurationProvider-->>GitVersionExecutor: Return resolved configuration
GitVersionExecutor->>ConfigurationSerializer: Serialize requested property
ConfigurationSerializer->>ConfigurationPropertyQuery: GetValue(configuration, path)
ConfigurationPropertyQuery-->>ConfigurationSerializer: Return scalar value
ConfigurationSerializer-->>GitVersionExecutor: Return JSON scalar
Merge Risk: ⚪ Minimal · up to No issue requiring a change before merge was established; normal checks remain appropriate. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The command exposes a selected configuration value, but the reviewed path restricts queries to public v7 scalar properties and uses the existing effective-configuration resolution. No material security regression was established. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 52 functions across 11 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
8dfddc0 to
9f2f259
Compare
c164ac6 to
8d09da3
Compare
|
|
Queued — the merge queue status continues in this comment ↓. |
Merge Queue Status
This pull request spent 13 seconds in the queue, including 1 second running CI. Required conditions to merge
|
|
Thank you @arturcic for your contribution! |



Description
Add
gitversion config get <property-path>to retrieve one effective v7 configuration scalar as JSON. For example,config get output.update-build-number --override-config output.update-build-number=falseprintsfalse.The command uses public configuration names and the existing workflow/file/runtime resolution, distinguishes known nulls from unknown properties, and rejects objects, maps, collections and v6 configuration. Errors use stderr and exit 1; successful stdout contains only the scalar and a newline. It does not calculate versions or update version files/build-agent outputs.
V7
--show-confignow honors runtime overrides too, so querying and full display agree. V6 display and existing version-variable selection retain their behavior. CLI documentation and the generated configuration reference describe the contract.Related Issue
Closes #5253
Motivation and Context
Scripts currently need to parse the entire configuration YAML to read one setting. This adds a scalar-only operation under the modern argument parser, with v7 configuration required independently of parser selection. Branch-map lookup and branch-specific inherited runtime settings are outside this change.
How Has This Been Tested?
macOS ARM64, .NET SDK 10.0.401:
dotnet test --project src/GitVersion.App.Tests/GitVersion.App.Tests.csproj: 535 passed, 0 failed, 0 skipped.dotnet test --project src/GitVersion.Configuration.Tests/GitVersion.Configuration.Tests.csproj: 247 passed, 0 failed, 0 skipped.QueryNeverCallsVersionCalculationOrVersionOutputverifies the read-only execution path; scalar tests cover culture, quoting, multiline strings, public enum names and unsupported paths.mdsnippets --write-header false; second generation is stable.dotnet build src/GitVersion.slnx: succeeded with 0 warnings and 0 errors.dotnet format src/GitVersion.slnx --verify-no-changes --no-restore --include <changed C# files>andgit diff --check: passed.The complete solution test suite was not run. Hosted checks will run on this draft PR.
Checklist
Summary by CodeRabbit
config get <property-path>to return a single scalar value from effective v7 configuration as JSON, including workflow, file, and runtime overrides. Null values are supported; structured values and branch maps are not.--show-configoutput to include runtime overrides.