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

[Improvement] Replacing the mainline version mode with the continuous deployment mode #3308

Closed
HHobeck opened this issue Dec 9, 2022 · 4 comments · Fixed by #3883
Closed

Comments

@HHobeck
Copy link
Contributor

HHobeck commented Dec 9, 2022

Is your improvement request related to a problem? Please describe.
In the discussion of issue #2388 ([Feature] Root configuration should propagate to branches) I came up with the idea of replacing the mainline version mode with the continuous deployment mode.

(see #3235 (comment) and #2388 (comment))

Detailed Description

I would like to not having a separate main line mode and reuse the ContinuousDeployment mode for this scenario as well. If we think about it: What is the different of ContinuousDeployment and Mainline when it has been defined on the main branch?

Definition in AWS https://aws.amazon.com/devops/continuous-delivery/:

Continuous Delivery vs. Continuous Deployment
With continuous delivery, every code change is built, tested, and then pushed to a non-production testing or staging environment. There can be multiple, parallel test stages before a production deployment. The difference between continuous delivery and continuous deployment is the presence of a manual approval to update to production. With continuous deployment, production happens automatically without explicit approval.

In my opinion there is no different from the business process point of view.

Context

I think we should first do the breaking change on the versioning mode ContinuousDeployment and ensure that it behaves like the mainline mode. In a second step we can remove the mainline mode and replace it with ContinuousDeployment.

Possible Implementation

The business rules are the following to increment the next version number (ShouldIncrement is true) in MergeMessageVersionStrategy:

  • the PreventIncrementOfMergedBranchVersion of the effective branch configuration is false or
  • CurrentCommit is not equals to MergeCommit and VersioningMode of the effective branch configuration is not equals to ContinuousDelivery
    [Test]
    public void __Just_A_Test__()
    {
        var mainlineConfiguration = TestConfigurationBuilder.New
            .WithoutVersioningMode().WithTag("release", "beta").WithTag("main", "ci")
            .WithVersioningMode("release", VersioningMode.Mainline)
            .WithVersioningMode("main", VersioningMode.Mainline).Build();

        var continuousDeploymentConfiguration = TestConfigurationBuilder.New
            .WithoutVersioningMode().WithTag("release", "beta").WithTag("main", "ci")
            .WithVersioningMode("release", VersioningMode.ContinuousDeployment)
            .WithVersioningMode("main", VersioningMode.ContinuousDeployment).Build();

        var continuousDeliveryConfiguration = TestConfigurationBuilder.New
            .WithoutVersioningMode().WithTag("release", "beta").WithTag("main", "ci")
            .WithVersioningMode("release", VersioningMode.ContinuousDelivery)
            .WithVersioningMode("main", VersioningMode.ContinuousDelivery).Build();

        using var fixture = new EmptyRepositoryFixture("main");

        fixture.MakeACommit("one");
        fixture.BranchTo("release/1.0.0");
        fixture.MakeACommit("two");
        fixture.MakeACommit("three");

        fixture.Checkout("main");
        fixture.MergeNoFF("release/1.0.0");

        fixture.AssertFullSemver("1.0.0-ci", mainlineConfiguration);
        fixture.AssertFullSemver("1.0.0-ci.4", continuousDeploymentConfiguration);
        fixture.AssertFullSemver("1.0.0-ci.1+4", continuousDeliveryConfiguration);

        fixture.Repository.Branches.Remove("release/1.0.0");

        fixture.AssertFullSemver("1.0.0-ci", mainlineConfiguration); // <<---- the same sem version like ContinuousDeployment
        fixture.AssertFullSemver("1.0.0-ci.4", continuousDeploymentConfiguration);
        fixture.AssertFullSemver("1.0.0-ci.1+4", continuousDeliveryConfiguration);

        fixture.MakeACommit("four");

        fixture.AssertFullSemver("1.0.1-ci", mainlineConfiguration); // <<---- the same sem version like ContinuousDeployment
        fixture.AssertFullSemver("1.0.1-ci.1", continuousDeploymentConfiguration); // <<---- this is important
        fixture.AssertFullSemver("1.0.0-ci.1+5", continuousDeliveryConfiguration); // <<---- this is important
    }

Edit:
Final design can be found here:

@github-actions
Copy link

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.

@github-actions
Copy link

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.

@github-actions github-actions bot added the stale label Jun 30, 2023
@arturcic arturcic added stale and removed stale labels Jun 30, 2023
@HHobeck
Copy link
Contributor Author

HHobeck commented Aug 15, 2023

This is related: #3642 (Does the increment setting override Commit and Merge Descriptions?)

@arturcic
Copy link
Member

arturcic commented Mar 9, 2024

🎉 This issue has been resolved in version 6.0.0-beta.6 🎉
The release is available on:

Your GitReleaseManager bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants