[go: up one dir, main page]

Skip to content

Default target branch selection - use first "parent" branch

Problem to solve

At our place we have several branches and do not always merge into "master". So in 90% of the time the pre-selected "master" is wrong.

Intended users

All developers creating merge requests.

Further details

I create from RELEASE/MyApp/1.2 a new development branch (i.e. DEV/MyApp/1.2/TASK-1) to develop a feature for 1.2, I later want to merge this again back to 1.2 and not to master. But when creating a new MR, the default branch (master) will be selected.

Proposal

Gitlab should check which is the nearest parent to my current branch (i.e. DEV/MyApp/1.2/TASK-1) -- which will be RELEASE/MyApp/1.2 as this was the source of branching there. So it should propose RELEASE/MyApp/1.2 as default target branch.

Permissions and Security

Developer permissions

Documentation

It should be documented, which parameter changes the behaviour of selecting "default" branch as default target or the nearest parent branch. Also that feature itself should be documented.

Testing

When creating a new MR the target branch will be the nearest parent branch. That behaviour should be configurable to allow others still to have master as default, if they want.

What does success look like, and how can we measure that?

Configure default behaviour of target branch, change to "nearest parent branch" instead of "master".

Create a example release branch like: RELEASE/MyApp/1.2

Create a new branch on top of this branch with for example "DEV/MyApp/1.2/TASK-1"

Create a MR for DEV/MyApp/1.2/TASK-1 Expection: Default target should be RELEASE/MyApp/1.2

Links / references