Skip to content
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

[Bug] Using output of showconfig for config file results in invalid config #2462

Closed
ptr727 opened this issue Nov 23, 2020 · 4 comments
Closed
Labels
Milestone

Comments

@ptr727
Copy link

ptr727 commented Nov 23, 2020

Describe the bug
A clear and concise description of what the bug is.

5.5.1 does not work, 5.3.7 does work.
I wanted to modify the regex for master to include main.
I ran gitversion /showconfig, and pasted the output into my config file.
I then run /showconfig again wanting to confirm the config is ok.
But, the config is reported as invalid.

Expected Behavior

I expect that a config file created from the output of /showconfig should work and produce the same output.

Actual Behavior

Config file created from /showconfig output does not work.

Possible Fix

Steps to Reproduce

Context

Trying to get main branch working with the last version of gitversion that produces the expected version output.

Config file:

mode: Mainline
next-version: 1.4.0

Get active config:

PS C:\Users\piete\source\repos\Utilities> gitversion /showconfig
assembly-versioning-scheme: MajorMinorPatch
assembly-file-versioning-scheme: MajorMinorPatch
mode: Mainline
tag-prefix: '[vV]'
continuous-delivery-fallback-tag: ci
next-version: 1.4.0
major-version-bump-message: '\+semver:\s?(breaking|major)'
minor-version-bump-message: '\+semver:\s?(feature|minor)'
patch-version-bump-message: '\+semver:\s?(fix|patch)'
no-bump-message: '\+semver:\s?(none|skip)'
legacy-semver-padding: 4
build-metadata-padding: 4
commits-since-version-source-padding: 4
tag-pre-release-weight: 60000
commit-message-incrementing: Enabled
branches:
  develop:
    mode: Mainline
    tag: alpha
    increment: Minor
    prevent-increment-of-merged-branch-version: false
    track-merge-target: true
    regex: ^dev(elop)?(ment)?$
    source-branches: []
    tracks-release-branches: true
    is-release-branch: false
    is-mainline: false
    pre-release-weight: 0
  master:
    mode: Mainline
    tag: ''
    increment: Patch
    prevent-increment-of-merged-branch-version: true
    track-merge-target: false
    regex: ^master$
    source-branches:
    - develop
    - release
    tracks-release-branches: false
    is-release-branch: false
    is-mainline: true
    pre-release-weight: 55000
  release:
    mode: Mainline
    tag: beta
    increment: None
    prevent-increment-of-merged-branch-version: true
    track-merge-target: false
    regex: ^releases?[/-]
    source-branches:
    - develop
    - master
    - support
    - release
    tracks-release-branches: false
    is-release-branch: true
    is-mainline: false
    pre-release-weight: 30000
  feature:
    mode: Mainline
    tag: useBranchName
    increment: Inherit
    prevent-increment-of-merged-branch-version: false
    track-merge-target: false
    regex: ^features?[/-]
    source-branches:
    - develop
    - master
    - release
    - feature
    - support
    - hotfix
    tracks-release-branches: false
    is-release-branch: false
    is-mainline: false
    pre-release-weight: 30000
  pull-request:
    mode: Mainline
    tag: PullRequest
    increment: Inherit
    prevent-increment-of-merged-branch-version: false
    tag-number-pattern: '[/-](?<number>\d+)'
    track-merge-target: false
    regex: ^(pull|pull\-requests|pr)[/-]
    source-branches:
    - develop
    - master
    - release
    - feature
    - support
    - hotfix
    tracks-release-branches: false
    is-release-branch: false
    is-mainline: false
    pre-release-weight: 30000
  hotfix:
    mode: Mainline
    tag: beta
    increment: Patch
    prevent-increment-of-merged-branch-version: false
    track-merge-target: false
    regex: ^hotfix(es)?[/-]
    source-branches:
    - develop
    - master
    - support
    tracks-release-branches: false
    is-release-branch: false
    is-mainline: false
    pre-release-weight: 30000
  support:
    mode: Mainline
    tag: ''
    increment: Patch
    prevent-increment-of-merged-branch-version: true
    track-merge-target: false
    regex: ^support[/-]
    source-branches:
    - master
    tracks-release-branches: false
    is-release-branch: false
    is-mainline: true
    pre-release-weight: 55000
ignore:
  sha: []
commit-date-format: yyyy-MM-dd
merge-message-formats: {}
update-build-number: true

Replace config file with output from above.

PS C:\Users\piete\source\repos\Utilities> gitversion /showconfig
Mainline mode only works at the repository level, a single branch cannot be put into mainline mode

This is because mainline mode treats your entire git repository as an event source with each merge into the 'mainline' incrementing the version.

If the docs do not help you decide on the mode open an issue to discuss what you are trying to do.

Your Environment

Version 5.3.7, and 5.5.1
https://github.com/ptr727/Utilities

@ptr727 ptr727 added the bug label Nov 23, 2020
@asbjornu
Copy link
Member

/showconfig gives you the effective configuration, not necessarily what's possible to configure in GitVersion.yml. We should probably clarify that somehow.

@HHobeck HHobeck added this to the 6.x milestone Apr 1, 2023
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs.

@github-actions github-actions bot added the stale label Jun 30, 2023
@arturcic arturcic added stale and removed stale labels Jun 30, 2023
@ptr727
Copy link
Author

ptr727 commented Jul 5, 2023

Abandon

@ptr727 ptr727 closed this as completed Jul 5, 2023
@arturcic arturcic modified the milestones: 6.x, 6.0.0-beta.4 Dec 12, 2023
@arturcic
Copy link
Member

🎉 This issue has been resolved in version 6.0.0-beta.4 🎉
The release is available on:

Your GitReleaseManager bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants