Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
bd2225ac
Commit
bd2225ac
authored
Apr 14, 2021
by
Allison Browne
Committed by
Matthias Käppler
Apr 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up `async_add_build_failure_todo` feature flag [RUN ALL RSPEC] [RUN AS-IF-FOSS]
parent
cedcd442
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
66 deletions
+12
-66
app/models/commit_status.rb
app/models/commit_status.rb
+0
-12
app/workers/build_finished_worker.rb
app/workers/build_finished_worker.rb
+1
-1
changelogs/unreleased/ab-remove-async_add_build_failure_todo-feature-flag.yml
...d/ab-remove-async_add_build_failure_todo-feature-flag.yml
+5
-0
config/feature_flags/development/async_add_build_failure_todo.yml
...eature_flags/development/async_add_build_failure_todo.yml
+0
-8
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+6
-33
spec/workers/build_finished_worker_spec.rb
spec/workers/build_finished_worker_spec.rb
+0
-12
No files found.
app/models/commit_status.rb
View file @
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
...
...
app/workers/build_finished_worker.rb
View file @
bd2225ac
...
...
@@ -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
...
...
changelogs/unreleased/ab-remove-async_add_build_failure_todo-feature-flag.yml
0 → 100644
View file @
bd2225ac
---
title
:
Improve performance by moving TODO creation out of the jobs/request path
merge_request
:
59022
author
:
type
:
performance
config/feature_flags/development/async_add_build_failure_todo.yml
deleted
100644 → 0
View file @
cedcd442
---
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
spec/models/ci/build_spec.rb
View file @
bd2225ac
...
...
@@ -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
...
...
spec/workers/build_finished_worker_spec.rb
View file @
bd2225ac
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment