diff --git a/docs/input/docs/img/DocumentationSamplesForGitFlow_DevelopBranch.png b/docs/input/docs/img/DocumentationSamplesForGitFlow_DevelopBranch.png new file mode 100644 index 0000000000..124c10cca2 Binary files /dev/null and b/docs/input/docs/img/DocumentationSamplesForGitFlow_DevelopBranch.png differ diff --git a/docs/input/docs/img/DocumentationSamplesForGitFlow_FeatureFromDevelopBranch.png b/docs/input/docs/img/DocumentationSamplesForGitFlow_FeatureFromDevelopBranch.png new file mode 100644 index 0000000000..2a499a520a Binary files /dev/null and b/docs/input/docs/img/DocumentationSamplesForGitFlow_FeatureFromDevelopBranch.png differ diff --git a/docs/input/docs/img/DocumentationSamplesForGitFlow_FeatureFromMainBranch.png b/docs/input/docs/img/DocumentationSamplesForGitFlow_FeatureFromMainBranch.png new file mode 100644 index 0000000000..ab22724ec9 Binary files /dev/null and b/docs/input/docs/img/DocumentationSamplesForGitFlow_FeatureFromMainBranch.png differ diff --git a/docs/input/docs/img/DocumentationSamplesForGitFlow_HotfixBranch.png b/docs/input/docs/img/DocumentationSamplesForGitFlow_HotfixBranch.png new file mode 100644 index 0000000000..1a0109bf9a Binary files /dev/null and b/docs/input/docs/img/DocumentationSamplesForGitFlow_HotfixBranch.png differ diff --git a/docs/input/docs/img/DocumentationSamplesForGitFlow_ReleaseBranch.png b/docs/input/docs/img/DocumentationSamplesForGitFlow_ReleaseBranch.png new file mode 100644 index 0000000000..24b77c37b1 Binary files /dev/null and b/docs/input/docs/img/DocumentationSamplesForGitFlow_ReleaseBranch.png differ diff --git a/docs/input/docs/img/DocumentationSamplesForGitFlow_SupportBranch.png b/docs/input/docs/img/DocumentationSamplesForGitFlow_SupportBranch.png new file mode 100644 index 0000000000..e38e6cc065 Binary files /dev/null and b/docs/input/docs/img/DocumentationSamplesForGitFlow_SupportBranch.png differ diff --git a/docs/input/docs/img/DocumentationSamplesForGitFlow_VersionedHotfixBranch.png b/docs/input/docs/img/DocumentationSamplesForGitFlow_VersionedHotfixBranch.png new file mode 100644 index 0000000000..f9a695b7da Binary files /dev/null and b/docs/input/docs/img/DocumentationSamplesForGitFlow_VersionedHotfixBranch.png differ diff --git a/docs/input/docs/img/DocumentationSamplesForGitFlow_VersionedReleaseBranch.png b/docs/input/docs/img/DocumentationSamplesForGitFlow_VersionedReleaseBranch.png new file mode 100644 index 0000000000..c9d0ca996e Binary files /dev/null and b/docs/input/docs/img/DocumentationSamplesForGitFlow_VersionedReleaseBranch.png differ diff --git a/docs/input/docs/learn/branching-strategies/gitflow/examples.md b/docs/input/docs/learn/branching-strategies/gitflow/examples.md index a2915f17bd..971be376ae 100644 --- a/docs/input/docs/learn/branching-strategies/gitflow/examples.md +++ b/docs/input/docs/learn/branching-strategies/gitflow/examples.md @@ -6,61 +6,97 @@ RedirectFrom: - docs/git-branching-strategies/gitflow-examples --- -These examples are using the _default_ configuration with GitVersion. Which is -[continuous deployment](/docs/reference/modes/continuous-deployment) mode for -`develop` and [continuous delivery](/docs/reference/modes/continuous-delivery) mode -for all other branches. - -This default configuration allows you to publish CI builds from develop to a CI -MyGet feed, or another CI feed. Then all other branches are manually released -then tagged. Read more about this at [version increments](/docs/reference/version-increments). +These examples are illustrating the usage of the supported `GitFlow` workflow +in GitVersion. To enable this workflow, the builtin template +[GitFlow/v1](/docs/workflows/GitFlow/v1.json) needs to be referenced in the +configuration as follows: +```yaml +workflow: GitFlow/v1 +mode: ContinuousDelivery +``` + +Where +the [continuous deployment][continuous-deployment] mode for no branches, +the [continuous delivery][continuous-delivery] mode for +`main`, `support` and `develop` branches and +the [manual deployment][manual-deployment] mode +for `release`, `feature`, `hotfix` and `unknown` branches are specified. + +This configuration allows you to publish CI (Continuous Integration) builds +from `main`, `support` and `develop` branches to an artifact repository. +All other branches are manually published. Read more about this at +[version increments](/docs/reference/version-increments). + +:::{.alert .alert-info} +The _continuous delivery_ mode has been used for the `main` and the +`support` branch in this examples (specified as a fallback on the root +configuration layer) to illustrate how the version increments are applied. +In production context the _continuous deployment_ mode might be a better +option when e.g. the release process is automated or the commits are tagged +by the pipeline automatically. +::: ## Feature Branches -Feature branches will take the feature branch name and use that as the -pre-release tag. +Feature branches can be used in the `GitFlow` workflow to implement a +feature in an isolated environment. Feature branches will take the feature +branch name and use that as the pre-release label. Feature branches will be +created from a `develop`, `release`, `main`, `support` or `hotfix` branch. -![GitFlow](/docs/img/05119d0cd4ecaaefff94\_feature-branch.png) +### Create feature branch from main -Notice after the feature branch is merged, the version on `develop` is -`1.3.0-alpha.3`. This is due to `develop` running in _continuous deployment_ -mode. If you configured `develop` to use _continuous delivery_ the version would -still be `1.3.0-alpha.1` and you would have to use release tags to increment the -`alpha.1`. +![GitFlow](/docs/img/DocumentationSamplesForGitFlow\_FeatureFromMainBranch.png) -You can see the difference on the feature branch itself, notice the version is -the same before and after the commit on the feature branch? Only the metadata -has changed. If you released the feature branch artifacts then tagged the -commit, the following commit would increase to `-beta.2`. +:::{.alert .alert-info} +After the feature branch is merged, the version on `main` is `2.0.0-5`. +This is due to `main` running in _continuous delivery_ mode. If `main` was +configured to use _continuous deployment_ the version would be `2.0.0`. +::: -## Pull Request +### Create feature branch from develop -Because feature branches are most likely pushed to a fork, we are showing the -pull request branch name which is created when you submit a pull request +![GitFlow](/docs/img/DocumentationSamplesForGitFlow\_FeatureFromDevelopBranch.png) -![GitFlow](/docs/img/09fdf46995b771f3164a_pull-request.png) +:::{.alert .alert-info} +After the feature branch is merged, the version on `develop` is +`1.3.0-alpha.3`. This is due to `develop` running in _continuous delivery_ +mode. If `develop` was configured to use _manual deployment_ the version +would still be `1.3.0-alpha.1` and you would have to use pre-release tags +to increment the pre-release label `alpha.1`. +::: ## Hotfix Branches -Hotfix branches are used when you need to do a _patch_ release in GitFlow and -are always created off `main` +Hotfix branches are used when you need to do a _patch_ release in the +`GitFlow` workflow and are always created from `main` branch. + +### Create hotfix branch + +![GitFlow](/docs/img/DocumentationSamplesForGitFlow\_HotfixBranch.png) + +### Create hotfix branch with version number + +![GitFlow](/docs/img/DocumentationSamplesForGitFlow\_VersionedHotfixBranch.png) -![GitFlow](/docs/img/f26ae57adbd9b74f74c4\_hotfix.png) +## Release Branches -## Minor Release Branches +Release branches are used for major and minor releases to stabilize a RC +(Release Candidate) or to integrate features (in parallel) targeting different +iterations. Release branches are taken from `main` (or from `develop`) and will +be merged back afterwards. Finally the `main` branch is tagged with the +released version. -Release branches are used for both major and minor releases for stabilisation -before a release. Release branches are taken off `develop` then merged to both -`develop` and `main`. Finally `main` is tagged with the released version. +### Create release branch -![GitFlow](/docs/img/6d33d35a70a777608fa1\_minor-release.png) +![GitFlow](/docs/img/DocumentationSamplesForGitFlow\_ReleaseBranch.png) -## Major Release Branches +### Create release branch with version -Major releases are just like minor releases, the difference is you bump the -major in the release branch name. +![GitFlow](/docs/img/DocumentationSamplesForGitFlow\_VersionedReleaseBranch.png) -![GitFlow](/docs/img/39f9d8b8b007c82f1f80\_major-release.png) +## Develop Branch + +![GitFlow](/docs/img/DocumentationSamplesForGitFlow\_DevelopBranch.png) ## Support Branches @@ -71,17 +107,15 @@ majors, then name your branch `support/.x` (i.e `support/1.x`), to support minors use `support/..x` or `support/..0`. (i.e `support/1.3.x` or `support/1.3.0`) -### Hotfix - -Depending on what you name your support branch, you may or may not need a hotfix -branch. Naming it `support/1.x` will automatically bump the patch, if you name -it `support/1.3.0` then the version in branch name rule will kick in and the -patch _will not_ automatically bump, meaning you have to use hotfix branches. -![GitFlow](/docs/img/b035b8ca99bd34239518\_support-hotfix.png) +![GitFlow](/docs/img/DocumentationSamplesForGitFlow\_SupportBranch.png) -### Minor Release - -![GitFlow](/docs/img/2167fb1c4a5cf84edfd8\_support-minor.png) +:::{.alert .alert-info} +Depending on what you name your support branch, you may or may not need a +hotfix branch. Naming it `support/1.x` will automatically bump the patch, +if you name it `support/1.3.0` then the version in branch name rule will +kick in and the patch _will not_ automatically bump, meaning you have to +use hotfix branches. +::: ## To Contribute @@ -89,5 +123,8 @@ See [contributing examples](/docs/learn/branching-strategies/contribute-examples ### Source -See `DocumentationSamples.GitFlowExample`. To update, modify then run test. -Update +See `DocumentationSamplesForGitFlow.cs`. To update, modify then run test. + +[continuous-deployment]: /docs/reference/modes/continuous-deployment +[continuous-delivery]: /docs/reference/modes/continuous-delivery +[manual-deployment]: /docs/reference/modes/manual-deployment diff --git a/docs/input/docs/reference/configuration.md b/docs/input/docs/reference/configuration.md index 2ff06ffe35..57df2661aa 100644 --- a/docs/input/docs/reference/configuration.md +++ b/docs/input/docs/reference/configuration.md @@ -70,6 +70,7 @@ strategies: - VersionInBranchName branches: develop: + mode: ContinuousDelivery label: alpha increment: Minor prevent-increment: diff --git a/src/GitVersion.Configuration/Workflows/GitFlow/v1.yml b/docs/input/docs/workflows/GitFlow/v1.yml similarity index 99% rename from src/GitVersion.Configuration/Workflows/GitFlow/v1.yml rename to docs/input/docs/workflows/GitFlow/v1.yml index 78406ad6a1..897bb5e169 100644 --- a/src/GitVersion.Configuration/Workflows/GitFlow/v1.yml +++ b/docs/input/docs/workflows/GitFlow/v1.yml @@ -20,6 +20,7 @@ strategies: - VersionInBranchName branches: develop: + mode: ContinuousDelivery label: alpha increment: Minor prevent-increment: diff --git a/src/GitVersion.Configuration/Workflows/GitHubFlow/v1.yml b/docs/input/docs/workflows/GitHubFlow/v1.yml similarity index 100% rename from src/GitVersion.Configuration/Workflows/GitHubFlow/v1.yml rename to docs/input/docs/workflows/GitHubFlow/v1.yml diff --git a/src/GitVersion.Configuration/Workflows/TrunkBased/v1.yml b/docs/input/docs/workflows/TrunkBased/v1.yml similarity index 100% rename from src/GitVersion.Configuration/Workflows/TrunkBased/v1.yml rename to docs/input/docs/workflows/TrunkBased/v1.yml diff --git a/src/GitVersion.Configuration.Tests/Configuration/ConfigurationProviderTests.CanWriteOutEffectiveConfiguration.approved.txt b/src/GitVersion.Configuration.Tests/Configuration/ConfigurationProviderTests.CanWriteOutEffectiveConfiguration.approved.txt index 78406ad6a1..897bb5e169 100644 --- a/src/GitVersion.Configuration.Tests/Configuration/ConfigurationProviderTests.CanWriteOutEffectiveConfiguration.approved.txt +++ b/src/GitVersion.Configuration.Tests/Configuration/ConfigurationProviderTests.CanWriteOutEffectiveConfiguration.approved.txt @@ -20,6 +20,7 @@ strategies: - VersionInBranchName branches: develop: + mode: ContinuousDelivery label: alpha increment: Minor prevent-increment: diff --git a/src/GitVersion.Configuration.Tests/Configuration/ConfigurationProviderTests.cs b/src/GitVersion.Configuration.Tests/Configuration/ConfigurationProviderTests.cs index 754eb114fe..a07d47d8c9 100644 --- a/src/GitVersion.Configuration.Tests/Configuration/ConfigurationProviderTests.cs +++ b/src/GitVersion.Configuration.Tests/Configuration/ConfigurationProviderTests.cs @@ -50,7 +50,7 @@ public void OverwritesDefaultsWithProvidedConfig() developConfiguration.Increment.ShouldBe(IncrementStrategy.Major); developConfiguration.Increment.ShouldNotBe(defaultConfiguration.Branches["develop"].Increment); developConfiguration.DeploymentMode.ShouldBe(DeploymentMode.ContinuousDelivery); - developConfiguration.DeploymentMode.ShouldNotBe(defaultConfiguration.Branches["develop"].DeploymentMode); + developConfiguration.DeploymentMode.ShouldNotBe(defaultConfiguration.Branches["feature"].DeploymentMode); developConfiguration.Label.ShouldBe("dev"); } diff --git a/src/GitVersion.Configuration/Builders/GitFlowConfigurationBuilder.cs b/src/GitVersion.Configuration/Builders/GitFlowConfigurationBuilder.cs index 2cba13d408..e29e124530 100644 --- a/src/GitVersion.Configuration/Builders/GitFlowConfigurationBuilder.cs +++ b/src/GitVersion.Configuration/Builders/GitFlowConfigurationBuilder.cs @@ -44,6 +44,7 @@ private GitFlowConfigurationBuilder() WithBranch(DevelopBranch.Name).WithConfiguration(new BranchConfiguration { Increment = IncrementStrategy.Minor, + DeploymentMode = DeploymentMode.ContinuousDelivery, RegularExpression = DevelopBranch.RegexPattern, SourceBranches = [this.MainBranch.Name], Label = "alpha", diff --git a/src/GitVersion.Configuration/GitVersion.Configuration.csproj b/src/GitVersion.Configuration/GitVersion.Configuration.csproj index 9047c953a2..17d9bbd4c4 100644 --- a/src/GitVersion.Configuration/GitVersion.Configuration.csproj +++ b/src/GitVersion.Configuration/GitVersion.Configuration.csproj @@ -9,16 +9,10 @@ - + - - - - - - @@ -34,4 +28,22 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/GitVersion.Core.Tests/IntegrationTests/DocumentationSamplesForGitFlow.cs b/src/GitVersion.Core.Tests/IntegrationTests/DocumentationSamplesForGitFlow.cs index b72cb67ccf..1931cec402 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/DocumentationSamplesForGitFlow.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/DocumentationSamplesForGitFlow.cs @@ -75,6 +75,8 @@ public void FeatureFromMainBranch(bool withPullRequestIntoMain) fixture.SequenceDiagram.Activate("main"); fixture.MakeACommit(); fixture.AssertFullSemver("2.0.0-6", configuration); + fixture.ApplyTag("2.0.0"); + fixture.AssertFullSemver("2.0.0", configuration); } [TestCase(false)] @@ -148,6 +150,179 @@ public void FeatureFromMainBranchWithMainline(bool withPullRequestIntoMain) fixture.AssertFullSemver("2.0.1-1", configuration); } + [TestCase(false)] + [TestCase(true)] + public void FeatureFromDevelopBranch(bool withPullRequestIntoDevelop) + { + var configuration = GitFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.SequenceDiagram.Participant("main"); + fixture.SequenceDiagram.Participant("develop"); + + // GitFlow setup + fixture.SequenceDiagram.Activate("main"); + fixture.Repository.MakeACommit(); + fixture.ApplyTag("1.2.0"); + fixture.AssertFullSemver("1.2.0", configuration); + + // Branch from main to develop + fixture.BranchTo("develop", "develop"); + fixture.SequenceDiagram.Activate("develop"); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("1.3.0-alpha.0", configuration); + + // Branch from develop to feature + const string branchName = "feature/foo"; + fixture.BranchTo(branchName, "feature"); + fixture.SequenceDiagram.Activate("feature"); + fixture.SequenceDiagram.Deactivate("develop"); + fixture.AssertFullSemver("1.3.0-foo.1+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.3.0-foo.1+1", configuration); + + // Create hotfix on main branch + fixture.Checkout("main"); + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit("+semver: minor"); + fixture.AssertFullSemver("1.3.0-1", configuration); + fixture.ApplyTag("1.3.0"); + fixture.AssertFullSemver("1.3.0", configuration); + + // Merge main to develop branch + fixture.MergeTo("develop"); + fixture.SequenceDiagram.Deactivate("main"); + fixture.SequenceDiagram.Activate("develop"); + fixture.AssertFullSemver("1.4.0-alpha.1", configuration); + + // Merge develop to feature branch + fixture.MergeTo(branchName); + fixture.SequenceDiagram.Deactivate("develop"); + fixture.AssertFullSemver("1.4.0-foo.1+3", configuration); + + // Bump to major version increment + fixture.MakeACommit("+semver: major"); + fixture.AssertFullSemver("2.0.0-foo.1+4", configuration); + + // Create pre-release on feature branch + fixture.ApplyTag("2.1.0-foo.1"); + fixture.AssertFullSemver("2.1.0-foo.2+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.1.0-foo.2+1", configuration); + fixture.Checkout("develop"); + + if (withPullRequestIntoDevelop) + { + // Create a PullRequest into develop + fixture.BranchTo("pull/2/merge", "pull"); + fixture.SequenceDiagram.Activate("pull/2/merge"); + fixture.MergeNoFF(branchName); + fixture.AssertFullSemver("2.1.0-PullRequest2.6", configuration); + fixture.Checkout("develop"); + fixture.Remove("pull/2/merge"); + } + + // Merge feature into develop branch + fixture.MergeNoFF(branchName); + fixture.Remove(branchName); + fixture.SequenceDiagram.NoteOver("Feature branches should\r\nbe deleted once merged", branchName); + fixture.AssertFullSemver("2.1.0-alpha.6", configuration); + + // Commit on develop branch + fixture.SequenceDiagram.Activate("develop"); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.1.0-alpha.7", configuration); + } + + [TestCase(false)] + [TestCase(true)] + public void FeatureFromDevelopBranchWithMainline(bool withPullRequestIntoDevelop) + { + var configuration = GitFlowConfigurationBuilder.New + .WithNextVersion("1.2.0") + .WithVersionStrategies(VersionStrategies.ConfiguredNextVersion, VersionStrategies.Mainline) + .WithBranch("feature", _ => _.WithIncrement(IncrementStrategy.Minor)) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + fixture.SequenceDiagram.Participant("main"); + fixture.SequenceDiagram.Participant("develop"); + + // GitFlow setup + fixture.SequenceDiagram.Activate("main"); + fixture.Repository.MakeACommit(); + fixture.ApplyTag("1.2.0"); + fixture.AssertFullSemver("1.2.0", configuration); + + // Branch from main to develop + fixture.BranchTo("develop", "develop"); + fixture.SequenceDiagram.Activate("develop"); + fixture.SequenceDiagram.Deactivate("main"); + fixture.AssertFullSemver("1.3.0-alpha.0", configuration); + + // Branch from develop to feature + const string branchName = "feature/foo"; + fixture.BranchTo(branchName, "feature"); + fixture.SequenceDiagram.Activate("feature"); + fixture.SequenceDiagram.Deactivate("develop"); + fixture.AssertFullSemver("1.3.0-foo.1+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.3.0-foo.1+1", configuration); + + // Create hotfix on main branch + fixture.Checkout("main"); + fixture.SequenceDiagram.Activate("main"); + fixture.MakeACommit("+semver: minor"); + fixture.AssertFullSemver("1.3.0-1", configuration); + + // Merge main to develop branch + fixture.MergeTo("develop"); + fixture.SequenceDiagram.Deactivate("main"); + fixture.SequenceDiagram.Activate("develop"); + fixture.AssertFullSemver("1.4.0-alpha.1", configuration); + + // Merge develop to feature branch + fixture.Checkout("main"); + fixture.MergeTo(branchName); + fixture.SequenceDiagram.Deactivate("develop"); + fixture.AssertFullSemver("1.4.0-foo.1+2", configuration); + + // Bump to major version increment + fixture.MakeACommit("+semver: major"); + fixture.AssertFullSemver("2.0.0-foo.1+3", configuration); + + // Create pre-release on feature branch + fixture.ApplyTag("2.1.0-foo.1"); + fixture.AssertFullSemver("2.1.0-foo.2+0", configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.1.0-foo.2+1", configuration); + fixture.Checkout("develop"); + + if (withPullRequestIntoDevelop) + { + // Create a PullRequest into develop + fixture.BranchTo("pull/2/merge", "pull"); + fixture.SequenceDiagram.Activate("pull/2/merge"); + fixture.MergeNoFF(branchName); + fixture.AssertFullSemver("2.1.0-PullRequest2.6", configuration); + fixture.Checkout("develop"); + fixture.Remove("pull/2/merge"); + } + + // Merge feature into develop branch + fixture.MergeNoFF(branchName); + fixture.Remove(branchName); + fixture.SequenceDiagram.NoteOver("Feature branches should\r\nbe deleted once merged", branchName); + fixture.AssertFullSemver("2.1.0-alpha.6", configuration); + + // Commit on develop branch + fixture.SequenceDiagram.Activate("develop"); + fixture.MakeACommit(); + fixture.AssertFullSemver("2.1.0-alpha.7", configuration); + } + [TestCase(false)] [TestCase(true)] public void HotfixBranch(bool withPullRequestIntoMain) @@ -216,6 +391,8 @@ public void HotfixBranch(bool withPullRequestIntoMain) fixture.SequenceDiagram.Activate("main"); fixture.MakeACommit(); fixture.AssertFullSemver("2.0.0-6", configuration); + fixture.ApplyTag("2.0.0"); + fixture.AssertFullSemver("2.0.0", configuration); } [TestCase(false)] @@ -357,6 +534,8 @@ public void VersionedHotfixBranch(bool withPullRequestIntoMain) fixture.SequenceDiagram.Activate("main"); fixture.MakeACommit(); fixture.AssertFullSemver("3.0.1-6", configuration); + fixture.ApplyTag("3.0.1"); + fixture.AssertFullSemver("3.0.1", configuration); } [TestCase(false)] @@ -498,6 +677,8 @@ public void ReleaseBranch(bool withPullRequestIntoMain) fixture.SequenceDiagram.Activate("main"); fixture.MakeACommit(); fixture.AssertFullSemver("2.0.1-6", configuration); + fixture.ApplyTag("2.0.1"); + fixture.AssertFullSemver("2.0.1", configuration); } [TestCase(false)] @@ -639,6 +820,8 @@ public void VersionedReleaseBranch(bool withPullRequestIntoMain) fixture.SequenceDiagram.Activate("main"); fixture.MakeACommit(); fixture.AssertFullSemver("3.0.1-6", configuration); + fixture.ApplyTag("3.0.1"); + fixture.AssertFullSemver("3.0.1", configuration); } [TestCase(false)] @@ -767,13 +950,15 @@ public void DevelopBranch(bool withPullRequestIntoMain) // Create hotfix on main branch fixture.MakeACommit(); fixture.AssertFullSemver("1.3.1-1", configuration); + fixture.ApplyTag("1.3.1"); + fixture.AssertFullSemver("1.3.1", configuration); // Merge main to release branch fixture.MergeTo(branchName); fixture.SequenceDiagram.Deactivate("main"); - fixture.AssertFullSemver("1.4.0-alpha.3", configuration); + fixture.AssertFullSemver("1.4.0-alpha.2", configuration); fixture.MakeACommit("+semver: major"); - fixture.AssertFullSemver("2.0.0-alpha.4", configuration); + fixture.AssertFullSemver("2.0.0-alpha.3", configuration); // Create pre-release on release branch fixture.ApplyTag("2.1.0-alpha.1"); @@ -788,7 +973,7 @@ public void DevelopBranch(bool withPullRequestIntoMain) fixture.BranchTo("pull/2/merge", "pull"); fixture.SequenceDiagram.Activate("pull/2/merge"); fixture.MergeNoFF(branchName); - fixture.AssertFullSemver("2.1.0-PullRequest2.6", configuration); + fixture.AssertFullSemver("2.1.0-PullRequest2.5", configuration); fixture.Checkout("main"); fixture.Remove("pull/2/merge"); } @@ -796,12 +981,14 @@ public void DevelopBranch(bool withPullRequestIntoMain) // Merge develop into main branch fixture.MergeNoFF(branchName); fixture.SequenceDiagram.Deactivate(branchName); - fixture.AssertFullSemver("2.1.0-6", configuration); + fixture.AssertFullSemver("2.1.0-5", configuration); // Commit on main branch fixture.SequenceDiagram.Activate("main"); fixture.MakeACommit(); - fixture.AssertFullSemver("2.1.0-7", configuration); + fixture.AssertFullSemver("2.1.0-6", configuration); + fixture.ApplyTag("2.1.0"); + fixture.AssertFullSemver("2.1.0", configuration); } [TestCase(false)] @@ -972,10 +1159,14 @@ public void SupportBranch(bool withPullRequestIntoSupport) fixture.Checkout("support/1.x"); fixture.MakeACommit(); fixture.AssertFullSemver("1.2.4-1", configuration); + fixture.ApplyTag("1.2.4"); + fixture.AssertFullSemver("1.2.4", configuration); fixture.Checkout("main"); fixture.MergeNoFF("support/1.x"); fixture.AssertFullSemver("2.0.2-2", configuration); + fixture.ApplyTag("2.0.2"); + fixture.AssertFullSemver("2.0.2", configuration); } [TestCase(false)]