Commit ad65339f authored by Vasilii Iakliushin's avatar Vasilii Iakliushin

Merge branch 'group_merge_request_approval_settings-enable' into 'master'

Enable group-level MR approval settings by default

See merge request gitlab-org/gitlab!73058
parents a57e3575 b20b3440
......@@ -15,7 +15,7 @@ module EE
end
before_action only: :edit do
push_frontend_feature_flag(:group_merge_request_approval_settings_feature_flag, project.root_ancestor)
push_frontend_feature_flag(:group_merge_request_approval_settings_feature_flag, project.root_ancestor, default_enabled: :yaml)
end
feature_category :projects, [:restore]
......
......@@ -74,7 +74,7 @@ module EE
license_check_help_page_path: help_page_path('user/application_security/index', anchor: 'enabling-license-approvals-within-a-project'),
coverage_check_help_page_path: help_page_path('ci/pipelines/settings', anchor: 'coverage-check-approval-rule')
}.tap do |data|
if ::Feature.enabled?(:group_merge_request_approval_settings_feature_flag, project.root_ancestor)
if ::Feature.enabled?(:group_merge_request_approval_settings_feature_flag, project.root_ancestor, default_enabled: :yaml)
data[:approvals_path] = expose_path(api_v4_projects_merge_request_approval_setting_path(id: project.id))
data[:group_name] = project.root_ancestor.name
end
......
......@@ -3,7 +3,7 @@
module Groups
module MergeRequestApprovalSettingsHelper
def show_merge_request_approval_settings?(user, group)
Feature.enabled?(:group_merge_request_approval_settings_feature_flag, group) &&
Feature.enabled?(:group_merge_request_approval_settings_feature_flag, group, default_enabled: :yaml) &&
user.can?(:admin_merge_request_approval_settings, group)
end
end
......
......@@ -540,7 +540,7 @@ module EE
end
def reset_approvals_on_push
if ::Feature.enabled?(:group_merge_request_approval_settings_feature_flag, self.group&.root_ancestor)
if ::Feature.enabled?(:group_merge_request_approval_settings_feature_flag, self.group&.root_ancestor, default_enabled: :yaml)
!ComplianceManagement::MergeRequestApprovalSettings::Resolver.new(group, project: self)
.retain_approvals_on_push
.value && feature_available?(:merge_request_approvers)
......@@ -574,7 +574,7 @@ module EE
end
def require_password_to_approve
if ::Feature.enabled?(:group_merge_request_approval_settings_feature_flag, self&.group&.root_ancestor)
if ::Feature.enabled?(:group_merge_request_approval_settings_feature_flag, self&.group&.root_ancestor, default_enabled: :yaml)
ComplianceManagement::MergeRequestApprovalSettings::Resolver.new(group, project: self)
.require_password_to_approve
.value && password_authentication_enabled_for_web?
......@@ -737,7 +737,7 @@ module EE
def disable_overriding_approvers_per_merge_request
strong_memoize(:disable_overriding_approvers_per_merge_request) do
if ::Feature.enabled?(:group_merge_request_approval_settings_feature_flag, self)
if ::Feature.enabled?(:group_merge_request_approval_settings_feature_flag, self, default_enabled: :yaml)
super unless feature_available?(:admin_merge_request_approvers_rules)
!ComplianceManagement::MergeRequestApprovalSettings::Resolver.new(group&.root_ancestor, project: self)
......@@ -757,7 +757,7 @@ module EE
def merge_requests_author_approval
strong_memoize(:merge_requests_author_approval) do
if ::Feature.enabled?(:group_merge_request_approval_settings_feature_flag, self)
if ::Feature.enabled?(:group_merge_request_approval_settings_feature_flag, self, default_enabled: :yaml)
super unless feature_available?(:admin_merge_request_approvers_rules)
ComplianceManagement::MergeRequestApprovalSettings::Resolver.new(group&.root_ancestor, project: self)
......@@ -778,7 +778,7 @@ module EE
def merge_requests_disable_committers_approval
strong_memoize(:merge_requests_disable_committers_approval) do
if ::Feature.enabled?(:group_merge_request_approval_settings_feature_flag, self)
if ::Feature.enabled?(:group_merge_request_approval_settings_feature_flag, self, default_enabled: :yaml)
super unless feature_available?(:admin_merge_request_approvers_rules)
!ComplianceManagement::MergeRequestApprovalSettings::Resolver.new(group&.root_ancestor, project: self)
......
......@@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/247921
milestone: '13.8'
type: development
group: group::compliance
default_enabled: false
default_enabled: true
......@@ -39,7 +39,7 @@ module API
success EE::API::Entities::MergeRequestApprovalSettings
end
get do
not_found! unless ::Feature.enabled?(:group_merge_request_approval_settings_feature_flag, user_project.root_ancestor)
not_found! unless ::Feature.enabled?(:group_merge_request_approval_settings_feature_flag, user_project.root_ancestor, default_enabled: :yaml)
group = user_project.group.present? ? user_project.root_ancestor : nil
setting = ComplianceManagement::MergeRequestApprovalSettings::Resolver.new(group, project: user_project).execute
......@@ -77,7 +77,7 @@ module API
end
resource :groups, requirements: ::API::API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
before do
not_found! unless ::Feature.enabled?(:group_merge_request_approval_settings_feature_flag, user_group)
not_found! unless ::Feature.enabled?(:group_merge_request_approval_settings_feature_flag, user_group, default_enabled: :yaml)
authorize! :admin_merge_request_approval_settings, user_group
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