An error occurred while fetching the assigned iteration of the selected issue.
Protect repository branch API is broken in 8.11.2
I try to change developers access rights to the branch (branch is already protected) from API invoking PUT on URL /api/v3/projects/4/repository/branches/develop/protect?developers_can_push=false&developers_can_merge=false
. Return Code is 200
Return JSON is:
{
... ,
"protected":true,
"developers_can_push":false,
"developers_can_merge":false
}
But after I go to Protected Branches webpage I get error 500:
Started GET "/testgroup/testproj/protected_branches" for 172.22.0.1 at 2016-08-26 16:29:35 +0300
Processing by Projects::ProtectedBranchesController#index as HTML
Parameters: {"namespace_id"=>"testgroup", "project_id"=>"testproj"}
Started POST "/ci/api/v1/builds/register.json" for 172.22.0.1 at 2016-08-26 16:29:35 +0300
Completed 500 Internal Server Error in 46ms (ActiveRecord: 3.5ms)
ActionView::Template::Error (undefined method `access_level' for nil:NilClass):
1: %td
2: = hidden_field_tag "allowed_to_merge_#{protected_branch.id}", protected_branch.merge_access_levels.first.access_level
3: = dropdown_tag( (protected_branch.merge_access_levels.first.humanize || 'Select') ,
4: options: { toggle_class: 'js-allowed-to-merge', dropdown_class: 'dropdown-menu-selectable js-allowed-to-merge-container',
5: data: { field_name: "allowed_to_merge_#{protected_branch.id}", access_level_id: protected_branch.merge_access_levels.first.id }})
app/views/projects/protected_branches/_update_protected_branch.html.haml:2:in `_app_views_projects_protected_branches__update_protected_branch_html_haml___3410792559071457406_73761040'
app/views/projects/protected_branches/_protected_branch.html.haml:17:in `_app_views_projects_protected_branches__protected_branch_html_haml___3222223957557972014_74550480'
app/views/projects/protected_branches/_branches_list.html.haml:26:in `_app_views_projects_protected_branches__branches_list_html_haml__2697643060528969635_75384520'
app/views/projects/protected_branches/index.html.haml:20:in `_app_views_projects_protected_branches_index_html_haml__2519777649921942714_78656860'
lib/gitlab/request_profiler/middleware.rb:15:in `call'
lib/gitlab/middleware/go.rb:16:in `call'
If I try to protect unprotected branch my PUT request ends with error 500.