Commit 2feffdc1 authored by Matthias Käppler's avatar Matthias Käppler

Merge branch 'ab-remove-async_add_build_failure_todo-feature-flag' into 'master'

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

See merge request gitlab-org/gitlab!59022
parents e83fcf75 bd2225ac
......@@ -179,18 +179,6 @@ class CommitStatus < ApplicationRecord
ExpireJobCacheWorker.perform_async(id)
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
def self.names
......
......@@ -37,7 +37,7 @@ class BuildFinishedWorker # rubocop:disable Scalability/IdempotentWorker
ExpirePipelineCacheWorker.perform_async(build.pipeline_id)
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)
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
subject.drop!
end
context 'when async_add_build_failure_todo flag enabled' do
it 'creates a todo async', :sidekiq_inline do
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
it 'creates a todo async', :sidekiq_inline do
project.add_developer(user)
context 'when async_add_build_failure_todo flag disabled' do
before do
stub_feature_flags(async_add_build_failure_todo: false)
expect_next_instance_of(TodoService) do |todo_service|
expect(todo_service)
.to receive(:merge_request_build_failed).with(merge_request)
end
it 'creates a todo sync' do
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
subject.drop!
end
end
......
......@@ -39,18 +39,6 @@ RSpec.describe BuildFinishedWorker do
subject
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
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