Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
4bcd900f
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4bcd900f
编写于
3月 07, 2017
作者:
G
gpongelli
提交者:
Sean McGivern
3月 07, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Moved call of SystemHooksService from UpdateMergeRequestsWorker to GitPushServic…
上级
ac9d7929
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
41 addition
and
14 deletion
+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
未找到文件。
app/services/git_push_service.rb
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
4bcd900f
---
title
:
Added commit array to Syshook json
merge_request
:
9685
author
:
Gabriele Pongelli
config/sidekiq_queues.yml
浏览文件 @
4bcd900f
...
...
@@ -52,3 +52,4 @@
- [cronjob, 1]
- [default, 1]
- [pages, 1]
- [system_hook_push, 1]
spec/services/git_push_service_spec.rb
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录