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
0085b76f
Commit
0085b76f
authored
Jul 31, 2018
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Give some context on threaded discussions
parent
710d8210
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
7 deletions
+21
-7
lib/gitlab/bitbucket_server_import/importer.rb
lib/gitlab/bitbucket_server_import/importer.rb
+9
-1
spec/lib/gitlab/bitbucket_server_import/importer_spec.rb
spec/lib/gitlab/bitbucket_server_import/importer_spec.rb
+12
-6
No files found.
lib/gitlab/bitbucket_server_import/importer.rb
View file @
0085b76f
...
...
@@ -293,9 +293,17 @@ module Gitlab
end
def
pull_request_comment_attributes
(
comment
)
note
=
# Provide some context for replying
if
comment
.
parent_comment
">
#{
comment
.
parent_comment
.
note
.
truncate
(
80
)
}
\n\n
#{
comment
.
note
}
"
else
comment
.
note
end
{
project:
project
,
note:
comment
.
note
,
note:
note
,
author_id:
gitlab_user_id
(
comment
.
author_email
),
created_at:
comment
.
created_at
,
updated_at:
comment
.
updated_at
...
...
spec/lib/gitlab/bitbucket_server_import/importer_spec.rb
View file @
0085b76f
...
...
@@ -75,7 +75,9 @@ describe Gitlab::BitbucketServerImport::Importer do
author_email:
'unknown@gmail.com'
,
comments:
[],
created_at:
now
,
updated_at:
now
)
updated_at:
now
,
parent_comment:
nil
)
@pr_comment
=
instance_double
(
BitbucketServer
::
Representation
::
Activity
,
comment?:
true
,
...
...
@@ -115,8 +117,7 @@ describe Gitlab::BitbucketServerImport::Importer do
author_email:
'someuser@gitlab.com'
,
note:
'I agree'
,
created_at:
now
,
updated_at:
now
)
updated_at:
now
)
# https://gitlab.com/gitlab-org/gitlab-test/compare/c1acaa58bbcbc3eafe538cb8274ba387047b69f8...5937ac0a7beb003549fc5fd26fc247ad
inline_note
=
instance_double
(
...
...
@@ -131,7 +132,10 @@ describe Gitlab::BitbucketServerImport::Importer do
author_email:
'unknown@gmail.com'
,
comments:
[
reply
],
created_at:
now
,
updated_at:
now
)
updated_at:
now
,
parent_comment:
nil
)
allow
(
reply
).
to
receive
(
:parent_comment
).
and_return
(
inline_note
)
inline_comment
=
instance_double
(
BitbucketServer
::
Representation
::
Activity
,
...
...
@@ -161,7 +165,8 @@ describe Gitlab::BitbucketServerImport::Importer do
expect
(
start_note
.
position
.
new_line
).
to
eq
(
inline_note
.
new_pos
)
reply_note
=
notes
.
last
expect
(
reply_note
.
note
).
to
eq
(
reply
.
note
)
# Make sure reply context is included
expect
(
reply_note
.
note
).
to
eq
(
">
#{
inline_note
.
note
}
\n\n
#{
reply
.
note
}
"
)
expect
(
reply_note
.
author
).
to
eq
(
project
.
owner
)
expect
(
reply_note
.
created_at
).
to
eq
(
reply
.
created_at
)
expect
(
reply_note
.
updated_at
).
to
eq
(
reply
.
created_at
)
...
...
@@ -186,7 +191,8 @@ describe Gitlab::BitbucketServerImport::Importer do
author_email:
project
.
owner
.
email
,
comments:
[],
created_at:
now
,
updated_at:
now
)
updated_at:
now
,
parent_comment:
nil
)
inline_comment
=
instance_double
(
BitbucketServer
::
Representation
::
Activity
,
...
...
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