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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
4bcd900f
Commit
4bcd900f
authored
Mar 07, 2017
by
gpongelli
Committed by
Sean McGivern
Mar 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved call of SystemHooksService from UpdateMergeRequestsWorker to GitPushServic…
parent
ac9d7929
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
41 additions
and
14 deletions
+41
-14
app/services/git_push_service.rb
app/services/git_push_service.rb
+2
-0
app/workers/system_hook_push_worker.rb
app/workers/system_hook_push_worker.rb
+8
-0
app/workers/update_merge_requests_worker.rb
app/workers/update_merge_requests_worker.rb
+0
-3
changelogs/unreleased/feature-syshook_commits.yml
changelogs/unreleased/feature-syshook_commits.yml
+4
-0
config/sidekiq_queues.yml
config/sidekiq_queues.yml
+1
-0
spec/services/git_push_service_spec.rb
spec/services/git_push_service_spec.rb
+7
-0
spec/workers/system_hook_push_worker_spec.rb
spec/workers/system_hook_push_worker_spec.rb
+19
-0
spec/workers/update_merge_requests_worker_spec.rb
spec/workers/update_merge_requests_worker_spec.rb
+0
-11
No files found.
app/services/git_push_service.rb
View file @
4bcd900f
...
...
@@ -99,6 +99,8 @@ class GitPushService < BaseService
UpdateMergeRequestsWorker
.
perform_async
(
@project
.
id
,
current_user
.
id
,
params
[
:oldrev
],
params
[
:newrev
],
params
[
:ref
])
SystemHookPushWorker
.
perform_async
(
build_push_data
.
dup
,
:push_hooks
)
EventCreateService
.
new
.
push
(
@project
,
current_user
,
build_push_data
)
@project
.
execute_hooks
(
build_push_data
.
dup
,
:push_hooks
)
@project
.
execute_services
(
build_push_data
.
dup
,
:push_hooks
)
...
...
app/workers/system_hook_push_worker.rb
0 → 100644
View file @
4bcd900f
class
SystemHookPushWorker
include
Sidekiq
::
Worker
include
DedicatedSidekiqQueue
def
perform
(
push_data
,
hook_id
)
SystemHooksService
.
new
.
execute_hooks
(
push_data
,
hook_id
)
end
end
app/workers/update_merge_requests_worker.rb
View file @
4bcd900f
...
...
@@ -10,8 +10,5 @@ class UpdateMergeRequestsWorker
return
unless
user
MergeRequests
::
RefreshService
.
new
(
project
,
user
).
execute
(
oldrev
,
newrev
,
ref
)
push_data
=
Gitlab
::
DataBuilder
::
Push
.
build
(
project
,
user
,
oldrev
,
newrev
,
ref
,
[])
SystemHooksService
.
new
.
execute_hooks
(
push_data
,
:push_hooks
)
end
end
changelogs/unreleased/feature-syshook_commits.yml
0 → 100644
View file @
4bcd900f
---
title
:
Added commit array to Syshook json
merge_request
:
9685
author
:
Gabriele Pongelli
config/sidekiq_queues.yml
View file @
4bcd900f
...
...
@@ -52,3 +52,4 @@
- [cronjob, 1]
- [default, 1]
- [pages, 1]
- [system_hook_push, 1]
spec/services/git_push_service_spec.rb
View file @
4bcd900f
...
...
@@ -150,6 +150,13 @@ describe GitPushService, services: true do
execute_service
(
project
,
user
,
@blankrev
,
'newrev'
,
'refs/heads/master'
)
end
end
context
"Sends System Push data"
do
it
"when pushing on a branch"
do
expect
(
SystemHookPushWorker
).
to
receive
(
:perform_async
).
with
(
@push_data
,
:push_hooks
)
execute_service
(
project
,
user
,
@oldrev
,
@newrev
,
@ref
)
end
end
end
describe
"Updates git attributes"
do
...
...
spec/workers/system_hook_push_worker_spec.rb
0 → 100644
View file @
4bcd900f
require
'spec_helper'
describe
SystemHookPushWorker
do
include
RepoHelpers
subject
{
described_class
.
new
}
describe
'#perform'
do
it
'executes SystemHooksService with expected values'
do
push_data
=
double
(
'push_data'
)
system_hook_service
=
double
(
'system_hook_service'
)
expect
(
SystemHooksService
).
to
receive
(
:new
).
and_return
(
system_hook_service
)
expect
(
system_hook_service
).
to
receive
(
:execute_hooks
).
with
(
push_data
,
:push_hooks
)
subject
.
perform
(
push_data
,
:push_hooks
)
end
end
end
spec/workers/update_merge_requests_worker_spec.rb
View file @
4bcd900f
...
...
@@ -23,16 +23,5 @@ describe UpdateMergeRequestsWorker do
perform
end
it
'executes SystemHooksService with expected values'
do
push_data
=
double
(
'push_data'
)
expect
(
Gitlab
::
DataBuilder
::
Push
).
to
receive
(
:build
).
with
(
project
,
user
,
oldrev
,
newrev
,
ref
,
[]).
and_return
(
push_data
)
system_hook_service
=
double
(
'system_hook_service'
)
expect
(
SystemHooksService
).
to
receive
(
:new
).
and_return
(
system_hook_service
)
expect
(
system_hook_service
).
to
receive
(
:execute_hooks
).
with
(
push_data
,
:push_hooks
)
perform
end
end
end
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