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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
ba429a6e
Commit
ba429a6e
authored
Aug 08, 2019
by
George Koltsov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply code review feedback
parent
9baa7ee1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
16 deletions
+13
-16
changelogs/unreleased/georgekoltsov-63408-user-mapping.yml
changelogs/unreleased/georgekoltsov-63408-user-mapping.yml
+1
-2
doc/user/project/import/bitbucket.md
doc/user/project/import/bitbucket.md
+6
-6
lib/gitlab/bitbucket_import/importer.rb
lib/gitlab/bitbucket_import/importer.rb
+4
-6
spec/lib/gitlab/bitbucket_import/importer_spec.rb
spec/lib/gitlab/bitbucket_import/importer_spec.rb
+2
-2
No files found.
changelogs/unreleased/georgekoltsov-63408-user-mapping.yml
View file @
ba429a6e
---
title
:
'
Fix
BitBucketCloud
imported
project'
'
s
comments
missing
author
line
('
'
Created
by:
<user>'
'
)'
title
:
'
Fix
missing
author
line
(`Created
by:
<user>`)
in
MRs/issues/comments
of
imported
Bitbucket
Cloud
project'
merge_request
:
31579
author
:
type
:
fixed
doc/user/project/import/bitbucket.md
View file @
ba429a6e
...
...
@@ -31,12 +31,12 @@ to enable this if not already.
## How it works
When issues/pull requests are being imported, the Bitbucket importer tries to find
the Bitbucket author/assignee in GitLab's database using the Bitbucket
`nickname`
.
For this
to work, the Bitbucket author/assignee should have their
`nickname`
match their Bitbucket
`username`
, signed in beforehand in GitLab and
**associated their Bitbucket account**
.
If the user is not found in GitLab's database, the project creator (most of the times the
current user that started the import process) is set as the author, but a reference on
the issue about the original Bitbucket author is kept.
the Bitbucket author/assignee in GitLab's database using the Bitbucket
`nickname`
.
For this to work, the Bitbucket author/assignee should have signed in beforehand in GitLab
and
**associated their Bitbucket account**
. Their
`nickname`
must also match their Bitbucket
`username.`
. If the user is not found in GitLab's database, the project creator
(most of the times the current user that started the import process) is set as the author,
but a reference on
the issue about the original Bitbucket author is kept.
The importer will create any new namespaces (groups) if they don't exist or in
the case the namespace is taken, the repository will be imported under the user's
...
...
lib/gitlab/bitbucket_import/importer.rb
View file @
ba429a6e
...
...
@@ -260,20 +260,18 @@ module Gitlab
end
def
pull_request_comment_attributes
(
comment
)
author_id
=
gitlab_user_id
(
project
,
comment
.
author
)
{
project:
project
,
note:
comment_note
(
comment
,
author_id
),
author_id:
author_id
,
note:
comment_note
(
comment
),
author_id:
gitlab_user_id
(
project
,
comment
.
author
)
,
created_at:
comment
.
created_at
,
updated_at:
comment
.
updated_at
}
end
def
comment_note
(
comment
,
author_id
)
def
comment_note
(
comment
)
note
=
''
note
+=
@formatter
.
author_line
(
comment
.
author
)
if
author_id
==
project
.
creator_id
note
+=
@formatter
.
author_line
(
comment
.
author
)
unless
find_user_id
(
comment
.
author
)
note
+
comment
.
note
end
...
...
spec/lib/gitlab/bitbucket_import/importer_spec.rb
View file @
ba429a6e
...
...
@@ -184,11 +184,11 @@ describe Gitlab::BitbucketImport::Importer do
notes
=
merge_request
.
notes
.
order
(
:id
).
to_a
start_note
=
notes
.
first
expect
(
start_note
.
note
).
to
include
(
@inline_note
.
note
)
expect
(
start_note
.
note
).
to
eq
(
@inline_note
.
note
)
expect
(
start_note
.
note
).
not_to
include
(
author_line
)
reply_note
=
notes
.
last
expect
(
reply_note
.
note
).
to
include
(
@reply
.
note
)
expect
(
reply_note
.
note
).
to
eq
(
@reply
.
note
)
expect
(
reply_note
.
note
).
not_to
include
(
author_line
)
end
end
...
...
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