Commit bd2225ac authored by Allison Browne's avatar Allison Browne Committed by Matthias Käppler

Clean up `async_add_build_failure_todo` feature flag [RUN ALL RSPEC] [RUN AS-IF-FOSS]

parent cedcd442
...@@ -179,18 +179,6 @@ class CommitStatus < ApplicationRecord ...@@ -179,18 +179,6 @@ class CommitStatus < ApplicationRecord
ExpireJobCacheWorker.perform_async(id) ExpireJobCacheWorker.perform_async(id)
end end
end end
after_transition any => :failed do |commit_status|
next if Feature.enabled?(:async_add_build_failure_todo, commit_status.project, default_enabled: :yaml)
next unless commit_status.project
# rubocop: disable CodeReuse/ServiceClass
commit_status.run_after_commit do
MergeRequests::AddTodoWhenBuildFailsService
.new(project, nil).execute(self)
end
# rubocop: enable CodeReuse/ServiceClass
end
end end
def self.names def self.names
......
...@@ -37,7 +37,7 @@ class BuildFinishedWorker # rubocop:disable Scalability/IdempotentWorker ...@@ -37,7 +37,7 @@ class BuildFinishedWorker # rubocop:disable Scalability/IdempotentWorker
ExpirePipelineCacheWorker.perform_async(build.pipeline_id) ExpirePipelineCacheWorker.perform_async(build.pipeline_id)
ChatNotificationWorker.perform_async(build.id) if build.pipeline.chat? ChatNotificationWorker.perform_async(build.id) if build.pipeline.chat?
if build.failed? && Feature.enabled?(:async_add_build_failure_todo, build.project, default_enabled: :yaml) if build.failed?
::Ci::MergeRequests::AddTodoWhenBuildFailsWorker.perform_async(build.id) ::Ci::MergeRequests::AddTodoWhenBuildFailsWorker.perform_async(build.id)
end end
......
---
title: Improve performance by moving TODO creation out of the jobs/request path
merge_request: 59022
author:
type: performance
---
name: async_add_build_failure_todo
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57490/diffs
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/326726
milestone: '13.11'
type: development
group: group::continuous integration
default_enabled: true
...@@ -3758,42 +3758,15 @@ RSpec.describe Ci::Build do ...@@ -3758,42 +3758,15 @@ RSpec.describe Ci::Build do
subject.drop! subject.drop!
end end
context 'when async_add_build_failure_todo flag enabled' do it 'creates a todo async', :sidekiq_inline do
it 'creates a todo async', :sidekiq_inline do project.add_developer(user)
project.add_developer(user)
expect_next_instance_of(TodoService) do |todo_service|
expect(todo_service)
.to receive(:merge_request_build_failed).with(merge_request)
end
subject.drop!
end
it 'does not create a sync todo' do
project.add_developer(user)
expect(TodoService).not_to receive(:new)
subject.drop!
end
end
context 'when async_add_build_failure_todo flag disabled' do expect_next_instance_of(TodoService) do |todo_service|
before do expect(todo_service)
stub_feature_flags(async_add_build_failure_todo: false) .to receive(:merge_request_build_failed).with(merge_request)
end end
it 'creates a todo sync' do subject.drop!
project.add_developer(user)
expect_next_instance_of(TodoService) do |todo_service|
expect(todo_service)
.to receive(:merge_request_build_failed).with(merge_request)
end
subject.drop!
end
end end
end end
......
...@@ -39,18 +39,6 @@ RSpec.describe BuildFinishedWorker do ...@@ -39,18 +39,6 @@ RSpec.describe BuildFinishedWorker do
subject subject
end end
context 'when async_add_build_failure_todo disabled' do
before do
stub_feature_flags(async_add_build_failure_todo: false)
end
it 'does not add a todo' do
expect(::Ci::MergeRequests::AddTodoWhenBuildFailsWorker).not_to receive(:perform_async)
subject
end
end
end end
context 'when build has a chat' do context 'when build has a chat' 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