Skip to content

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

Closed
@HHobeck

Description

@HHobeck

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:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions