Given a super simple rule for requiring review before merging to main, set up as follows:
we are denied any merges from any branch into any other main sub branch, e.g. I cannot merge main/featureA to main/featureB, even though it specifically states only to apply this rule if the destination is
main, no wildcards.
Could you also show this configuration?
Can you confirm that you are creating a code review and marking it as reviewed before merging your branches?
I cannot reproduce the issue with your same configuration.
No, my point is that I only want the rule to apply to merges to main. I do not want to require reviews of one sub branch into another sub branch. As it is, this rule also blocks cherry picking from one sub branch to another etc.
So all merges targeting main must have a review, any other merge should not require a review.
I’m afraid that the merge condition “Only allow merge if reviewed” is independent of the “allow merge from this branch” condition.
According to your configuration, you are only allowing merging a branch only if the source branch is reviewed.
But it specifically states:
And we have specified exactly that any sub branch of main requires review if targeting main. It behaves as though the destination branch filter is ignored, which surely is a bug?
Having a filter like this that blocks all merges including cherry picks, makes no sense.
I have never heard of anyone who would want to require reviews for e.g. cherry picks between feature branches, but if the destination filter is respected this would be easily doable by main*
Most teams, I am sure, will however only want to guard the main branch with rules, and leave other branches alone.
@carlosalba1985 any thoughts on the above?
Hi, I understand your point and I agree that most customers may want to apply the code review restrictions only when merging to the main line. But I’m afraid at the moment both rules are independent and the moment. Let me escalate your feedback with the product team.
1 Like
Hi @carlosalba1985 , we’re running into the same issue. I’m not sure what you mean when you say “both rules are independent at the moment”, the issue is that the rule is behaving differently than expected. We expect that this rule only requires code reviews for merging into the branch called “main”, however it is affecting all child branches too. I expect that the rule would only affect child branches if the branch pattern is “main/*”
As OP says: “I cannot merge main/featureA to main/featureB, even though it specifically states only to apply this rule if the destination is main, no wildcards.” This is… a pretty big problem IMO.
Hi @kumori_kuma , I know it’s very confusing now. Currently, this page contains 2 different configuration settings that are not related.
- Merge condition. It will be applied to all the branches in the repo you select.
- Allow merges between Source/destination branches. You can configure from where you can run the merges and destination branches. This configuration setting is independent of 1.
As I mentioned, let me escalate your feedback to the product team.