Merge branch '18193-no-one-can-push' into 'master'
Allow creating protected branches that can't be pushed to
## What does this MR do?
- Add "No one can push" as a setting to protected branches.
- This applies to Masters (as well as all other users)
## What are the relevant issue numbers?
Closes #18193
## Does this need an EE merge request?
Yes. gitlab-org/gitlab-ee!569
## Screenshots
![Screen_Shot_2016-07-29_at_3.14.59_PM](/uploads/2e8774c311763bc6e570501a2e6cabf7/Screen_Shot_2016-07-29_at_3.14.59_PM.png)
## TODO
- [ ] #18193 !5081 No one can push to protected branches
- [x] Implementation
- [x] Model changes
- [x] Remove "developers_can_merge" and "developers_can_push"
- [x] Replace with `ProtectedBranchPushAccess` and `ProtectedBranchMergeAccess`
- [x] Reversible migration
- [x] Raise error on failure
- [x] MySQL
- [x] Backend changes
- [x] Creating a protected branch creates access rows
- [x] Add `no_one` as an access level
- [x] Enforce "no one can push"
- [x] Allow setting levels while creating protected branches?
- [x] Frontend
- [x] Replace checkboxes with `select`s
- [x] Add tests
- [x] `GitPushService` -> new projects' default branch protection
- [x] Fix existing tests
- [x] Refactor
- [x] Test workflows by hand
- [x] from the Web UI
- [x] When "Allowed to Push" is "No one"
- [x] Developers can't push
- [x] Masters can't push
- [x] When "Allowed to Push" is "Developers + Masters"
- [x] Developers can push
- [x] Masters can push
- [x] When "Allowed to Push" is "Masters"
- [x] Developers can't push
- [x] Masters can push
- [x] When "Allowed to Merge" is "Masters" and "Allowed to Push" is "Masters"
- [x] Developers can't push
- [x] Developers can't merge
- [x] Masters can merge
- [x] Masters can push
- [x] When "Allowed to Merge" is "Developers + Masters" and "Allowed to Push" is "Masters"
- [x] Developers can't push
- [x] Developers can merge
- [x] Masters can merge
- [x] Masters can push
- [x] When "Allowed to Merge" is "Developers + Masters" and "Allowed to Push" is "No one"
- [x] Developers can't push
- [x] Developers can merge
- [x] Masters can merge
- [x] Masters can't push
- [x] When "Allowed to Merge" is "Masters" and "Allowed to Push" is "No one"
- [x] Developers can't push
- [x] Developers can't merge
- [x] Masters can merge
- [x] Masters can't push
- [x] from CLI
- [x] When "Allowed to Push" is "No one"
- [x] Developers can't push
- [x] Masters can't push
- [x] When "Allowed to Push" is "Developers + Masters"
- [x] Developers can push
- [x] Masters can push
- [x] When "Allowed to Push" is "Masters"
- [x] Developers can't push
- [x] Masters can push
- [x] When "Allowed to Merge" is "Masters" and "Allowed to Push" is "Masters"
- [x] Developers can't push
- [x] Developers can't merge
- [x] Masters can merge
- [x] Masters can push
- [x] When "Allowed to Merge" is "Developers + Masters" and "Allowed to Push" is "Masters"
- [x] Developers can't push
- [x] Developers can't merge
- [x] Masters can merge
- [x] Masters can push
- [x] When "Allowed to Merge" is "Developers + Masters" and "Allowed to Push" is "No one"
- [x] Developers can't push
- [x] Developers can't merge
- [x] Masters can't merge
- [x] Masters can't push
- [x] When "Allowed to Merge" is "Masters" and "Allowed to Push" is "No one"
- [x] Developers can't push
- [x] Developers can't merge
- [x] Masters can't merge
- [x] Masters can't push
- [x] Add tests for owners and admins
- [x] CHANGELOG
- [x] Screenshots
- [x] Documentation
- [x] Wait for ~~!4665~~ to be merged in
- [x] Wait for ~~gitlab-org/gitlab-ce#19872~~ and ~~gitlab-org/gitlab-ee!564~~ to be closed
- [x] Rebase against master instead of !4892
- [x] Make sure [build](https://gitlab.com/gitlab-org/gitlab-ce/commit/a4ca206fd1cc0332d1e385ddbc0f2e4065c3ae73/builds) is green
- [x] Create EE MR
- [x] Cherry pick commits
- [x] Make sure [build](https://gitlab.com/gitlab-org/gitlab-ee/commit/4e17190d7dc546c1f977edcafd1cbcea4bdb4043/builds) is green
- [x] Address @axil's comments
- [x] Assign to endboss
- [x] Wait for @dbalexandre's review
- [x] Address @dbalexandre's comments
- [x] Address @axil's comments
- [x] Align dropdowns
- [x] No flash when protected branch is updated
- [x] Resolve conflicts
- [x] Implement protect/unprotect API
- [x] Address @dbalexandre's comments
- [x] Update EE MR
- [x] Address @rymai's comments
- [x] Create/Update service should return a `ProtectedBranch`
- [x] Successfuly protected branch creation shouldn't `load_protected_branches`
- [x] Rename `allowed_to_merge` as #minimum_access_level_for_merge
- [x] Rename `allowed_to_push` as #minimum_access_level_for_push
- [x] Use `inclusion` and `Gitlab::Access` instead of an `enum`
- [x] Modify `check_access` to work with `Gitlab::Access`
- [x] Pass `@protected_branch` to `#execute` in `UpdateService`
- [x] simplify with a nested field `protected_branch[push_access_level][access_level]`
- [x] `developers_can_{merge,push}` should be handled in the API
- [x] Use `can?(current_user, ...)` instead of `current_user.can?(...)`
- [x] Instantiate `ProtectedBranchesAccessSelect` in `dispatcher.js`
- [x] constants regarding downtime migrations
- [x] Explicit `#down` for columns with default
- [x] Update EE MR
- [ ] Wait for CE merge
- [ ] Wait for EE merge
- [ ] Create issue for UI changes proposed by @zyv
See merge request !5081
Showing
Please
register
or
sign in
to comment