BigW Consortium Gitlab

Commit 3026cb20 by Rémy Coutable

Merge branch 'jej-rename-legacy-protected-branches-api-service' into 'master'

Renamed ProtectedBranches::ApiUpdateService to LegacyApiUpdateService See merge request gitlab-org/gitlab-ce!15575
parents 505cba59 fceffe4d
# The protected branches API still uses the `developers_can_push` and `developers_can_merge`
# The branches#protect API still uses the `developers_can_push` and `developers_can_merge`
# flags for backward compatibility, and so performs translation between that format and the
# internal data model (separate access levels). The translation code is non-trivial, and so
# lives in this service.
module ProtectedBranches
class ApiCreateService < BaseService
class LegacyApiCreateService < BaseService
def execute
push_access_level =
if params.delete(:developers_can_push)
......
# The protected branches API still uses the `developers_can_push` and `developers_can_merge`
# The branches#protect API still uses the `developers_can_push` and `developers_can_merge`
# flags for backward compatibility, and so performs translation between that format and the
# internal data model (separate access levels). The translation code is non-trivial, and so
# lives in this service.
module ProtectedBranches
class ApiUpdateService < BaseService
class LegacyApiUpdateService < BaseService
def execute(protected_branch)
@developers_can_push = params.delete(:developers_can_push)
@developers_can_merge = params.delete(:developers_can_merge)
......
......@@ -81,9 +81,9 @@ module API
service_args = [user_project, current_user, protected_branch_params]
protected_branch = if protected_branch
::ProtectedBranches::ApiUpdateService.new(*service_args).execute(protected_branch)
::ProtectedBranches::LegacyApiUpdateService.new(*service_args).execute(protected_branch)
else
::ProtectedBranches::ApiCreateService.new(*service_args).execute
::ProtectedBranches::LegacyApiCreateService.new(*service_args).execute
end
if protected_branch.valid?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment