Skip to content
GitLab
菜单
为什么选择 GitLab
定价
联系销售
探索
为什么选择 GitLab
定价
联系销售
探索
登录
获取免费试用
主导航
搜索或转到…
项目
GitLab
管理
动态
成员
标记
计划
议题
议题看板
里程碑
迭代
需求
代码
合并请求
仓库
分支
提交
标签
仓库图
比较修订版本
代码片段
锁定的文件
构建
流水线
作业
流水线计划
测试用例
产物
部署
发布
Package registry
Container registry
模型注册表
运维
环境
Terraform 模块
监控
事件
服务台
分析
价值流分析
贡献者分析
CI/CD 分析
仓库分析
代码评审分析
议题分析
洞察
模型实验
效能分析
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
隐私声明
快捷键
?
新增功能
4
代码片段
群组
项目
显示更多面包屑
gitlab-cn
GitLab
提交
2d944f23
未验证
提交
2d944f23
编辑于
8 months ago
作者:
Nicolas Dular
提交者:
GitLab
8 months ago
浏览文件
操作
下载
补丁
差异文件
Compare more date data for epic syncing
上级
8826b072
No related branches found
No related tags found
无相关合并请求
变更
2
隐藏空白变更内容
行内
左右并排
显示
2 个更改的文件
ee/lib/gitlab/epic_work_item_sync/diff.rb
+42
-14
42 个添加, 14 个删除
ee/lib/gitlab/epic_work_item_sync/diff.rb
ee/spec/lib/gitlab/epic_work_item_sync/diff_spec.rb
+22
-4
22 个添加, 4 个删除
ee/spec/lib/gitlab/epic_work_item_sync/diff_spec.rb
有
64 个添加
和
18 个删除
ee/lib/gitlab/epic_work_item_sync/diff.rb
+
42
−
14
浏览文件 @
2d944f23
...
@@ -43,10 +43,7 @@ def attributes
...
@@ -43,10 +43,7 @@ def attributes
check_parent
check_parent
check_child_issues
check_child_issues
check_relative_position
check_relative_position
check_start_date_is_fixed
check_dates
check_start_date_fixed
check_due_date_is_fixed
check_due_date_fixed
check_related_epic_links
check_related_epic_links
mismatched_attributes
mismatched_attributes
...
@@ -109,32 +106,63 @@ def check_relative_position
...
@@ -109,32 +106,63 @@ def check_relative_position
mismatched_attributes
.
push
(
"relative_position"
)
mismatched_attributes
.
push
(
"relative_position"
)
end
end
def
check_start_date_is_fixed
def
check_dates
return
if
epic
.
start_date_is_fixed
==
work_item
.
dates_source
&
.
start_date_is_fixed
work_item_dates_source
=
work_item
.
dates_source
return
if
epic
.
start_date_is_fixed
.
nil?
&&
work_item
.
dates_source
.
start_date_is_fixed
==
false
check_start_date_is_fixed
(
work_item_dates_source
)
check_start_date_fixed
(
work_item_dates_source
)
check_due_date_is_fixed
(
work_item_dates_source
)
check_due_date_fixed
(
work_item_dates_source
)
check_source_milestone
(
work_item_dates_source
)
check_source_epic
(
work_item_dates_source
)
end
def
check_start_date_is_fixed
(
dates_source
)
return
if
epic
.
start_date_is_fixed
==
dates_source
&
.
start_date_is_fixed
return
if
epic
.
start_date_is_fixed
.
nil?
&&
dates_source
.
start_date_is_fixed
==
false
mismatched_attributes
.
push
(
"start_date_is_fixed"
)
mismatched_attributes
.
push
(
"start_date_is_fixed"
)
end
end
def
check_start_date_fixed
def
check_start_date_fixed
(
dates_source
)
return
if
epic
.
start_date_fixed
==
work_item
.
dates_source
&
.
start_date_fixed
return
if
epic
.
start_date_fixed
==
dates_source
&
.
start_date_fixed
mismatched_attributes
.
push
(
"start_date_fixed"
)
mismatched_attributes
.
push
(
"start_date_fixed"
)
end
end
def
check_due_date_is_fixed
def
check_due_date_is_fixed
(
dates_source
)
return
if
epic
.
due_date_is_fixed
==
work_item
.
dates_source
&
.
due_date_is_fixed
return
if
epic
.
due_date_is_fixed
==
dates_source
&
.
due_date_is_fixed
return
if
epic
.
due_date_is_fixed
.
nil?
&&
work_item
.
dates_source
.
due_date_is_fixed
==
false
return
if
epic
.
due_date_is_fixed
.
nil?
&&
dates_source
.
due_date_is_fixed
==
false
mismatched_attributes
.
push
(
"due_date_is_fixed"
)
mismatched_attributes
.
push
(
"due_date_is_fixed"
)
end
end
def
check_due_date_fixed
def
check_due_date_fixed
(
dates_source
)
return
if
epic
.
due_date_fixed
==
work_item
.
dates_source
&
.
due_date_fixed
return
if
epic
.
due_date_fixed
==
dates_source
&
.
due_date_fixed
mismatched_attributes
.
push
(
"due_date_fixed"
)
mismatched_attributes
.
push
(
"due_date_fixed"
)
end
end
def
check_source_milestone
(
dates_source
)
if
epic
.
start_date_sourcing_milestone_id
!=
dates_source
&
.
start_date_sourcing_milestone_id
mismatched_attributes
.
push
(
"start_date_sourcing_milestone"
)
end
return
if
epic
.
due_date_sourcing_milestone_id
==
dates_source
&
.
due_date_sourcing_milestone_id
mismatched_attributes
.
push
(
"due_date_sourcing_milestone"
)
end
def
check_source_epic
(
dates_source
)
if
epic
.
start_date_sourcing_epic
&
.
issue_id
!=
dates_source
&
.
start_date_sourcing_work_item_id
mismatched_attributes
.
push
(
"start_date_sourcing_epic"
)
end
return
if
epic
.
due_date_sourcing_epic
&
.
issue_id
==
dates_source
&
.
due_date_sourcing_work_item_id
mismatched_attributes
.
push
(
"due_date_sourcing_epic"
)
end
def
check_related_epic_links
def
check_related_epic_links
related_epic_issues
=
epic
.
unauthorized_related_epics
related_epic_issues
=
epic
.
unauthorized_related_epics
...
...
此差异已折叠。
点击以展开。
ee/spec/lib/gitlab/epic_work_item_sync/diff_spec.rb
+
22
−
4
浏览文件 @
2d944f23
...
@@ -148,12 +148,19 @@
...
@@ -148,12 +148,19 @@
end
end
end
end
describe
'
start
dates'
do
describe
'dates'
do
let_it_be
(
:expected_start_date
)
{
Time
.
current
.
to_date
}
let_it_be
(
:expected_start_date
)
{
Time
.
current
.
to_date
}
let_it_be
(
:expected_due_date
)
{
expected_start_date
+
2
.
days
}
let_it_be
(
:expected_due_date
)
{
expected_start_date
+
2
.
days
}
let_it_be
(
:milestone
)
{
create
(
:milestone
)
}
let_it_be
(
:start_date_sourcing_epic
)
{
create
(
:epic
)
}
let_it_be
(
:due_date_sourcing_epic
)
{
create
(
:epic
)
}
let_it_be_with_reload
(
:epic
)
do
let_it_be_with_reload
(
:epic
)
do
create
(
:epic
,
:with_synced_work_item
,
group:
group
,
start_date_fixed:
expected_start_date
,
create
(
:epic
,
:with_synced_work_item
,
group:
group
,
start_date_fixed:
expected_start_date
,
due_date_fixed:
expected_due_date
,
start_date_is_fixed:
true
,
due_date_is_fixed:
true
due_date_fixed:
expected_due_date
,
start_date_is_fixed:
true
,
due_date_is_fixed:
true
,
start_date_sourcing_milestone_id:
milestone
.
id
,
due_date_sourcing_milestone_id:
milestone
.
id
,
start_date_sourcing_epic:
start_date_sourcing_epic
,
due_date_sourcing_epic:
due_date_sourcing_epic
)
)
end
end
...
@@ -164,14 +171,25 @@
...
@@ -164,14 +171,25 @@
:fixed
,
:fixed
,
work_item:
work_item
,
work_item:
work_item
,
start_date:
expected_start_date
,
start_date:
expected_start_date
,
due_date:
expected_due_date
)
due_date:
expected_due_date
,
start_date_sourcing_milestone_id:
milestone
.
id
,
due_date_sourcing_milestone_id:
milestone
.
id
,
start_date_sourcing_work_item_id:
start_date_sourcing_epic
.
issue_id
,
due_date_sourcing_work_item_id:
due_date_sourcing_epic
.
issue_id
)
end
end
it
{
is_expected
.
to
be_empty
}
it
{
is_expected
.
to
be_empty
}
end
end
context
'when it is different'
do
context
'when it is different'
do
it
{
is_expected
.
to
include
(
"start_date_fixed"
,
"due_date_fixed"
,
"start_date_is_fixed"
,
"due_date_is_fixed"
)
}
it
do
is_expected
.
to
include
(
"start_date_fixed"
,
"due_date_fixed"
,
"start_date_is_fixed"
,
"due_date_is_fixed"
,
"start_date_sourcing_milestone"
,
"due_date_sourcing_milestone"
,
"start_date_sourcing_epic"
,
"due_date_sourcing_epic"
)
end
end
end
end
end
...
...
此差异已折叠。
点击以展开。
预览
0%
加载中
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录