Commit 95ef9b02 authored by Max Woolf's avatar Max Woolf

Merge branch 'mw/remove-compliance-pipeline-ff' into 'master'

Remove ff_evaluate_group_level_compliance_pipeline feature flag

See merge request gitlab-org/gitlab!67984
parents 800a2070 8cdef86d
...@@ -60,14 +60,9 @@ read-only view to discourage this behavior. ...@@ -60,14 +60,9 @@ read-only view to discourage this behavior.
#### Compliance pipeline configuration **(ULTIMATE)** #### Compliance pipeline configuration **(ULTIMATE)**
> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/3156) in GitLab 13.9. > - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/3156) in GitLab 13.9, disabled behind `ff_evaluate_group_level_compliance_pipeline` [feature flag](../../../administration/feature_flags.md).
> - [Deployed behind a feature flag](../../feature_flags.md).
> - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/300324) in GitLab 13.11. > - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/300324) in GitLab 13.11.
> - Enabled on GitLab.com. > - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/331231) in GitLab 14.2.
> - Recommended for production use.
WARNING:
This feature might not be available to you. Check the **version history** note above for details.
Group owners can use the compliance pipeline configuration to define compliance requirements Group owners can use the compliance pipeline configuration to define compliance requirements
such as scans or tests, and enforce them in individual projects. such as scans or tests, and enforce them in individual projects.
......
...@@ -9,8 +9,7 @@ module ComplianceManagement ...@@ -9,8 +9,7 @@ module ComplianceManagement
end end
condition(:group_level_compliance_pipeline_enabled) do condition(:group_level_compliance_pipeline_enabled) do
@subject.namespace.feature_available?(:evaluate_group_level_compliance_pipeline) && @subject.namespace.feature_available?(:evaluate_group_level_compliance_pipeline)
Feature.enabled?(:ff_evaluate_group_level_compliance_pipeline, @subject.namespace, default_enabled: :yaml)
end end
rule { can?(:owner_access) & custom_compliance_frameworks_enabled }.policy do rule { can?(:owner_access) & custom_compliance_frameworks_enabled }.policy do
......
...@@ -130,8 +130,7 @@ module EE ...@@ -130,8 +130,7 @@ module EE
end end
condition(:group_level_compliance_pipeline_available) do condition(:group_level_compliance_pipeline_available) do
@subject.feature_available?(:evaluate_group_level_compliance_pipeline) && @subject.feature_available?(:evaluate_group_level_compliance_pipeline)
::Feature.enabled?(:ff_evaluate_group_level_compliance_pipeline, @subject, default_enabled: :yaml)
end end
rule { public_group | logged_in_viewable }.policy do rule { public_group | logged_in_viewable }.policy do
......
---
name: ff_evaluate_group_level_compliance_pipeline
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/52629
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/300324
milestone: '13.9'
type: development
group: group::compliance
default_enabled: true
...@@ -32,8 +32,7 @@ module Gitlab ...@@ -32,8 +32,7 @@ module Gitlab
end end
def available? def available?
project.feature_available?(:evaluate_group_level_compliance_pipeline) && project.feature_available?(:evaluate_group_level_compliance_pipeline)
::Feature.enabled?(:ff_evaluate_group_level_compliance_pipeline, project, default_enabled: :yaml)
end end
end end
end end
......
...@@ -36,7 +36,6 @@ RSpec.describe ::Gitlab::Ci::Pipeline::Chain::Config::Content do ...@@ -36,7 +36,6 @@ RSpec.describe ::Gitlab::Ci::Pipeline::Chain::Config::Content do
context 'when feature is available' do context 'when feature is available' do
before do before do
stub_feature_flags(ff_evaluate_group_level_compliance_pipeline: true)
stub_licensed_features(evaluate_group_level_compliance_pipeline: true) stub_licensed_features(evaluate_group_level_compliance_pipeline: true)
end end
...@@ -82,32 +81,20 @@ RSpec.describe ::Gitlab::Ci::Pipeline::Chain::Config::Content do ...@@ -82,32 +81,20 @@ RSpec.describe ::Gitlab::Ci::Pipeline::Chain::Config::Content do
end end
end end
context 'when feature is not available' do context 'when feature is not licensed' do
using RSpec::Parameterized::TableSyntax
where(:licensed, :feature_flag) do
true | false
false | true
false | false
end
with_them do
before do before do
stub_feature_flags(ff_evaluate_group_level_compliance_pipeline: licensed) stub_licensed_features(evaluate_group_level_compliance_pipeline: false)
stub_licensed_features(evaluate_group_level_compliance_pipeline: feature_flag)
end end
it_behaves_like 'does not include compliance pipeline configuration content' it_behaves_like 'does not include compliance pipeline configuration content'
end end
end end
end
context 'when project does not have compliance label defined' do context 'when project does not have compliance label defined' do
let(:project) { create(:project, ci_config_path: ci_config_path) } let(:project) { create(:project, ci_config_path: ci_config_path) }
context 'when feature is available' do context 'when feature is available' do
before do before do
stub_feature_flags(ff_evaluate_group_level_compliance_pipeline: true)
stub_licensed_features(evaluate_group_level_compliance_pipeline: true) stub_licensed_features(evaluate_group_level_compliance_pipeline: true)
end end
......
...@@ -1612,16 +1612,15 @@ RSpec.describe GroupPolicy do ...@@ -1612,16 +1612,15 @@ RSpec.describe GroupPolicy do
shared_examples 'compliance framework permissions' do shared_examples 'compliance framework permissions' do
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
where(:role, :licensed, :feature_flag, :admin_mode, :allowed) do where(:role, :licensed, :admin_mode, :allowed) do
:owner | true | true | nil | true :owner | true | nil | true
:owner | false | true | nil | false :owner | false | nil | false
:owner | false | false | nil | false :admin | true | true | true
:admin | true | true | true | true :admin | true | false | false
:admin | true | true | false | false :maintainer | true | nil | false
:maintainer | true | true | nil | false :developer | true | nil | false
:developer | true | true | nil | false :reporter | true | nil | false
:reporter | true | true | nil | false :guest | true | nil | false
:guest | true | true | nil | false
end end
with_them do with_them do
...@@ -1629,7 +1628,6 @@ RSpec.describe GroupPolicy do ...@@ -1629,7 +1628,6 @@ RSpec.describe GroupPolicy do
before do before do
stub_licensed_features(licensed_feature => licensed) stub_licensed_features(licensed_feature => licensed)
stub_feature_flags(feature_flag_name => feature_flag) if feature_flag_name
enable_admin_mode!(current_user) if admin_mode enable_admin_mode!(current_user) if admin_mode
end end
...@@ -1648,7 +1646,6 @@ RSpec.describe GroupPolicy do ...@@ -1648,7 +1646,6 @@ RSpec.describe GroupPolicy do
context ':admin_compliance_pipeline_configuration' do context ':admin_compliance_pipeline_configuration' do
let(:policy) { :admin_compliance_pipeline_configuration } let(:policy) { :admin_compliance_pipeline_configuration }
let(:licensed_feature) { :evaluate_group_level_compliance_pipeline } let(:licensed_feature) { :evaluate_group_level_compliance_pipeline }
let(:feature_flag_name) { :ff_evaluate_group_level_compliance_pipeline }
include_examples 'compliance framework permissions' include_examples 'compliance framework permissions'
end end
......
...@@ -65,14 +65,6 @@ RSpec.describe 'Create a Compliance Framework' do ...@@ -65,14 +65,6 @@ RSpec.describe 'Create a Compliance Framework' do
stub_licensed_features(custom_compliance_frameworks: true, evaluate_group_level_compliance_pipeline: true) stub_licensed_features(custom_compliance_frameworks: true, evaluate_group_level_compliance_pipeline: true)
end end
context 'pipeline configuration feature is disabled' do
before do
stub_feature_flags(ff_evaluate_group_level_compliance_pipeline: false)
end
it_behaves_like 'a mutation that returns errors in the response', errors: ['Pipeline configuration full path feature is not available']
end
context 'current_user is namespace owner' do context 'current_user is namespace owner' do
it_behaves_like 'a mutation that creates a compliance framework' it_behaves_like 'a mutation that creates a compliance framework'
end end
......
...@@ -91,19 +91,6 @@ RSpec.describe 'Update a compliance framework' do ...@@ -91,19 +91,6 @@ RSpec.describe 'Update a compliance framework' do
expect(mutation_response['errors']).to contain_exactly "Pipeline configuration full path feature is not available" expect(mutation_response['errors']).to contain_exactly "Pipeline configuration full path feature is not available"
end end
end end
context 'when compliance pipeline configuration feature flag is not enabled' do
before do
stub_licensed_features(custom_compliance_frameworks: true, evaluate_group_level_compliance_pipeline: true)
stub_feature_flags(ff_evaluate_group_level_compliance_pipeline: false)
end
it 'returns an error' do
subject
expect(mutation_response['errors']).to contain_exactly "Pipeline configuration full path feature is not available"
end
end
end end
context 'current_user is not permitted to update framework' do context 'current_user is not permitted to update framework' do
......
...@@ -31,7 +31,6 @@ RSpec.describe Ci::CreatePipelineService do ...@@ -31,7 +31,6 @@ RSpec.describe Ci::CreatePipelineService do
let(:service) { described_class.new(project, user, { ref: 'master' }) } let(:service) { described_class.new(project, user, { ref: 'master' }) }
before do before do
stub_feature_flags(ff_evaluate_group_level_compliance_pipeline: true)
stub_licensed_features(evaluate_group_level_compliance_pipeline: true) stub_licensed_features(evaluate_group_level_compliance_pipeline: true)
allow_next(Repository).to receive(:blob_data_at).with(ref_sha, '.compliance-gitlab-ci.yml').and_return(compliance_config) allow_next(Repository).to receive(:blob_data_at).with(ref_sha, '.compliance-gitlab-ci.yml').and_return(compliance_config)
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