Skip to content

Group level branch name template

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Release notes

Group level branch name template.

Problem to solve

As a group owner, I want to define a group level branch name template, so I don't have to do it for every project.

I'm hoping I'm filling this out right.

Intended users

If above seems incorrect, please do correct it.

User experience goal

In a new project under a group, when creating the first issue, the users' flow shouldn't be interrupted by "can't create branch", due to the fact that the branch name template hasn't been created yet for that project.

Proposal

Correct below if I'm doing this wrong, I haven't mastered any of the journeys. 😅

  • Install
  • UX

Further details

Currently, on a group level, you can only set the "Branch name" (found in a group, under Settings → Repository → Pre-defined push rules).

E.g. one could have this regular expression under "Branch name": (feature\/.*|hotfix\/.*|bugfix\/.*|support\/.*|master|main|develop)

By default, a new project doesn't have a branch name template, and an empty one wouldn't match above regex (unless it for some reason is called master, main, or develop).

This ruins the flow in the start of a project, when creating the first merge request from an issue, because it creates a branch in the format %{id}-%{title}, which doesn't match above regex.

Therefore, if a group level branch name template was available and set (not empty), projects in that group would inherit it, so that it could match the group level "Branch name" setting.

Project would then create branches with, e.g., this format: feature/%{id}-%{title}, and would not interrupt GitLab flow when creating the first issue and merge request in a project.

Permissions and Security

  • Add expected impact to members with no access (0)
  • Add expected impact to Guest (10) members
  • Add expected impact to Reporter (20) members
  • Add expected impact to Developer (30) members
  • Add expected impact to Maintainer (40) members
  • Add expected impact to Owner (50) members

Documentation

I suppose a change must be made here: https://docs.gitlab.com/user/project/repository/branches/default/

Or perhaps a new section in the documentation about branch name defaults, if the same naming and location as projects is used (eg. in a group: Settings → Repository → Branch defaults, which would be the same from a project).

But I assume it can be put into the thing I linked to.

Availability & Testing

Available Tier

I suppose the project aspect of this feature is already on the Free tier, so I will assume that. Otherwise, I, along with my team, would greatly appreciate it if it were on Premium.

Feature Usage Metrics

I'm not sure how GitLab will track this, but here is my assumption:

  • A group owner (or one with permissions) creates a group level branch name template
  • Someone creates a project, an issue, and then attempts to directly create a merge request, without changing settings
  • The new branch and merge request are created with the specified group level branch name template

The last two steps I assume can contain places that can track whether the first step is effective.

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

  • A group owner can create a group level branch name template
  • Someone with permission can create a new project without changing any settings
  • Someone with permission can create an issue in the newly created project
  • Someone with permission can create a merge request from the issue
    • When the merge request is about to be made, it displays the branch name in the group level branch name template format
    • When the merge request is made, the branch is named according to the group level branch name template format

What is the type of buyer?

Free tier would be 🤩, otherwise Premium tier would be 🥳.

Is this a cross-stage feature?

What is the competitive advantage or differentiation for this feature?

Links / references

Edited by 🤖 GitLab Bot 🤖