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
f9548536
Commit
f9548536
authored
Apr 14, 2021
by
Reuben Pereira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use SyncCodeOwnerApprovalRulesWorker when creating merge request
parent
e20fd68c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
9 deletions
+11
-9
ee/app/services/ee/merge_requests/create_service.rb
ee/app/services/ee/merge_requests/create_service.rb
+1
-1
ee/changelogs/unreleased/20770-move-approval-rules-to-sidekiq1.yml
...logs/unreleased/20770-move-approval-rules-to-sidekiq1.yml
+5
-0
ee/spec/services/ee/merge_requests/create_service_spec.rb
ee/spec/services/ee/merge_requests/create_service_spec.rb
+5
-8
No files found.
ee/app/services/ee/merge_requests/create_service.rb
View file @
f9548536
...
...
@@ -9,7 +9,7 @@ module EE
def
after_create
(
issuable
)
super
::
MergeRequests
::
SyncCodeOwnerApprovalRules
.
new
(
issuable
).
execute
::
MergeRequests
::
SyncCodeOwnerApprovalRules
Worker
.
perform_async
(
issuable
.
id
)
::
MergeRequests
::
SyncReportApproverApprovalRules
.
new
(
issuable
).
execute
::
MergeRequests
::
UpdateBlocksService
...
...
ee/changelogs/unreleased/20770-move-approval-rules-to-sidekiq1.yml
0 → 100644
View file @
f9548536
---
title
:
Sync code owner approval rules asynchronously after creating merge request
merge_request
:
59395
author
:
type
:
performance
ee/spec/services/ee/merge_requests/create_service_spec.rb
View file @
f9548536
...
...
@@ -28,14 +28,11 @@ RSpec.describe MergeRequests::CreateService do
project
.
add_maintainer
(
user
)
end
it
'refreshes code owners for the merge request'
do
fake_refresh_service
=
instance_double
(
::
MergeRequests
::
SyncCodeOwnerApprovalRules
)
expect
(
::
MergeRequests
::
SyncCodeOwnerApprovalRules
)
.
to
receive
(
:new
).
with
(
kind_of
(
MergeRequest
)).
and_return
(
fake_refresh_service
)
expect
(
fake_refresh_service
).
to
receive
(
:execute
)
service
.
execute
it
'schedules refresh of code owners for the merge request'
do
Sidekiq
::
Testing
.
fake!
do
expect
{
service
.
execute
}.
to
change
(
::
MergeRequests
::
SyncCodeOwnerApprovalRulesWorker
.
jobs
,
:size
).
by
(
1
)
::
MergeRequests
::
SyncCodeOwnerApprovalRulesWorker
.
clear
end
end
context
'report approvers'
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