Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
b542c8ae
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,体验更适合开发者的 AI 搜索 >>
提交
b542c8ae
编写于
8月 24, 2020
作者:
G
GitLab Bot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
上级
9119206b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
34 addition
and
6 deletion
+34
-6
app/services/discussions/capture_diff_note_position_service.rb
...ervices/discussions/capture_diff_note_position_service.rb
+4
-1
changelogs/unreleased/236190-bugfix-issue-promote-with-attachments.yml
...released/236190-bugfix-issue-promote-with-attachments.yml
+5
-0
changelogs/unreleased/id-fix-nil-line-codes-for-diff-positions.yml
...s/unreleased/id-fix-nil-line-codes-for-diff-positions.yml
+5
-0
spec/services/discussions/capture_diff_note_position_service_spec.rb
...es/discussions/capture_diff_note_position_service_spec.rb
+20
-5
未找到文件。
app/services/discussions/capture_diff_note_position_service.rb
浏览文件 @
b542c8ae
...
...
@@ -19,13 +19,16 @@ module Discussions
position
=
result
[
:position
]
return
unless
position
line_code
=
position
.
line_code
(
project
.
repository
)
return
unless
line_code
# Currently position data is copied across all notes of a discussion
# It makes sense to store a position only for the first note instead
# Within the newly introduced table we can start doing just that
DiffNotePosition
.
create_or_update_for
(
discussion
.
notes
.
first
,
diff_type: :head
,
position:
position
,
line_code:
position
.
line_code
(
project
.
repository
)
)
line_code:
line_code
)
end
private
...
...
changelogs/unreleased/236190-bugfix-issue-promote-with-attachments.yml
0 → 100644
浏览文件 @
b542c8ae
---
title
:
Fix bug when promoting an Issue with attachments to an Epic
merge_request
:
39654
author
:
type
:
fixed
changelogs/unreleased/id-fix-nil-line-codes-for-diff-positions.yml
0 → 100644
浏览文件 @
b542c8ae
---
title
:
Avoid creating diff position when line-code is nil
merge_request
:
40089
author
:
type
:
fixed
spec/services/discussions/capture_diff_note_position_service_spec.rb
浏览文件 @
b542c8ae
...
...
@@ -29,18 +29,33 @@ RSpec.describe Discussions::CaptureDiffNotePositionService do
end
end
context
'when position tracer returned
nil
position'
do
context
'when position tracer returned position'
do
let!
(
:note
)
{
create
(
:diff_note_on_merge_request
)
}
let
(
:paths
)
{
[
'files/any_file.txt'
]
}
it
'does not create diff note position'
do
before
do
expect
(
note
.
noteable
).
to
receive
(
:merge_ref_head
).
and_return
(
double
.
as_null_object
)
expect_next_instance_of
(
Gitlab
::
Diff
::
PositionTracer
)
do
|
tracer
|
expect
(
tracer
).
to
receive
(
:trace
).
and_return
({
position:
nil
})
expect
(
tracer
).
to
receive
(
:trace
).
and_return
({
position:
position
})
end
end
expect
(
subject
.
execute
(
note
.
discussion
)).
to
eq
(
nil
)
expect
(
note
.
diff_note_positions
).
to
be_empty
context
'which is nil'
do
let
(
:position
)
{
nil
}
it
'does not create diff note position'
do
expect
(
subject
.
execute
(
note
.
discussion
)).
to
eq
(
nil
)
expect
(
note
.
diff_note_positions
).
to
be_empty
end
end
context
'which does not have a corresponding line'
do
let
(
:position
)
{
double
(
line_code:
nil
)
}
it
'does not create diff note position'
do
expect
(
subject
.
execute
(
note
.
discussion
)).
to
eq
(
nil
)
expect
(
note
.
diff_note_positions
).
to
be_empty
end
end
end
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录