Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Feature/merge message releases #3966

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

Closed
wants to merge 4 commits into from

Conversation

DSpirit
Copy link
Contributor

@DSpirit DSpirit commented Mar 17, 2024

Extended the TryParse operation to check whether the commit source branch is a release branch in order to support increment of merges from release into main branch when a squash merge has been applied.

Motivation and Context

Discussion

How Has This Been Tested?

  • Local tests with only one merge commit worked
  • Extended the MergeMessageBaseVersionStrategyTests.cs with a test using the false flag on IsMergeCommit

❗ I had to comment one test, as the hotfix-0.1.5 branch was somehow configured as a release branch and thus, the version was taken into respect. Would appreciate some feedback here!

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link
Member

@asbjornu asbjornu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks mostly fine!

@@ -96,13 +96,10 @@ private ReferenceName GetMergedBranchName(string mergedBranch)
mergeCommit.NotNull();
configuration.NotNull();

mergeMessage = null;
mergeMessage = new(mergeCommit.Message, configuration);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mergeMessage should not be set if the return value equals false.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood, I've changed it.

@@ -65,7 +66,7 @@ public void TakesVersionFromMergeOfReleaseBranch(string message, bool isMergeCom
AssertMergeMessage(message + "\n ", expectedVersion, parents);
}

[TestCase("Merge branch 'hotfix-0.1.5'", false)]
// [TestCase("Merge branch 'hotfix-0.1.5'", false)] this is somehow configured as a release branch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please elaborate on how hotfix-0.1.5 is configured as a release branch? Is is-release-branch set to true?

Copy link
Contributor Author

@DSpirit DSpirit Mar 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the is-release-branch is set to true.
Here's an excerpt of the generated configuration:

hotfix:
      mode: ManualDeployment
      label: beta
      increment: Inherit
      prevent-increment:
        when-current-commit-tagged: false
      regex: ^hotfix(es)?[/-](?<BranchName>.+)
      source-branches:
      - release
      - main
      - support
      - hotfix
      is-source-branch-for: []
      is-release-branch: true
      pre-release-weight: 30000

I've changed the failing test to set the hotfix branch as is-release-branch: false, however there might be a different approach that is unknown to me.

@DSpirit DSpirit requested a review from asbjornu March 29, 2024 18:12
@DSpirit
Copy link
Contributor Author

DSpirit commented Mar 29, 2024

Closing this PR in favour to #3984 with all current changes from master.

@DSpirit DSpirit closed this Mar 29, 2024
@DSpirit DSpirit deleted the feature/merge-message-releases branch March 29, 2024 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants