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

Calculation of branch configuration will fail if master and develop is equal and is integrated in a feature branch. #568

Closed
orjan opened this issue Aug 14, 2015 · 1 comment

Comments

@orjan
Copy link
Contributor

orjan commented Aug 14, 2015

I'm having an issue where the BranchConfigurationCalculator will throw when develop is merged to a long running feature without any commits in the feature and within the develop branch.

This line of code will throw since both develop and master is pointing at the same commit.
https://github.com/GitTools/GitVersion/blame/master/src/GitVersionCore/BranchConfigurationCalculator.cs#L53

I've tried to reproduce the issue within a test case but I'm not sure about the final assert?
I've also added some comments that if presents will make GV work.

I think this is releated to #453 but for feature branches.

    [Test]
    public void ShouldBePossibleToMergeDevelopForALongRunningBranch()
    {
        using (var fixture = new EmptyRepositoryFixture(new Config() { VersioningMode = VersioningMode.ContinuousDeployment }))
        {
            fixture.Repository.MakeATaggedCommit("v1.0.0");

            fixture.Repository.CreateBranch("develop");
            fixture.Repository.Checkout("develop");

            fixture.Repository.CreateBranch("feature/longrunning");
            fixture.Repository.Checkout("feature/longrunning");
            fixture.Repository.MakeACommit();

            fixture.Repository.Checkout("develop");
            fixture.Repository.MakeACommit();

            fixture.Repository.Checkout("master");
            fixture.Repository.Merge(fixture.Repository.FindBranch("develop"), SignatureBuilder.SignatureNow());
            fixture.Repository.ApplyTag("v1.1.0");

            /* NOTE: Adding a commit to develop and the version finder will not throw
            {
                fixture.Repository.Checkout("develop");
                fixture.MakeACommit();
                fixture.AssertFullSemver("1.2.0-unstable.1");
            }
            */

            fixture.Repository.Checkout("feature/longrunning"); 
            fixture.Repository.Merge(fixture.Repository.FindBranch("develop"), SignatureBuilder.SignatureNow());

            /* NOTE: adding a commit to the feature and the version finder will not throw, this is our workaround after
             * develop has been integrated into a longrunning branch.
            {
                fixture.Repository.MakeACommit();                
            }
            */

            /*
                First of all im not sure about the assertion here, but it will throw before...
            */
            fixture.AssertFullSemver("1.2.0-longrunning.2");
        }
    }
@orjan orjan changed the title Calucation of branch configuration will fail if master and develop is equal and is integrated in a feature branch. Calculation of branch configuration will fail if master and develop is equal and is integrated in a feature branch. Aug 15, 2015
orjan added a commit to orjan/GitVersion that referenced this issue Aug 17, 2015
This fixes the issue where the BranchConfigurationCalulator thrown an
exception if develop and master are equal and re-integrated into a long
running feature branch.

Fixes GitTools#568
@JakeGinnivan
Copy link
Contributor

Will be fixed in 3.1

Thanks for taking time and submitting a PR, makes it much easier to diagnose/fix.

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 a pull request may close this issue.

2 participants