Skip to content

[Bug] The project status checks setting frontend does not support multiple protected branches

Problem description

The project setting > merge requests > status checks frontend does not support multiple protected branches, however the API does which creates a confusing user experience. It's possible to create / update a status check with multiple branches using the API while the frontend will only display a single branch:

  • The status checks list only shows the first protected branch in the array.
  • The update modal only shows the last protected branch as selected.

Clicking update on the update modal does not override the protected branches array. Only selecting a branch will.

Screenshots

List Update form (with debug render)
image image

How to recreated

  1. Create a status check with multiple protected branches using the API.
  2. View the project > merge request > status checks setting.
  3. Observe that only one branch is listed.
  4. Click on Edit.
  5. Observe that only one branch is selected.

Example branch array for http://localhost:3000/gitlab-org/gitlab-shell:

Click to expand
[
  { "id": 10, "name": "master", "push_access_levels": [], "merge_access_levels": [], "allow_force_push": false, "unprotect_access_levels": [], "code_owner_approval_required": false },
  { "id": 2, "name": "main", "push_access_levels": [ { "access_level": 40, "access_level_description": "Maintainers", "user_id": null, "group_id": null } ], "merge_access_levels": [ { "access_level": 40, "access_level_description": "Maintainers", "user_id": null, "group_id": null } ], "allow_force_push": false, "unprotect_access_levels": [], "code_owner_approval_required": false }
]

Proposal

Implementation plan

Todo

Edited by Jiaan Louw