Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
dd53a9c0
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,发现更多精彩内容 >>
提交
dd53a9c0
编写于
3月 14, 2017
作者:
R
Ruben Davila
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Include time tracking attributes in webhooks payload
上级
ffcddb29
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
31 addition
and
3 deletion
+31
-3
app/models/issue.rb
app/models/issue.rb
+7
-1
app/models/merge_request.rb
app/models/merge_request.rb
+4
-1
changelogs/unreleased/27271-missing-time-spent-in-issue-webhook.yml
.../unreleased/27271-missing-time-spent-in-issue-webhook.yml
+4
-0
spec/models/issue_spec.rb
spec/models/issue_spec.rb
+11
-0
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+5
-1
未找到文件。
app/models/issue.rb
浏览文件 @
dd53a9c0
...
...
@@ -58,7 +58,13 @@ class Issue < ActiveRecord::Base
end
def
hook_attrs
attributes
attrs
=
{
total_time_spent:
total_time_spent
,
human_total_time_spent:
human_total_time_spent
,
human_time_estimate:
human_time_estimate
}
attributes
.
merge!
(
attrs
)
end
def
self
.
reference_prefix
...
...
app/models/merge_request.rb
浏览文件 @
dd53a9c0
...
...
@@ -523,7 +523,10 @@ class MergeRequest < ActiveRecord::Base
source:
source_project
.
try
(
:hook_attrs
),
target:
target_project
.
hook_attrs
,
last_commit:
nil
,
work_in_progress:
work_in_progress?
work_in_progress:
work_in_progress?
,
total_time_spent:
total_time_spent
,
human_total_time_spent:
human_total_time_spent
,
human_time_estimate:
human_time_estimate
}
if
diff_head_commit
...
...
changelogs/unreleased/27271-missing-time-spent-in-issue-webhook.yml
0 → 100644
浏览文件 @
dd53a9c0
---
title
:
Include time tracking attributes in webhooks payload
merge_request
:
9942
author
:
spec/models/issue_spec.rb
浏览文件 @
dd53a9c0
...
...
@@ -620,4 +620,15 @@ describe Issue, models: true do
end
end
end
describe
'#hook_attrs'
do
let
(
:attrs_hash
)
{
subject
.
hook_attrs
}
it
'includes time tracking attrs'
do
expect
(
attrs_hash
).
to
include
(
:total_time_spent
)
expect
(
attrs_hash
).
to
include
(
:human_time_estimate
)
expect
(
attrs_hash
).
to
include
(
:human_total_time_spent
)
expect
(
attrs_hash
).
to
include
(
'time_estimate'
)
end
end
end
spec/models/merge_request_spec.rb
浏览文件 @
dd53a9c0
...
...
@@ -542,7 +542,7 @@ describe MergeRequest, models: true do
end
describe
"#hook_attrs"
do
let
(
:attrs_hash
)
{
subject
.
hook_attrs
.
to_h
}
let
(
:attrs_hash
)
{
subject
.
hook_attrs
}
[
:source
,
:target
].
each
do
|
key
|
describe
"
#{
key
}
key"
do
...
...
@@ -558,6 +558,10 @@ describe MergeRequest, models: true do
expect
(
attrs_hash
).
to
include
(
:target
)
expect
(
attrs_hash
).
to
include
(
:last_commit
)
expect
(
attrs_hash
).
to
include
(
:work_in_progress
)
expect
(
attrs_hash
).
to
include
(
:total_time_spent
)
expect
(
attrs_hash
).
to
include
(
:human_time_estimate
)
expect
(
attrs_hash
).
to
include
(
:human_total_time_spent
)
expect
(
attrs_hash
).
to
include
(
'time_estimate'
)
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录