Commit c6620be0 authored by Imre Farkas's avatar Imre Farkas

Merge branch 'remove-workflow-rules-feature-flag' into 'master'

Remove all usage of :workflow_rules feature flag

Closes #29654

See merge request gitlab-org/gitlab!23278
parents 4d8ebc79 bfff6e8b
...@@ -31,9 +31,7 @@ module Gitlab ...@@ -31,9 +31,7 @@ module Gitlab
end end
def beta_enabled? def beta_enabled?
Feature.enabled?(:auto_devops_beta, project, default_enabled: true) && Feature.enabled?(:auto_devops_beta, project, default_enabled: true)
# workflow:rules are required by `Beta/Auto-DevOps.gitlab-ci.yml`
Feature.enabled?(:workflow_rules, project, default_enabled: true)
end end
end end
end end
......
...@@ -31,9 +31,7 @@ module Gitlab ...@@ -31,9 +31,7 @@ module Gitlab
end end
def beta_enabled? def beta_enabled?
Feature.enabled?(:auto_devops_beta, project, default_enabled: true) && Feature.enabled?(:auto_devops_beta, project, default_enabled: true)
# workflow:rules are required by `Beta/Auto-DevOps.gitlab-ci.yml`
Feature.enabled?(:workflow_rules, project, default_enabled: true)
end end
end end
end end
......
...@@ -9,17 +9,7 @@ module Gitlab ...@@ -9,17 +9,7 @@ module Gitlab
include Chain::Helpers include Chain::Helpers
def perform! def perform!
unless feature_enabled? error('Pipeline filtered out by workflow rules.') unless workflow_passed?
if has_workflow_rules?
error("Workflow rules are disabled", config_error: true)
end
return
end
unless workflow_passed?
error('Pipeline filtered out by workflow rules.')
end
end end
def break? def break?
...@@ -28,10 +18,6 @@ module Gitlab ...@@ -28,10 +18,6 @@ module Gitlab
private private
def feature_enabled?
Feature.enabled?(:workflow_rules, @pipeline.project, default_enabled: true)
end
def workflow_passed? def workflow_passed?
strong_memoize(:workflow_passed) do strong_memoize(:workflow_passed) do
workflow_rules.evaluate(@pipeline, global_context).pass? workflow_rules.evaluate(@pipeline, global_context).pass?
......
...@@ -100,17 +100,6 @@ describe Ci::CreatePipelineService do ...@@ -100,17 +100,6 @@ describe Ci::CreatePipelineService do
stub_ci_pipeline_yaml_file(config) stub_ci_pipeline_yaml_file(config)
end end
shared_examples 'workflow:rules feature disabled' do
before do
stub_feature_flags(workflow_rules: false)
end
it 'presents a message that rules are disabled' do
expect(pipeline.errors[:base]).to include('Workflow rules are disabled')
expect(pipeline).to be_persisted
end
end
context 'with a single regex-matching if: clause' do context 'with a single regex-matching if: clause' do
let(:config) do let(:config) do
<<-EOY <<-EOY
...@@ -241,8 +230,6 @@ describe Ci::CreatePipelineService do ...@@ -241,8 +230,6 @@ describe Ci::CreatePipelineService do
expect(pipeline.errors[:base]).to include('No stages / jobs for this pipeline.') expect(pipeline.errors[:base]).to include('No stages / jobs for this pipeline.')
expect(pipeline).not_to be_persisted expect(pipeline).not_to be_persisted
end end
it_behaves_like 'workflow:rules feature disabled'
end end
context 'where workflow passes and the job passes' do context 'where workflow passes and the job passes' do
...@@ -252,8 +239,6 @@ describe Ci::CreatePipelineService do ...@@ -252,8 +239,6 @@ describe Ci::CreatePipelineService do
expect(pipeline).to be_pending expect(pipeline).to be_pending
expect(pipeline).to be_persisted expect(pipeline).to be_persisted
end end
it_behaves_like 'workflow:rules feature disabled'
end end
context 'where workflow fails and the job fails' do context 'where workflow fails and the job fails' do
...@@ -263,8 +248,6 @@ describe Ci::CreatePipelineService do ...@@ -263,8 +248,6 @@ describe Ci::CreatePipelineService do
expect(pipeline.errors[:base]).to include('Pipeline filtered out by workflow rules.') expect(pipeline.errors[:base]).to include('Pipeline filtered out by workflow rules.')
expect(pipeline).not_to be_persisted expect(pipeline).not_to be_persisted
end end
it_behaves_like 'workflow:rules feature disabled'
end end
context 'where workflow fails and the job passes' do context 'where workflow fails and the job passes' do
...@@ -274,8 +257,6 @@ describe Ci::CreatePipelineService do ...@@ -274,8 +257,6 @@ describe Ci::CreatePipelineService do
expect(pipeline.errors[:base]).to include('Pipeline filtered out by workflow rules.') expect(pipeline.errors[:base]).to include('Pipeline filtered out by workflow rules.')
expect(pipeline).not_to be_persisted expect(pipeline).not_to be_persisted
end end
it_behaves_like 'workflow:rules feature disabled'
end end
end end
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