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 ...@@ -95,7 +95,7 @@ module EE
attrs += compliance_framework_params attrs += compliance_framework_params
if ::Gitlab::Ci::Features.auto_rollback_available?(project) if project&.feature_available?(:auto_rollback)
attrs << :auto_rollback_enabled attrs << :auto_rollback_enabled
end end
......
...@@ -25,7 +25,7 @@ module EE ...@@ -25,7 +25,7 @@ module EE
end end
def auto_rollback_enabled? def auto_rollback_enabled?
super && ::Gitlab::Ci::Features.auto_rollback_available?(project) super && project.feature_available?(:auto_rollback)
end end
private 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) } %section.settings.no-animate#auto-rollback-settings{ class: ('expanded' if expanded) }
.settings-header .settings-header
%h4 %h4
......
...@@ -28,34 +28,15 @@ RSpec.describe 'Automatic Deployment Rollbacks' do ...@@ -28,34 +28,15 @@ RSpec.describe 'Automatic Deployment Rollbacks' do
end end
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 before do
stub_feature_flags(cd_auto_rollback: false)
stub_licensed_features(auto_rollback: false) stub_licensed_features(auto_rollback: false)
end end
it_behaves_like 'the auto rollback feature is not available' it_behaves_like 'the auto rollback feature is not available'
end end
context 'when cd_auto_rollback is disabled and auto_rollback is enabled' do context 'when project has a license for auto_rollback feature' 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
before do before do
stub_licensed_features(auto_rollback: true) stub_licensed_features(auto_rollback: true)
project.add_maintainer(user) project.add_maintainer(user)
......
...@@ -75,17 +75,5 @@ RSpec.describe EE::AlertManagement::Alert do ...@@ -75,17 +75,5 @@ RSpec.describe EE::AlertManagement::Alert do
subject subject
end end
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
end end
...@@ -81,26 +81,25 @@ RSpec.describe ProjectCiCdSetting do ...@@ -81,26 +81,25 @@ RSpec.describe ProjectCiCdSetting do
let(:project) { create(:project) } let(:project) { create(:project) }
where(:license_feature, :feature_flag, :actual_setting) do where(:license_feature, :actual_setting) do
true | true | true true | true
false | true | true false | true
true | false | true true | true
false | false | true false | true
true | true | false true | false
false | true | false false | false
true | false | false true | false
false | false | false false | false
end end
with_them do with_them do
before do before do
stub_licensed_features(auto_rollback: license_feature) stub_licensed_features(auto_rollback: license_feature)
stub_feature_flags(cd_auto_rollback: feature_flag)
project.auto_rollback_enabled = actual_setting project.auto_rollback_enabled = actual_setting
end end
it 'is only enabled if set and both the license and the feature flag allows' do 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 end
end end
......
...@@ -55,10 +55,6 @@ module Gitlab ...@@ -55,10 +55,6 @@ module Gitlab
::Feature.enabled?(:ci_trace_log_invalid_chunks, project, type: :ops, default_enabled: false) ::Feature.enabled?(:ci_trace_log_invalid_chunks, project, type: :ops, default_enabled: false)
end 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) def self.seed_block_run_before_workflow_rules_enabled?(project)
::Feature.enabled?(:ci_seed_block_run_before_workflow_rules, project, default_enabled: true) ::Feature.enabled?(:ci_seed_block_run_before_workflow_rules, project, default_enabled: true)
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