-
Notifications
You must be signed in to change notification settings - Fork 652
Pull Request Version Calculation Not Based on source branch #2821
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
Comments
Can you please submit a PR containing these tests? |
I submitted the pr 14 days ago. It was looked at but because the CI system treated the unit test failure as successful when it shouldn't it appears to have been ignored. It's there, if you look at the CI build system logs, you can see the test failure. Is there something I'm missing or that would help in answering my question in how to support my intended branch strategy? |
Is there just no way to support the branch strategy I'm asking about? The PR was submitted 6 months ago with no suggestions. Does this need to be changed to a feature request rather than a simple question? |
Sorry, but it has been an extremely hectic autumn and Christmas for me, but I've finally surfaced and have found some time to invest in GitVersion again. I've replied in #2830 (comment). |
thanks I've replied there as well |
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. |
public class XenoLibPackages : TestBase
{
private readonly GitVersionConfiguration configuration = GitFlowConfigurationBuilder.New
.WithVersioningMode(VersioningMode.Mainline)
.WithBranch("feature", _ => _
.WithIncrement(IncrementStrategy.Minor)
.WithVersioningMode(VersioningMode.ContinuousDeployment)
).WithBranch("pull-request", _ => _
.WithIncrement(IncrementStrategy.Inherit)
).Build();
[Test]
public void IncrementFeatureByMinor()
{
using var fixture = new EmptyRepositoryFixture();
fixture.MakeATaggedCommit("0.1.0");
fixture.BranchTo("feature/foo", "foo");
fixture.MakeACommit();
// ✅ succeeds as expected
fixture.AssertFullSemver("0.2.0-foo.1", configuration);
fixture.MakeACommit();
// ✅ succeeds as expected
fixture.AssertFullSemver("0.2.0-foo.2", configuration);
fixture.Checkout("main");
fixture.MergeNoFF("feature/foo");
// ✅ succeeds as expected
fixture.AssertFullSemver("0.2.0", configuration);
}
[Test]
public void CanCalculatePullRequestChanges()
{
using var fixture = new EmptyRepositoryFixture();
fixture.MakeATaggedCommit("0.1.0");
fixture.BranchTo("feature/foo");
fixture.MakeACommit();
// ✅ succeeds as expected
fixture.AssertFullSemver("0.2.0-foo.1", configuration);
fixture.Repository.CreatePullRequestRef("feature/foo", "main", normalise: true);
// ✅ succeeds as expected
fixture.AssertFullSemver("0.2.0-PullRequest2.2", configuration);
}
} |
🎉 This issue has been resolved in version 6.0.0-beta.2 🎉 Your GitReleaseManager bot 📦🚀 |
Discussed in #2818
Originally posted by anderson-dev August 19, 2021
I'm using mainline versioning mode where my feature branches increment by minor. In my scenario below, pull request version reflects the current version of master rather than the feature branch that the pull request is based on:
master
0.1.0
master -> feature/foo
commit
0.2.0-foo.1
feature/foo -> pull/8/merge
0.1.1-PullRequest00008.1
pull/8/merge -> master
0.2.0 (as expected)
I've tried changing the increment mode for pullrequests in my gitversion.yml branch config but it just changes the increment based on master. How would I tell it to simply take its version from the calculated version of the feature branch for which the pull request was created?
Find an integration test below, XenoLibPackages#CanCalculatePullRequestChanges, that reproduces my issue. I tried 'track-merge-target: true' with no dice.
The text was updated successfully, but these errors were encountered: