Commit a5307934 authored by Shinya Maeda's avatar Shinya Maeda

Cleanup `ci_validate_build_dependencies` feature flag

This commit removes the `ci_validate_build_dependencies` feature flag.
parent 3be50b9f
...@@ -105,8 +105,6 @@ module Ci ...@@ -105,8 +105,6 @@ module Ci
end end
def valid_local? def valid_local?
return true unless Gitlab::Ci::Features.validate_build_dependencies?(project)
local.all?(&:valid_dependency?) local.all?(&:valid_dependency?)
end end
......
---
title: Validate CI pipeline jobs dependencies
merge_request: 60999
author:
type: changed
---
name: ci_validate_build_dependencies
introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/14009
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/257852
milestone: '10.3'
type: development
group: group::continuous integration
default_enabled: true
---
name: ci_validate_build_dependencies_override
introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/14009
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/257852
milestone: '10.3'
type: development
group: group::continuous integration
default_enabled: false
...@@ -370,42 +370,6 @@ steps below. ...@@ -370,42 +370,6 @@ steps below.
If the `expire` directive is not set explicitly in your pipeline, artifacts expire per the If the `expire` directive is not set explicitly in your pipeline, artifacts expire per the
default artifacts expiration setting, which you can find in the [CI/CD Administration settings](../user/admin_area/settings/continuous_integration.md). default artifacts expiration setting, which you can find in the [CI/CD Administration settings](../user/admin_area/settings/continuous_integration.md).
## Validation for dependencies
> Introduced in GitLab 10.3.
To disable [the dependencies validation](../ci/yaml/README.md#when-a-dependent-job-fails),
you can enable the `ci_validate_build_dependencies_override` feature flag from a Rails console.
**In Omnibus installations:**
1. Enter the Rails console:
```shell
sudo gitlab-rails console
```
1. Enable the feature flag to disable the validation:
```ruby
Feature.enable(:ci_validate_build_dependencies_override)
```
**In installations from source:**
1. Enter the Rails console:
```shell
cd /home/git/gitlab
sudo -u git -H bundle exec rails console -e production
```
1. Enable the feature flag to disable the validation:
```ruby
Feature.enable(:ci_validate_build_dependencies_override)
```
## Set the maximum file size of the artifacts ## Set the maximum file size of the artifacts
If artifacts are enabled, you can change the maximum file size of the If artifacts are enabled, you can change the maximum file size of the
......
...@@ -3287,10 +3287,6 @@ If the artifacts of the job that is set as a dependency are ...@@ -3287,10 +3287,6 @@ If the artifacts of the job that is set as a dependency are
[deleted](../pipelines/job_artifacts.md#delete-job-artifacts), then [deleted](../pipelines/job_artifacts.md#delete-job-artifacts), then
the dependent job fails. the dependent job fails.
You can ask your administrator to
[flip this switch](../../administration/job_artifacts.md#validation-for-dependencies)
and bring back the old behavior.
#### `artifacts:exclude` #### `artifacts:exclude`
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/15122) in GitLab 13.1 > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/15122) in GitLab 13.1
......
...@@ -47,11 +47,6 @@ module Gitlab ...@@ -47,11 +47,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.validate_build_dependencies?(project)
::Feature.enabled?(:ci_validate_build_dependencies, project, default_enabled: :yaml) &&
::Feature.disabled?(:ci_validate_build_dependencies_override, project)
end
def self.display_quality_on_mr_diff?(project) def self.display_quality_on_mr_diff?(project)
::Feature.enabled?(:codequality_mr_diff, project, default_enabled: false) ::Feature.enabled?(:codequality_mr_diff, project, default_enabled: false)
end end
......
...@@ -18,10 +18,6 @@ RSpec.describe Ci::BuildDependencies do ...@@ -18,10 +18,6 @@ RSpec.describe Ci::BuildDependencies do
let!(:rubocop_test) { create(:ci_build, pipeline: pipeline, name: 'rubocop', stage_idx: 1, stage: 'test') } let!(:rubocop_test) { create(:ci_build, pipeline: pipeline, name: 'rubocop', stage_idx: 1, stage: 'test') }
let!(:staging) { create(:ci_build, pipeline: pipeline, name: 'staging', stage_idx: 2, stage: 'deploy') } let!(:staging) { create(:ci_build, pipeline: pipeline, name: 'staging', stage_idx: 2, stage: 'deploy') }
before do
stub_feature_flags(ci_validate_build_dependencies_override: false)
end
context 'for local dependencies' do context 'for local dependencies' do
subject { described_class.new(job).all } subject { described_class.new(job).all }
...@@ -378,14 +374,6 @@ RSpec.describe Ci::BuildDependencies do ...@@ -378,14 +374,6 @@ RSpec.describe Ci::BuildDependencies do
end end
it { is_expected.to eq(false) } it { is_expected.to eq(false) }
context 'when ci_validate_build_dependencies_override feature flag is enabled' do
before do
stub_feature_flags(ci_validate_build_dependencies_override: job.project)
end
it { is_expected.to eq(true) }
end
end end
end end
end end
...@@ -3631,12 +3631,6 @@ RSpec.describe Ci::Build do ...@@ -3631,12 +3631,6 @@ RSpec.describe Ci::Build do
end end
let!(:job) { create(:ci_build, :pending, pipeline: pipeline, stage_idx: 1, options: options) } let!(:job) { create(:ci_build, :pending, pipeline: pipeline, stage_idx: 1, options: options) }
context 'when validates for dependencies is enabled' do
before do
stub_feature_flags(ci_validate_build_dependencies_override: false)
end
let!(:pre_stage_job) { create(:ci_build, :success, pipeline: pipeline, name: 'test', stage_idx: 0) } let!(:pre_stage_job) { create(:ci_build, :success, pipeline: pipeline, name: 'test', stage_idx: 0) }
context 'when "dependencies" keyword is not defined' do context 'when "dependencies" keyword is not defined' do
...@@ -3658,17 +3652,6 @@ RSpec.describe Ci::Build do ...@@ -3658,17 +3652,6 @@ RSpec.describe Ci::Build do
end end
end end
context 'when validates for dependencies is disabled' do
let(:options) { { dependencies: ['test'] } }
before do
stub_feature_flags(ci_validate_build_dependencies_override: true)
end
it_behaves_like 'validation is not active'
end
end
describe 'state transition when build fails' do describe 'state transition when build fails' do
let(:service) { ::MergeRequests::AddTodoWhenBuildFailsService.new(project, user) } let(:service) { ::MergeRequests::AddTodoWhenBuildFailsService.new(project, user) }
......
...@@ -516,10 +516,6 @@ module Ci ...@@ -516,10 +516,6 @@ module Ci
end end
end end
before do
stub_feature_flags(ci_validate_build_dependencies_override: false)
end
let!(:pre_stage_job) { create(:ci_build, :success, pipeline: pipeline, name: 'test', stage_idx: 0) } let!(:pre_stage_job) { create(:ci_build, :success, pipeline: pipeline, name: 'test', stage_idx: 0) }
let!(:pending_job) do let!(:pending_job) do
...@@ -530,37 +526,7 @@ module Ci ...@@ -530,37 +526,7 @@ module Ci
subject { execute(specific_runner) } subject { execute(specific_runner) }
context 'when validates for dependencies is enabled' do
before do
stub_feature_flags(ci_validate_build_dependencies_override: false)
end
it_behaves_like 'validation is active' it_behaves_like 'validation is active'
context 'when the main feature flag is enabled for a specific project' do
before do
stub_feature_flags(ci_validate_build_dependencies: pipeline.project)
end
it_behaves_like 'validation is active'
end
context 'when the main feature flag is enabled for a different project' do
before do
stub_feature_flags(ci_validate_build_dependencies: create(:project))
end
it_behaves_like 'validation is not active'
end
end
context 'when validates for dependencies is disabled' do
before do
stub_feature_flags(ci_validate_build_dependencies_override: true)
end
it_behaves_like 'validation is not active'
end
end end
context 'when build is degenerated' do context 'when build is degenerated' 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