-
- Downloads
There was an error fetching the commit references. Please try again later.
Backport changes from gitlab-org/gitlab-ee!581 to CE.
!581 has a lot of changes that would cause merge conflicts if not properly backported to CE. This commit/MR serves as a better foundation for gitlab-org/gitlab-ee!581. = Changes = 1. Move from `has_one {merge,push}_access_level` to `has_many`, with the `length` of the association limited to `1`. This is _effectively_ a `has_one` association, but should cause less conflicts with EE, which is set to `has_many`. This has a number of related changes in the views, specs, and factories. 2. Make `gon` variable loading more consistent (with EE!581) in the `ProtectedBranchesController`. Also use `::` to prefix the `ProtectedBranches` services, because this is required in EE. 3. Extract a `ProtectedBranchAccess` concern from the two access level models. This concern only has a single `humanize` method here, but will have more methods in EE. 4. Add `form_errors` to the protected branches creation form. This is not strictly required for EE compatibility, but was an oversight nonetheless.
Showing
- app/assets/javascripts/protected_branch_create.js.es6 2 additions, 2 deletionsapp/assets/javascripts/protected_branch_create.js.es6
- app/assets/javascripts/protected_branch_edit.js.es6 6 additions, 4 deletionsapp/assets/javascripts/protected_branch_edit.js.es6
- app/controllers/projects/protected_branches_controller.rb 16 additions, 10 deletionsapp/controllers/projects/protected_branches_controller.rb
- app/models/concerns/protected_branch_access.rb 7 additions, 0 deletionsapp/models/concerns/protected_branch_access.rb
- app/models/protected_branch.rb 7 additions, 4 deletionsapp/models/protected_branch.rb
- app/models/protected_branch/merge_access_level.rb 2 additions, 4 deletionsapp/models/protected_branch/merge_access_level.rb
- app/models/protected_branch/push_access_level.rb 2 additions, 4 deletionsapp/models/protected_branch/push_access_level.rb
- app/services/protected_branches/create_service.rb 1 addition, 17 deletionsapp/services/protected_branches/create_service.rb
- app/views/projects/protected_branches/_create_protected_branch.html.haml 5 additions, 4 deletions...cts/protected_branches/_create_protected_branch.html.haml
- app/views/projects/protected_branches/_protected_branch.html.haml 6 additions, 6 deletions...s/projects/protected_branches/_protected_branch.html.haml
- lib/api/entities.rb 2 additions, 2 deletionslib/api/entities.rb
- spec/factories/protected_branches.rb 5 additions, 5 deletionsspec/factories/protected_branches.rb
- spec/features/protected_branches_spec.rb 8 additions, 5 deletionsspec/features/protected_branches_spec.rb
- spec/services/git_push_service_spec.rb 3 additions, 3 deletionsspec/services/git_push_service_spec.rb
Please register or sign in to comment