Commit efa2471b authored by Max Woolf's avatar Max Woolf

Enables custom compliance frameworks by default

Changes all feature checks to read from the flag's
YAAML file and enables the feature by default for all
users.
parent c294612d
...@@ -48,11 +48,10 @@ Compliance framework labels do not affect your project settings. ...@@ -48,11 +48,10 @@ Compliance framework labels do not affect your project settings.
#### Custom compliance frameworks #### Custom compliance frameworks
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/276221) in GitLab 13.9. > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/276221) in GitLab 13.9.
> - It's [deployed behind a feature flag](../../feature_flags.md), disabled by default. > - [Deployed behind a feature flag](../../feature_flags.md).
> - It can be enabled or disabled for a single group > - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/287779) in GitLab 13.11.
> - It's disabled on GitLab.com. > - Enabled on GitLab.com.
> - It's not recommended for production use. > - Recommended for production use.
> - To use it in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enable-or-disable-custom-compliance-frameworks). **(PREMIUM)**
WARNING: WARNING:
This feature might not be available to you. Check the **version history** note above for details. This feature might not be available to you. Check the **version history** note above for details.
......
...@@ -6,7 +6,7 @@ module ComplianceManagement ...@@ -6,7 +6,7 @@ module ComplianceManagement
condition(:custom_compliance_frameworks_enabled) do condition(:custom_compliance_frameworks_enabled) do
@subject.namespace.feature_available?(:custom_compliance_frameworks) && @subject.namespace.feature_available?(:custom_compliance_frameworks) &&
Feature.enabled?(:ff_custom_compliance_frameworks, @subject.namespace) Feature.enabled?(:ff_custom_compliance_frameworks, @subject.namespace, default_enabled: :yaml)
end end
condition(:group_level_compliance_pipeline_enabled) do condition(:group_level_compliance_pipeline_enabled) do
......
...@@ -126,7 +126,7 @@ module EE ...@@ -126,7 +126,7 @@ module EE
condition(:compliance_framework_available) do condition(:compliance_framework_available) do
@subject.feature_available?(:custom_compliance_frameworks) && @subject.feature_available?(:custom_compliance_frameworks) &&
::Feature.enabled?(:ff_custom_compliance_frameworks, @subject) ::Feature.enabled?(:ff_custom_compliance_frameworks, @subject, default_enabled: :yaml)
end end
condition(:group_level_compliance_pipeline_available) do condition(:group_level_compliance_pipeline_available) do
......
...@@ -8,7 +8,7 @@ module EE ...@@ -8,7 +8,7 @@ module EE
condition(:over_storage_limit, scope: :subject) { @subject.over_storage_limit? } condition(:over_storage_limit, scope: :subject) { @subject.over_storage_limit? }
condition(:compliance_framework_available) do condition(:compliance_framework_available) do
@subject.feature_available?(:custom_compliance_frameworks) && @subject.feature_available?(:custom_compliance_frameworks) &&
::Feature.enabled?(:ff_custom_compliance_frameworks, @subject) ::Feature.enabled?(:ff_custom_compliance_frameworks, @subject, default_enabled: :yaml)
end end
rule { admin & is_gitlab_com }.enable :update_subscription_limit rule { admin & is_gitlab_com }.enable :update_subscription_limit
......
...@@ -61,7 +61,7 @@ module EE ...@@ -61,7 +61,7 @@ module EE
end end
condition(:custom_compliance_framework_available) do condition(:custom_compliance_framework_available) do
::Feature.enabled?(:ff_custom_compliance_frameworks) ::Feature.enabled?(:ff_custom_compliance_frameworks, default_enabled: :yaml)
end end
with_scope :subject with_scope :subject
......
...@@ -81,7 +81,7 @@ module EE ...@@ -81,7 +81,7 @@ module EE
framework_identifier = settings.delete(:framework) framework_identifier = settings.delete(:framework)
if framework_identifier.blank? if framework_identifier.blank?
settings.merge!(_destroy: true) settings.merge!(_destroy: true)
elsif ::Feature.enabled?(:ff_custom_compliance_frameworks, project.namespace) elsif ::Feature.enabled?(:ff_custom_compliance_frameworks, project.namespace, default_enabled: :yaml)
settings[:compliance_management_framework] = project.namespace.root_ancestor.compliance_management_frameworks.find(framework_identifier) settings[:compliance_management_framework] = project.namespace.root_ancestor.compliance_management_frameworks.find(framework_identifier)
else else
settings[:compliance_management_framework] = ComplianceManagement::Framework.find_or_create_legacy_default_framework(project, framework_identifier) settings[:compliance_management_framework] = ComplianceManagement::Framework.find_or_create_legacy_default_framework(project, framework_identifier)
......
- user_has_edit_permissions = current_user.can?(:admin_compliance_framework, @project) - user_has_edit_permissions = current_user.can?(:admin_compliance_framework, @project)
.row .row
.form-group.col-md-9.gl-mb-6 .form-group.col-md-9.gl-mb-6
- if Feature.enabled?(:ff_custom_compliance_frameworks, @project.namespace) - if Feature.enabled?(:ff_custom_compliance_frameworks, @project.namespace, default_enabled: :yaml)
- frameworks = @project.namespace.root_ancestor.compliance_management_frameworks - frameworks = @project.namespace.root_ancestor.compliance_management_frameworks
- if user_has_edit_permissions - if user_has_edit_permissions
= f.fields_for :compliance_framework_setting, ComplianceManagement::ComplianceFramework::ProjectSettings.new do |cf| = f.fields_for :compliance_framework_setting, ComplianceManagement::ComplianceFramework::ProjectSettings.new do |cf|
......
---
title: Enable custom compliance frameworks
merge_request:
author:
type: added
...@@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/287779 ...@@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/287779
milestone: '13.7' milestone: '13.7'
type: development type: development
group: group::compliance group: group::compliance
default_enabled: false default_enabled: true
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