Commit 5d8d5142 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Merge branch 'cleanup-ci_validate_build_dependencies-feature-flag' into 'master'

Cleanup `ci_validate_build_dependencies` feature flag [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!60999
parents 27621069 a5307934
...@@ -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
......
...@@ -3264,10 +3264,6 @@ If the artifacts of the job that is set as a dependency are ...@@ -3264,10 +3264,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,41 +3631,24 @@ RSpec.describe Ci::Build do ...@@ -3631,41 +3631,24 @@ 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) }
let!(:pre_stage_job) { create(:ci_build, :success, pipeline: pipeline, name: 'test', stage_idx: 0) }
context 'when validates for dependencies is enabled' do context 'when "dependencies" keyword is not defined' do
before do let(:options) { {} }
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) }
context 'when "dependencies" keyword is not defined' do
let(:options) { {} }
it { expect(job).to have_valid_build_dependencies }
end
context 'when "dependencies" keyword is empty' do
let(:options) { { dependencies: [] } }
it { expect(job).to have_valid_build_dependencies } it { expect(job).to have_valid_build_dependencies }
end end
context 'when "dependencies" keyword is specified' do context 'when "dependencies" keyword is empty' do
let(:options) { { dependencies: ['test'] } } let(:options) { { dependencies: [] } }
it_behaves_like 'validation is active' it { expect(job).to have_valid_build_dependencies }
end
end end
context 'when validates for dependencies is disabled' do context 'when "dependencies" keyword is specified' do
let(:options) { { dependencies: ['test'] } } let(:options) { { dependencies: ['test'] } }
before do it_behaves_like 'validation is active'
stub_feature_flags(ci_validate_build_dependencies_override: true)
end
it_behaves_like 'validation is not active'
end end
end end
......
...@@ -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 it_behaves_like 'validation is active'
before do
stub_feature_flags(ci_validate_build_dependencies_override: false)
end
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