Commit 3eed57f6 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'refactoring-ee-entities-10' into 'master'

Separate approval setting entities into own class files

See merge request gitlab-org/gitlab!27423
parents fb8425a7 ce2c2131
---
title: Separate approval setting entities into own class files
merge_request: 27423
author: Rajendra Kadam
type: added
...@@ -262,41 +262,6 @@ module EE ...@@ -262,41 +262,6 @@ module EE
end end
end end
# Being used in private project-level approvals API.
# This overrides the `eligible_approvers` to be exposed as `approvers`.
#
# To be removed in https://gitlab.com/gitlab-org/gitlab/issues/13574.
class ProjectApprovalSettingRule < ProjectApprovalRule
expose :approvers, using: ::API::Entities::UserBasic, override: true
end
# Being used in private project-level approvals API.
#
# To be removed in https://gitlab.com/gitlab-org/gitlab/issues/13574.
class ProjectApprovalSettings < Grape::Entity
expose :rules, using: ProjectApprovalSettingRule do |project, options|
project.visible_approval_rules(target_branch: options[:target_branch])
end
expose :min_fallback_approvals, as: :fallback_approvals_required
end
# Being used in private MR-level approvals API.
# This overrides the `eligible_approvers` to be exposed as `approvers`.
#
# To be removed in https://gitlab.com/gitlab-org/gitlab/issues/13574.
class MergeRequestApprovalSettingRule < MergeRequestApprovalStateRule
expose :approvers, using: ::API::Entities::UserBasic, override: true
end
# Being used in private MR-level approvals API.
# This overrides the `rules` to be exposed using MergeRequestApprovalSettingRule.
#
# To be removed in https://gitlab.com/gitlab-org/gitlab/issues/13574.
class MergeRequestApprovalSettings < MergeRequestApprovalState
expose :wrapped_approval_rules, as: :rules, using: MergeRequestApprovalSettingRule, override: true
end
module ConanPackage module ConanPackage
class ConanPackageManifest < Grape::Entity class ConanPackageManifest < Grape::Entity
expose :package_urls, merge: true expose :package_urls, merge: true
......
# frozen_string_literal: true
module EE
module API
module Entities
# Being used in private MR-level approvals API.
# This overrides the `eligible_approvers` to be exposed as `approvers`.
#
# To be removed in https://gitlab.com/gitlab-org/gitlab/issues/13574.
class MergeRequestApprovalSettingRule < MergeRequestApprovalStateRule
expose :approvers, using: ::API::Entities::UserBasic, override: true
end
end
end
end
# frozen_string_literal: true
module EE
module API
module Entities
# Being used in private MR-level approvals API.
# This overrides the `rules` to be exposed using MergeRequestApprovalSettingRule.
#
# To be removed in https://gitlab.com/gitlab-org/gitlab/issues/13574.
class MergeRequestApprovalSettings < MergeRequestApprovalState
expose :wrapped_approval_rules, as: :rules, using: MergeRequestApprovalSettingRule, override: true
end
end
end
end
# frozen_string_literal: true
module EE
module API
module Entities
# Being used in private project-level approvals API.
# This overrides the `eligible_approvers` to be exposed as `approvers`.
#
# To be removed in https://gitlab.com/gitlab-org/gitlab/issues/13574.
class ProjectApprovalSettingRule < ProjectApprovalRule
expose :approvers, using: ::API::Entities::UserBasic, override: true
end
end
end
end
# frozen_string_literal: true
module EE
module API
module Entities
# Being used in private project-level approvals API.
#
# To be removed in https://gitlab.com/gitlab-org/gitlab/issues/13574.
class ProjectApprovalSettings < Grape::Entity
expose :rules, using: ProjectApprovalSettingRule do |project, options|
project.visible_approval_rules(target_branch: options[:target_branch])
end
expose :min_fallback_approvals, as: :fallback_approvals_required
end
end
end
end
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