-
Notifications
You must be signed in to change notification settings - Fork 652
Additional options for command-line switch /overrideconfig
.
#2524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent stuff!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good now, thanks for adjusting the argument format. Rebase against main
, resolve the conflicts and this should be good to go! 👏🏼
…sion.yml` options with simple prperty type (string, enum, int, bool) are now supported - 21 in total.
Co-authored-by: Asbjørn Ulsberg <[email protected]>
…iple instances of `/overrideconfig` (eg. `/overrideconfig tag-prefix=custom /overrideconfig assembly-versioning-scheme=MajorMinor`)
…xing it with `GitVersion.Environment` class.
I re-based the branch. It should be fine now. The unstable unit-tests (the once that failed now) seem to be something I've picked up during rebase from the main branch, unrelated to the code changes in this pull request. |
Thank you @nenadvicentic for your contribution! |
All 'Gitversion.yml` options with simple property type (string, enum, int, bool) are now supported - 21 in total.
Description
As discussed in issue #2485 I've added support for all writeable properties from
GitVersion.Model.Configuration.Config
class (effectivelyGitversion.yml
) which have simple type (string, Enum, int, bool and their nullable counterparts).Implementation uses Reflection to parse which properties fit criteria and uses "aliases" for property names provided by
YamlMemberAttribute
'sAlias
value.Following
/overrideconfig
options are supported:assembly-file-versioning-format
assembly-file-versioning-scheme
assembly-informational-format
assembly-versioning-format
assembly-versioning-scheme
build-metadata-padding
commit-date-format
commit-message-incrementing
commits-since-version-source-padding
continuous-delivery-fallback-tag
increment
legacy-semver-padding
major-version-bump-message
minor-version-bump-message
mode
next-version
no-bump-message
patch-version-bump-message
tag-prefix
tag-pre-release-weight
update-build-number
Related Issue
Support 'assembly-versioning-format' option as a part of '/overrideconfig' command line parameter #2485
Motivation and Context
In CI environment (GitLab, TeamCity), it makes sense that some of the customizations to the gitversion configuration can be overridden via command line. That allows for applying global changes (for example different assembly-versioning style) on company level, via shared CI build script template, instead of committing same configuration option to every single repository separately in
Gitversion.yml
files.Since
tag-prefix
option has already been supported, I requestedassembly-versioning-format
, but instead agreed with @asbjornu that it is better make/overrideconfig
option-parity withGitversion.yml
- to the extent that it is possible/reasonable , due to differences in (de)serialization fidelity betweenyml
files and command-line arguments.How Has This Been Tested?
Code is unit-tested for all currently available
/overrideconfig
options, common errors (wrong key, wrong value, format errors) and setting of multiple options at once.In addition, I manually tested in windows console as well for couple of common options.
Checklist: