Skip to content
Snippets Groups Projects
Verified Commit babdcf3a authored by drew stachon's avatar drew stachon :wave: Committed by GitLab
Browse files

Merge branch '434676-remove-ci_workflow_auto_cancel_on_new_commit' into 'master'

Remove feature flag ci_workflow_auto_cancel_on_new_commit

See merge request !145144



Merged-by: default avatardrew stachon <730684-drew@users.noreply.gitlab.com>
Approved-by: default avatarLeaminn Ma <lma@gitlab.com>
Approved-by: default avatarMarcel Amirault <mamirault@gitlab.com>
Approved-by: default avatardrew stachon <730684-drew@users.noreply.gitlab.com>
Co-authored-by: default avatarFurkan Ayhan <furkanayhn@gmail.com>
parents e7b8e59a 2933c5f7
No related branches found
No related tags found
1 merge request!145144Remove feature flag ci_workflow_auto_cancel_on_new_commit
Pipeline #1184266786 passed
......@@ -70,20 +70,7 @@ def parent_and_child_pipelines(ids)
.alive_or_scheduled
end
def legacy_auto_cancel_pipelines(pipeline_ids)
::Ci::Pipeline
.id_in(pipeline_ids)
.conservative_interruptible
.each do |cancelable_pipeline|
cancel_pipeline(cancelable_pipeline, safe_cancellation: false)
end
end
def auto_cancel_pipelines(pipeline_ids)
if Feature.disabled?(:ci_workflow_auto_cancel_on_new_commit, project)
return legacy_auto_cancel_pipelines(pipeline_ids)
end
::Ci::Pipeline
.id_in(pipeline_ids)
.each do |cancelable_pipeline|
......
---
name: ci_workflow_auto_cancel_on_new_commit
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/139358
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/434676
milestone: '16.8'
type: development
group: group::pipeline authoring
default_enabled: true
......@@ -497,11 +497,7 @@ You can use some [predefined CI/CD variables](../variables/predefined_variables.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/412473) in GitLab 16.8 [with a flag](../../administration/feature_flags.md) named `ci_workflow_auto_cancel_on_new_commit`. Disabled by default.
> - [Enabled on GitLab.com and self-managed](https://gitlab.com/gitlab-org/gitlab/-/issues/434676) in GitLab 16.9.
FLAG:
On self-managed GitLab, by default this feature is available.
To hide the feature, an administrator can [disable the feature flag](../../administration/feature_flags.md) named `ci_workflow_auto_cancel_on_new_commit`.
On GitLab.com, this feature is available.
> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/434676) in GitLab 16.10. Feature flag `ci_workflow_auto_cancel_on_new_commit` removed.
Use `workflow:auto_cancel:on_new_commit` to configure the behavior of
the [auto-cancel redundant pipelines](../pipelines/settings.md#auto-cancel-redundant-pipelines) feature.
......@@ -714,11 +710,7 @@ When the branch is something else:
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/436467) in GitLab 16.8 [with a flag](../../administration/feature_flags.md) named `ci_workflow_auto_cancel_on_new_commit`. Disabled by default.
> - [Enabled on GitLab.com and self-managed](https://gitlab.com/gitlab-org/gitlab/-/issues/434676) in GitLab 16.9.
FLAG:
On self-managed GitLab, by default this feature is available.
To hide the feature, an administrator can [disable the feature flag](../../administration/feature_flags.md) named `ci_workflow_auto_cancel_on_new_commit`.
On GitLab.com, this feature is available.
> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/434676) in GitLab 16.10. Feature flag `ci_workflow_auto_cancel_on_new_commit` removed.
Use `workflow:rules:auto_cancel` to configure the behavior of
the [`workflow:auto_cancel:on_new_commit`](#workflowauto_cancelon_new_commit) feature.
......
......@@ -168,20 +168,6 @@
expect(build_statuses(child_pipeline)).to contain_exactly('canceled', 'success')
end
context 'when the FF ci_workflow_auto_cancel_on_new_commit is disabled' do
before do
stub_feature_flags(ci_workflow_auto_cancel_on_new_commit: false)
end
it 'does not cancel any child pipeline builds' do
expect(build_statuses(child_pipeline)).to contain_exactly('running', 'success')
execute
expect(build_statuses(child_pipeline)).to contain_exactly('running', 'success')
end
end
end
end
......@@ -271,21 +257,6 @@
)
expect(job_statuses(pipeline)).to contain_exactly('pending')
end
context 'when the FF ci_workflow_auto_cancel_on_new_commit is disabled' do
before do
stub_feature_flags(ci_workflow_auto_cancel_on_new_commit: false)
end
it 'does not cancel any job' do
execute
expect(job_statuses(prev_pipeline)).to contain_exactly(
'running', 'success', 'created', 'failed', 'success'
)
expect(job_statuses(pipeline)).to contain_exactly('pending')
end
end
end
context 'when there are trigger jobs' do
......@@ -321,19 +292,6 @@
expect(job_statuses(pipeline)).to contain_exactly('pending')
end
context 'when the FF ci_workflow_auto_cancel_on_new_commit is disabled' do
before do
stub_feature_flags(ci_workflow_auto_cancel_on_new_commit: false)
end
it 'cancels non started builds' do
execute
expect(build_statuses(prev_pipeline)).to contain_exactly('canceled', 'success', 'canceled')
expect(build_statuses(pipeline)).to contain_exactly('pending')
end
end
context 'when there are non-interruptible completed jobs in the pipeline' do
before do
create(:ci_build, :failed, pipeline: prev_pipeline)
......@@ -348,21 +306,6 @@
)
expect(job_statuses(pipeline)).to contain_exactly('pending')
end
context 'when the FF ci_workflow_auto_cancel_on_new_commit is disabled' do
before do
stub_feature_flags(ci_workflow_auto_cancel_on_new_commit: false)
end
it 'does not cancel any job' do
execute
expect(build_statuses(prev_pipeline)).to contain_exactly(
'created', 'success', 'running', 'failed', 'success'
)
expect(build_statuses(pipeline)).to contain_exactly('pending')
end
end
end
end
......@@ -395,19 +338,6 @@
expect(build_statuses(pipeline)).to contain_exactly('pending')
end
context 'when the FF ci_workflow_auto_cancel_on_new_commit is disabled' do
before do
stub_feature_flags(ci_workflow_auto_cancel_on_new_commit: false)
end
it 'cancels only previous non started builds' do
execute
expect(build_statuses(prev_pipeline)).to contain_exactly('canceled', 'success', 'canceled')
expect(build_statuses(pipeline)).to contain_exactly('pending')
end
end
context 'when there are non-interruptible completed jobs in the pipeline' do
before do
create(:ci_build, :failed, pipeline: prev_pipeline)
......@@ -422,21 +352,6 @@
)
expect(job_statuses(pipeline)).to contain_exactly('pending')
end
context 'when the FF ci_workflow_auto_cancel_on_new_commit is disabled' do
before do
stub_feature_flags(ci_workflow_auto_cancel_on_new_commit: false)
end
it 'does not cancel any job' do
execute
expect(job_statuses(prev_pipeline)).to contain_exactly(
'running', 'success', 'created', 'failed', 'success'
)
expect(job_statuses(pipeline)).to contain_exactly('pending')
end
end
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment