-
Notifications
You must be signed in to change notification settings - Fork 654
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
Fix closing pull request from hotfix to support failed to inherit Increment branch configuration #3196
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.
Please run dotnet format
on your code and have a look at my other remarks. Otherwise, I think this looks good on the condition that all tests succeed. 🤞🏼
src/GitVersion.Core.Tests/IntegrationTests/Issue3020FailedToInherit.cs
Outdated
Show resolved
Hide resolved
src/GitVersion.Core/Configuration/BranchConfigurationCalculator.cs
Outdated
Show resolved
Hide resolved
Sorry if I didn't run it, I read the contributing guidelines but the command was for old dotnet format, sdk 6 now has slightly different options, so I followed the vs2022 that should follow the editorconfig, in fact now running a simple I think this part of the CONTRIBUTING guidelines should be revised, because now everybody has installed sdk 6 and dotnet format it's embedded and has slightly different options: probably a simple command like the follow should do the same: dotnet format --exclude **/AddFormats/ |
I was wrong saying that it didn't change anything, because in fact has fixed a couple of space |
Hello @micdenny, [Test]
public void CalculatesCorrectVersionWhenPullRequestHotfixBranchToMain()
{
using var fixture = new EmptyRepositoryFixture();
fixture.Repository.MakeATaggedCommit("0.1.0");
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop"));
fixture.Repository.MakeACommit();
Commands.Checkout(fixture.Repository, "main");
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("hotfix/0.1.1"));
fixture.Repository.MakeACommit();
fixture.AssertFullSemver("0.1.1-beta.1+1");
fixture.Repository.CreatePullRequestRef("hotfix/0.1.1", MainBranch, normalise: true);
fixture.AssertFullSemver("0.1.1-PullRequest0002.2");
} |
@NightFox7 I'm going to try it adding it to this branch and pushing run :) hold on ⏳ |
@asbjornu some CI test are failing but I don't understand why: |
@NightFox7 unfortunately it does not solve that problem 😞
This PR solves problems when there is also a remote in a local repo |
I'ts working here. ;) Do you have a bug or issue number? |
Yes ! @HHobeck Thank you. We just have to merge your PR then ;) |
@asbjornu I've closed all the proposed changes, are you happy with this PR? I don't understand what some tests are complaining about:
|
Hm. The accompanying issue (#3020) that this PR is supposed to be resolved was closed by merging #3190. Both #3020 and #3190 are also targeting v6 ( |
@micdenny please rebase your PR on top of current state of |
Closing as it's too old based on the code base. Please consider opening a new issue/PR based on the current code base |
Description
Changed the public method
ExcludingBranches
ofIRepositoryStore
adding an optional parameterbool excludeRemotes = false
, it this way it should be backward compatible, actual calls to it like inMergeCommitFinder
remains with the same behaviour, instead the call we did onBranchConfigurationCalculator
in theInheritBranchConfiguration
method, can be called passingexcludeRemotes: true
and this fixes the bug well explained in the issue.Unfortunately this is a breaking change because I've changed a public api, even if we add a separated method, would break who is inherits from
RepositoryStore
or implementIRepositoryStore
.If you have a better idea, or a better name for
excludeRemotes
you're welcome to suggest.Related Issue
Fixes #3020
Motivation and Context
It solves a problem with the calculation of the inherits gitversion increment strategy.
How Has This Been Tested?
You can check the integration tests I've added in the solution called
Issue3020FailedToInherit
, and it is welcome suggestion on better names and position of the file.Screenshots (if appropriate):
Checklist: