-
Notifications
You must be signed in to change notification settings - Fork 654
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
Conversation
There was a problem hiding this 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); |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
Closing this PR in favour to #3984 with all current changes from master. |
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?
MergeMessageBaseVersionStrategyTests.cs
with a test using thefalse
flag onIsMergeCommit
❗ 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: