Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Bugfix] GitVersion crashes if there are multiple branches containing the keyword develop and the current branch has Increment policy set to Inherit with current commit being a merge commit #1410

Merged
merged 9 commits into from
Feb 19, 2019

Conversation

ruhullahshah
Copy link
Contributor

  • Problem
    In case there are multiple branches containing the keyword develop and the current branch has an increment policy set to inherit e.g. feature/x, if the current commit is a merge commit, GitVersion crashes.

  • Root Cause
    In case of merge commits, GitVersion derives the branch configuration from master or develop. When multiple develops exist, any one of them can be selected, in case of the attached test repo it is bob_develop. While trying to derive the configuration of bob_develop, the regex is modified in Config.cs as shown in the changelist. This causes a regex mismatch and hence the invalid configuration attached to bob_develop

  • Fix
    Remove the ^ added to the branch regex. Either the ^ should be present in the branch regex itself or not at all.

Attached is a repo where this problem can be reproduced.
test-repo.zip

@arturcic arturcic requested a review from asbjornu February 18, 2019 15:27
@asbjornu asbjornu merged commit 0b051f4 into GitTools:master Feb 19, 2019
@arturcic arturcic added this to the 5.0.0 milestone Feb 19, 2019
@ruhullahshah ruhullahshah deleted the branch_regex_fix branch February 20, 2019 13:27
@threegerbils
Copy link

@asbjornu @arturcic This change to the default branch regexes breaks determination of master or develop if there is no local tracking branch as it will not match origin/(master|develop)

The BranchConfigurationCalculator checks against Branch.FriendlyName, which includes the remote, when trying to find master or develop.

Should the checks be switched to use Branch.NameWithoutRemote instead?

@asbjornu
Copy link
Member

@tvoyle: Thanks for both testing and alerting us! Are you up for submitting a PR changing from Branch.FriendlyName to Branch.NameWithoutRemote?

@arturcic arturcic added the Bug label Mar 7, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants