Commit 4b939871 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'jivanvl-remove-raise-job-rules-warning-ff' into 'master'

Raise job rules without workflow warnings by default [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!61945
parents 12370f3d bf779d0b
---
name: ci_raise_job_rules_without_workflow_rules_warning
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/38387
rollout_issue_url:
milestone: '13.3'
type: development
group: group::continuous integration
default_enabled: true
......@@ -98,7 +98,6 @@ module Gitlab
def validate_against_warnings
# If rules are valid format and workflow rules are not specified
return unless rules_value
return unless Gitlab::Ci::Features.raise_job_rules_without_workflow_rules_warning?
last_rule = rules_value.last
......
......@@ -22,10 +22,6 @@ module Gitlab
Feature.enabled?(:merge_base_pipeline_for_metrics_comparison, project, default_enabled: :yaml)
end
def self.raise_job_rules_without_workflow_rules_warning?
::Feature.enabled?(:ci_raise_job_rules_without_workflow_rules_warning, default_enabled: true)
end
# NOTE: The feature flag `disallow_to_create_merge_request_pipelines_in_target_project`
# is a safe switch to disable the feature for a particular project when something went wrong,
# therefore it's not supposed to be enabled by default.
......
......@@ -271,10 +271,8 @@ RSpec.describe Gitlab::Ci::Config::Entry::Processable do
context 'when workflow rules is not used' do
let(:workflow) { double('workflow', 'has_rules?' => false) }
let(:feature_flag_value) { true }
before do
stub_feature_flags(ci_raise_job_rules_without_workflow_rules_warning: feature_flag_value)
entry.compose!(deps)
end
......@@ -298,12 +296,6 @@ RSpec.describe Gitlab::Ci::Config::Entry::Processable do
it 'raises a warning' do
expect(entry.warnings).to contain_exactly(/may allow multiple pipelines/)
end
context 'when feature flag is disabled' do
let(:feature_flag_value) { false }
it_behaves_like 'has no warnings'
end
end
context 'and its value is `never`' do
......
......@@ -485,10 +485,6 @@ module Gitlab
end
describe '#warnings' do
before do
stub_feature_flags(ci_raise_job_rules_without_workflow_rules_warning: true)
end
context 'when a warning is raised in a given entry' do
let(:config) do
<<-EOYML
......@@ -602,27 +598,6 @@ module Gitlab
it_behaves_like 'has warnings and expected error', /build job: need test is not defined in prior stages/
end
end
context 'when feature flag is disabled' do
before do
stub_feature_flags(ci_raise_job_rules_without_workflow_rules_warning: false)
end
context 'job rules used without workflow rules' do
let(:config) do
<<-EOYML
rspec:
script: rspec
rules:
- when: always
EOYML
end
it 'does not raise the warning' do
expect(subject.warnings).to be_empty
end
end
end
end
describe 'only / except policies validations' do
......
......@@ -14,7 +14,6 @@ RSpec.describe Ci::CreatePipelineService do
before do
stub_ci_pipeline_yaml_file(config)
stub_feature_flags(ci_raise_job_rules_without_workflow_rules_warning: true)
end
context 'when created successfully' do
......@@ -35,18 +34,6 @@ RSpec.describe Ci::CreatePipelineService do
/jobs:test may allow multiple pipelines to run/
)
end
context 'when feature flag is disabled for the particular warning' do
before do
stub_feature_flags(ci_raise_job_rules_without_workflow_rules_warning: false)
end
it 'does not contain warnings' do
expect(pipeline.error_messages.map(&:content)).to be_empty
expect(pipeline.warning_messages.map(&:content)).to be_empty
end
end
end
context 'when no warnings are raised' do
......
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