-
Notifications
You must be signed in to change notification settings - Fork 652
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] Consider pre-release tags only when they matching with the label name on branch #3438
Labels
Milestone
Comments
[TestCase(1)]
[TestCase(2)]
[TestCase(3)]
public void EnsurePreReleaseTagLabelWillBeConsideredIfAlphaLabelIsDefined(long patchNumber)
{
var configuration = GitHubFlowConfigurationBuilder.New
.WithLabel(null)
.WithBranch("main", branchBuilder => branchBuilder
.WithVersioningMode(VersioningMode.ContinuousDelivery)
.WithLabel("alpha").WithIncrement(IncrementStrategy.Patch)
).Build();
using var fixture = new EmptyRepositoryFixture("main");
fixture.MakeACommit();
// ✅ succeeds as expected
fixture.AssertFullSemver("0.0.1-alpha.1+1", configuration);
fixture.ApplyTag($"0.0.{patchNumber}-alpha.1");
// ✅ succeeds as expected
fixture.AssertFullSemver($"0.0.{patchNumber}-alpha.1", configuration);
fixture.MakeACommit();
// ✅ succeeds as expected
fixture.AssertFullSemver($"0.0.{patchNumber}-alpha.2+1", configuration);
fixture.MakeACommit();
// ✅ succeeds as expected
fixture.AssertFullSemver($"0.0.{patchNumber}-alpha.2+2", configuration);
fixture.MakeATaggedCommit($"0.0.{patchNumber}-beta.1");
// ❌ expected: 0.0.{patchNumber}-alpha.2+3
fixture.AssertFullSemver($"0.0.{patchNumber}-alpha.2+0", configuration);
fixture.MakeACommit();
// ❌ expected: 0.0.{patchNumber}-alpha.2+4
fixture.AssertFullSemver($"0.0.{patchNumber}-alpha.2+1", configuration);
fixture.MakeATaggedCommit($"0.0.{patchNumber}-beta.2");
// ❌ expected: 0.0.{patchNumber}-alpha.2+5
fixture.AssertFullSemver($"0.0.{patchNumber}-alpha.2+0", configuration);
fixture.MakeACommit();
// ❌ expected: 0.0.{patchNumber}-alpha.2+6
fixture.AssertFullSemver($"0.0.{patchNumber}-alpha.2+1", configuration);
fixture.ApplyTag($"0.0.{patchNumber}");
// ❌ expected: 0.0.{patchNumber}
fixture.AssertFullSemver($"0.0.{patchNumber}-alpha.1+0", configuration);
fixture.MakeACommit();
// ✅ succeeds as expected
fixture.AssertFullSemver($"0.0.{patchNumber + 1}-alpha.1+1", configuration);
fixture.Repository.DumpGraph();
} |
[TestCase(1)]
[TestCase(2)]
[TestCase(3)]
public void EnsurePreReleaseTagLabelWillBeConsideredIfBetaLabelIsDefined(long patchNumber)
{
var configuration = GitHubFlowConfigurationBuilder.New
.WithBranch("main", branchBuilder => branchBuilder
.WithVersioningMode(VersioningMode.ContinuousDelivery)
.WithLabel("beta").WithIncrement(IncrementStrategy.Patch)
).Build();
using var fixture = new EmptyRepositoryFixture("main");
fixture.MakeACommit();
// ✅ succeeds as expected
fixture.AssertFullSemver("0.0.1-beta.1+1", configuration);
fixture.ApplyTag($"0.0.{patchNumber}-alpha.1");
// ❌ expected: 0.0.{patchNumber}-beta.1+1
fixture.AssertFullSemver($"0.0.{patchNumber}-beta.1+0", configuration);
fixture.MakeACommit();
// ❌ expected: 0.0.{patchNumber}-beta.1+2
fixture.AssertFullSemver($"0.0.{patchNumber}-beta.1+1", configuration);
fixture.MakeACommit();
// ❌ expected: 0.0.{patchNumber}-beta.1+3
fixture.AssertFullSemver($"0.0.{patchNumber}-beta.1+2", configuration);
fixture.MakeATaggedCommit($"0.0.{patchNumber}-beta.1");
// ✅ succeeds as expected
fixture.AssertFullSemver($"0.0.{patchNumber}-beta.1", configuration);
fixture.MakeACommit();
// ✅ succeeds as expected
fixture.AssertFullSemver($"0.0.{patchNumber}-beta.2+1", configuration);
fixture.MakeATaggedCommit($"0.0.{patchNumber}-beta.2");
// ✅ succeeds as expected
fixture.AssertFullSemver($"0.0.{patchNumber}-beta.2", configuration);
fixture.MakeACommit();
// ✅ succeeds as expected
fixture.AssertFullSemver($"0.0.{patchNumber}-beta.3+1", configuration);
fixture.ApplyTag($"0.0.{patchNumber}");
// ❌ expected: 0.0.{patchNumber}
fixture.AssertFullSemver($"0.0.{patchNumber}-beta.2+0", configuration);
fixture.MakeACommit();
// ✅ succeeds as expected
fixture.AssertFullSemver($"0.0.{patchNumber + 1}-beta.1+1", configuration);
} |
[TestCase(1)]
[TestCase(2)]
[TestCase(3)]
public void EnsurePreReleaseTagLabelWillBeConsideredIfGammaLabelIsDefined(long patchNumber)
{
var configuration = GitHubFlowConfigurationBuilder.New
.WithBranch("main", branchBuilder => branchBuilder
.WithVersioningMode(VersioningMode.ContinuousDelivery)
.WithLabel("gamma").WithIncrement(IncrementStrategy.Patch)
).Build();
using var fixture = new EmptyRepositoryFixture("main");
fixture.MakeACommit();
// ✅ succeeds as expected
fixture.AssertFullSemver("0.0.1-gamma.1+1", configuration);
fixture.ApplyTag($"0.0.{patchNumber}-alpha.1");
// ❌ expected: 0.0.{patchNumber}-gamma.1+1
fixture.AssertFullSemver($"0.0.{patchNumber}-gamma.1+0", configuration);
fixture.MakeACommit();
// ❌ expected: 0.0.{patchNumber}-gamma.1+2
fixture.AssertFullSemver($"0.0.{patchNumber}-gamma.1+1", configuration);
fixture.MakeACommit();
// ❌ expected: 0.0.{patchNumber}-gamma.1+3
fixture.AssertFullSemver($"0.0.{patchNumber}-gamma.1+2", configuration);
fixture.MakeATaggedCommit($"0.0.{patchNumber}-beta.1");
// ❌ expected: 0.0.{patchNumber}-gamma.1+4
fixture.AssertFullSemver($"0.0.{patchNumber}-gamma.1+0", configuration);
fixture.MakeACommit();
// ❌ expected: 0.0.{patchNumber}-gamma.1+5
fixture.AssertFullSemver($"0.0.{patchNumber}-gamma.1+1", configuration);
fixture.MakeATaggedCommit($"0.0.{patchNumber}-beta.2");
// ❌ expected: 0.0.{patchNumber}-gamma.1+6
fixture.AssertFullSemver($"0.0.{patchNumber}-gamma.1+0", configuration);
fixture.MakeACommit();
// ❌ expected: 0.0.{patchNumber}-gamma.1+7
fixture.AssertFullSemver($"0.0.{patchNumber}-gamma.1+1", configuration);
fixture.ApplyTag($"0.0.{patchNumber}");
// ✅ succeeds as expected
fixture.AssertFullSemver($"0.0.{patchNumber}", configuration);
fixture.MakeACommit();
// ✅ succeeds as expected
fixture.AssertFullSemver($"0.0.{patchNumber + 1}-gamma.1+1", configuration);
} |
This was referenced Mar 15, 2023
This was referenced Mar 17, 2023
🎉 This issue has been resolved in version 6.0.0-beta.2 🎉 Your GitReleaseManager bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When defining a label on e.g. main branch and one or more pre-release labeled tags are existing then I would expect that only the pre-release tags are considered with the same name.
This issue is related to #3436.
Expected Behavior
Actual Behavior
Possible Fix
The business logic how the pre-release label are created needs to be changed in
NextVersionCalculator::FindVersion
Steps to Reproduce
Please see the integration tests above.
Context
Your Environment
I have used the 6.0.0-beta.1 version
The text was updated successfully, but these errors were encountered: