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