Commit cf3b972e authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'ci-remove-exit-codes-feature-flags' into 'master'

Remove code related to ci_allow_failure_with_exit_codes feature flag

See merge request gitlab-org/gitlab!51973
parents b719c931 37a5e7c2
...@@ -1122,7 +1122,6 @@ module Ci ...@@ -1122,7 +1122,6 @@ module Ci
end end
def conditionally_allow_failure!(exit_code) def conditionally_allow_failure!(exit_code)
return unless ::Gitlab::Ci::Features.allow_failure_with_exit_codes_enabled?
return unless exit_code return unless exit_code
if allowed_to_fail_with_code?(exit_code) if allowed_to_fail_with_code?(exit_code)
......
---
name: ci_allow_failure_with_exit_codes
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/49145
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/292024
milestone: '13.7'
type: development
group: group::pipeline authoring
default_enabled: true
...@@ -2318,13 +2318,7 @@ job3: ...@@ -2318,13 +2318,7 @@ job3:
#### `allow_failure:exit_codes` #### `allow_failure:exit_codes`
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/273157) in GitLab 13.8. > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/273157) in GitLab 13.8.
> - It's [deployed behind a feature flag](../../user/feature_flags.md), enabled by default. > - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/292024) in GitLab 13.9.
> - It's enabled on GitLab.com.
> - It's recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-allow_failureexit_codes). **(CORE ONLY)**
WARNING:
This feature might not be available to you. Check the **version history** note above for details.
Use `allow_failure:exit_codes` to dynamically control if a job should be allowed Use `allow_failure:exit_codes` to dynamically control if a job should be allowed
to fail. You can list which exit codes are not considered failures. The job fails to fail. You can list which exit codes are not considered failures. The job fails
...@@ -2348,25 +2342,6 @@ test_job_2: ...@@ -2348,25 +2342,6 @@ test_job_2:
- 255 - 255
``` ```
##### Enable or disable `allow_failure:exit_codes` **(CORE ONLY)**
`allow_failure:exit_codes` is under development but ready for production use. It is
deployed behind a feature flag that is **enabled by default**.
[GitLab administrators with access to the GitLab Rails console](../../administration/feature_flags.md)
can disable it.
To disable it:
```ruby
Feature.disable(:ci_allow_failure_with_exit_codes)
```
To enable it:
```ruby
Feature.enable(:ci_allow_failure_with_exit_codes)
```
### `when` ### `when`
`when` is used to implement jobs that are run in case of failure or despite the `when` is used to implement jobs that are run in case of failure or despite the
......
...@@ -186,8 +186,6 @@ module Gitlab ...@@ -186,8 +186,6 @@ module Gitlab
private private
def allow_failure_criteria def allow_failure_criteria
return unless ::Gitlab::Ci::Features.allow_failure_with_exit_codes_enabled?
if allow_failure_defined? && allow_failure_value.is_a?(Hash) if allow_failure_defined? && allow_failure_value.is_a?(Hash)
allow_failure_value allow_failure_value
end end
......
...@@ -63,10 +63,6 @@ module Gitlab ...@@ -63,10 +63,6 @@ module Gitlab
::Feature.enabled?(:ci_pipeline_editor_page, project, default_enabled: :yaml) ::Feature.enabled?(:ci_pipeline_editor_page, project, default_enabled: :yaml)
end end
def self.allow_failure_with_exit_codes_enabled?
::Feature.enabled?(:ci_allow_failure_with_exit_codes, default_enabled: :yaml)
end
def self.rules_variables_enabled?(project) def self.rules_variables_enabled?(project)
::Feature.enabled?(:ci_rules_variables, project, default_enabled: true) ::Feature.enabled?(:ci_rules_variables, project, default_enabled: true)
end end
......
...@@ -188,7 +188,6 @@ module Gitlab ...@@ -188,7 +188,6 @@ module Gitlab
# we need to prevent the exit codes from being persisted because they # we need to prevent the exit codes from being persisted because they
# would break the behavior defined by `rules:allow_failure`. # would break the behavior defined by `rules:allow_failure`.
def allow_failure_criteria_attributes def allow_failure_criteria_attributes
return {} unless ::Gitlab::Ci::Features.allow_failure_with_exit_codes_enabled?
return {} if rules_attributes[:allow_failure].nil? return {} if rules_attributes[:allow_failure].nil?
return {} unless @seed_attributes.dig(:options, :allow_failure_criteria) return {} unless @seed_attributes.dig(:options, :allow_failure_criteria)
......
...@@ -763,16 +763,6 @@ RSpec.describe Gitlab::Ci::Config::Entry::Job do ...@@ -763,16 +763,6 @@ RSpec.describe Gitlab::Ci::Config::Entry::Job do
it 'returns allow_failure_criteria' do it 'returns allow_failure_criteria' do
expect(entry.value[:allow_failure_criteria]).to match(exit_codes: [42]) expect(entry.value[:allow_failure_criteria]).to match(exit_codes: [42])
end end
context 'with ci_allow_failure_with_exit_codes disabled' do
before do
stub_feature_flags(ci_allow_failure_with_exit_codes: false)
end
it 'does not return allow_failure_criteria' do
expect(entry.value.key?(:allow_failure_criteria)).to be_falsey
end
end
end end
end end
end end
......
...@@ -4922,14 +4922,6 @@ RSpec.describe Ci::Build do ...@@ -4922,14 +4922,6 @@ RSpec.describe Ci::Build do
it_behaves_like 'drops the build without changing allow_failure' it_behaves_like 'drops the build without changing allow_failure'
end end
context 'when ci_allow_failure_with_exit_codes is disabled' do
before do
stub_feature_flags(ci_allow_failure_with_exit_codes: false)
end
it_behaves_like 'drops the build without changing allow_failure'
end
end end
end end
......
...@@ -145,20 +145,6 @@ RSpec.describe Ci::CreatePipelineService do ...@@ -145,20 +145,6 @@ RSpec.describe Ci::CreatePipelineService do
expect(find_job('job-2').options.dig(:allow_failure_criteria)).to be_nil expect(find_job('job-2').options.dig(:allow_failure_criteria)).to be_nil
expect(find_job('job-3').options.dig(:allow_failure_criteria, :exit_codes)).to eq([42]) expect(find_job('job-3').options.dig(:allow_failure_criteria, :exit_codes)).to eq([42])
end end
context 'with ci_allow_failure_with_exit_codes disabled' do
before do
stub_feature_flags(ci_allow_failure_with_exit_codes: false)
end
it 'does not persist allow_failure_criteria' do
expect(pipeline).to be_persisted
expect(find_job('job-1').options.key?(:allow_failure_criteria)).to be_falsey
expect(find_job('job-2').options.key?(:allow_failure_criteria)).to be_falsey
expect(find_job('job-3').options.key?(:allow_failure_criteria)).to be_falsey
end
end
end end
context 'if:' do context 'if:' 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