Commit b58105ee authored by Phil Hughes's avatar Phil Hughes

Merge branch 'remove-cd_auto_rollback-feature-flag' into 'master'

Remove cd_auto_rollback feature flag

See merge request gitlab-org/gitlab!49098
parents c69f85f2 9dcb4445
---
name: cd_auto_rollback
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45816
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/35404
milestone: '13.6'
type: development
group: group::progressive delivery
default_enabled: false
......@@ -95,7 +95,7 @@ module EE
attrs += compliance_framework_params
if ::Gitlab::Ci::Features.auto_rollback_available?(project)
if project&.feature_available?(:auto_rollback)
attrs << :auto_rollback_enabled
end
......
......@@ -25,7 +25,7 @@ module EE
end
def auto_rollback_enabled?
super && ::Gitlab::Ci::Features.auto_rollback_available?(project)
super && project.feature_available?(:auto_rollback)
end
private
......
- if Gitlab::Ci::Features.auto_rollback_available?(@project)
- if @project.feature_available?(:auto_rollback)
%section.settings.no-animate#auto-rollback-settings{ class: ('expanded' if expanded) }
.settings-header
%h4
......
......@@ -28,34 +28,15 @@ RSpec.describe 'Automatic Deployment Rollbacks' do
end
end
context 'when cd_auto_rollback and auto_rollback are disabled' do
context 'when project does not have a license for auto_rollback feature' do
before do
stub_feature_flags(cd_auto_rollback: false)
stub_licensed_features(auto_rollback: false)
end
it_behaves_like 'the auto rollback feature is not available'
end
context 'when cd_auto_rollback is disabled and auto_rollback is enabled' do
before do
stub_licensed_features(auto_rollback: true)
stub_feature_flags(cd_auto_rollback: false)
end
it_behaves_like 'the auto rollback feature is not available'
end
context 'when cd_auto_rollback is enabled and auto_rollback is disabled' do
before do
stub_feature_flags(cd_auto_rollback: true)
stub_licensed_features(auto_rollback: false)
end
it_behaves_like 'the auto rollback feature is not available'
end
context 'when cd_auto_rollback and auto_rollback are enabled' do
context 'when project has a license for auto_rollback feature' do
before do
stub_licensed_features(auto_rollback: true)
project.add_maintainer(user)
......
......@@ -75,17 +75,5 @@ RSpec.describe EE::AlertManagement::Alert do
subject
end
end
context 'when feature flag is disabled' do
before do
stub_feature_flags(cd_auto_rollback: false)
end
it 'does not execute AutoRollbackWorker' do
expect(Deployments::AutoRollbackWorker).not_to receive(:perform_async)
subject
end
end
end
end
......@@ -81,26 +81,25 @@ RSpec.describe ProjectCiCdSetting do
let(:project) { create(:project) }
where(:license_feature, :feature_flag, :actual_setting) do
true | true | true
false | true | true
true | false | true
false | false | true
true | true | false
false | true | false
true | false | false
false | false | false
where(:license_feature, :actual_setting) do
true | true
false | true
true | true
false | true
true | false
false | false
true | false
false | false
end
with_them do
before do
stub_licensed_features(auto_rollback: license_feature)
stub_feature_flags(cd_auto_rollback: feature_flag)
project.auto_rollback_enabled = actual_setting
end
it 'is only enabled if set and both the license and the feature flag allows' do
expect(project.auto_rollback_enabled?).to be(actual_setting && license_feature && feature_flag)
expect(project.auto_rollback_enabled?).to be(actual_setting && license_feature)
end
end
end
......
......@@ -55,10 +55,6 @@ module Gitlab
::Feature.enabled?(:ci_trace_log_invalid_chunks, project, type: :ops, default_enabled: false)
end
def self.auto_rollback_available?(project)
::Feature.enabled?(:cd_auto_rollback, project) && project&.feature_available?(:auto_rollback)
end
def self.seed_block_run_before_workflow_rules_enabled?(project)
::Feature.enabled?(:ci_seed_block_run_before_workflow_rules, project, default_enabled: true)
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