Skip to content

fix: include actual key name in /overrideconfig unsupported key error message#4874

Merged
arturcic merged 2 commits intoGitTools:mainfrom
denisbredikhin:main
Mar 16, 2026
Merged

fix: include actual key name in /overrideconfig unsupported key error message#4874
arturcic merged 2 commits intoGitTools:mainfrom
denisbredikhin:main

Conversation

@denisbredikhin
Copy link
Contributor

Description

  • ArgumentParser.cs: Interpolate the actual key name into the error message
  • ArgumentParserTests.cs: Update expected string in existing test case to match new format

Before
Could not parse /overrideconfig option: key1=value1. Unsupported 'key'.

After
Could not parse /overrideconfig option: key1=value1. Unsupported key 'key1'.

Related Issue

Resolves #4873

Motivation and Context

To have a clearer error message in case of GitVersion misconfiguration.

How Has This Been Tested?

Changes are minimal; testing with provided unit tests looks reasonable.

Checklist:

  • [ X] My code follows the code style of this project.
  • [ X] My change requires a change to the documentation.
  • [ X] I have updated the documentation accordingly.
  • [ X] I have added tests to cover my changes.
  • [ X] All new and existing tests passed.

Copilot AI review requested due to automatic review settings March 16, 2026 17:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves the clarity of GitVersion’s CLI error reporting when /overrideconfig is provided with an unsupported configuration key, aligning behavior with issue #4873.

Changes:

  • Update the /overrideconfig unsupported-key WarningException message to include the actual invalid key name.
  • Update the existing unit test expected string to match the new error message format.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/GitVersion.App/ArgumentParser.cs Includes the actual override key in the unsupported-key error message.
src/GitVersion.App.Tests/ArgumentParserTests.cs Adjusts the expected exception message in the invalid overrideconfig test data.

… message

* Initial plan

* fix: include actual key name in /overrideconfig unsupported key error message

Co-authored-by: denisbredikhin <11455823+denisbredikhin@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: denisbredikhin <11455823+denisbredikhin@users.noreply.github.com>
Co-authored-by: Artur <artur.stolear@gmail.com>
@sonarqubecloud
Copy link

@arturcic arturcic enabled auto-merge March 16, 2026 20:51
@arturcic arturcic merged commit 97fa154 into GitTools:main Mar 16, 2026
118 checks passed
@mergify
Copy link
Contributor

mergify bot commented Mar 16, 2026

Thank you @denisbredikhin for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ISSUE]: Improve error message for unsupported keys in /overrideconfig command line option

4 participants