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
Boxiang Sun
gitlab-ce
Commits
9a9e22a8
Commit
9a9e22a8
authored
Sep 08, 2016
by
Andrew Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename `gl_user_id` to `gitlab_user_id` in importer classes
parent
43d6328f
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
10 deletions
+10
-10
lib/gitlab/bitbucket_import/importer.rb
lib/gitlab/bitbucket_import/importer.rb
+2
-2
lib/gitlab/github_import/base_formatter.rb
lib/gitlab/github_import/base_formatter.rb
+1
-1
lib/gitlab/github_import/comment_formatter.rb
lib/gitlab/github_import/comment_formatter.rb
+1
-1
lib/gitlab/github_import/issue_formatter.rb
lib/gitlab/github_import/issue_formatter.rb
+2
-2
lib/gitlab/github_import/pull_request_formatter.rb
lib/gitlab/github_import/pull_request_formatter.rb
+2
-2
lib/gitlab/gitlab_import/importer.rb
lib/gitlab/gitlab_import/importer.rb
+2
-2
No files found.
lib/gitlab/bitbucket_import/importer.rb
View file @
9a9e22a8
...
@@ -21,7 +21,7 @@ module Gitlab
...
@@ -21,7 +21,7 @@ module Gitlab
private
private
def
g
l
_user_id
(
project
,
bitbucket_id
)
def
g
itlab
_user_id
(
project
,
bitbucket_id
)
if
bitbucket_id
if
bitbucket_id
user
=
User
.
joins
(
:identities
).
find_by
(
"identities.extern_uid = ? AND identities.provider = 'bitbucket'"
,
bitbucket_id
.
to_s
)
user
=
User
.
joins
(
:identities
).
find_by
(
"identities.extern_uid = ? AND identities.provider = 'bitbucket'"
,
bitbucket_id
.
to_s
)
(
user
&&
user
.
id
)
||
project
.
creator_id
(
user
&&
user
.
id
)
||
project
.
creator_id
...
@@ -74,7 +74,7 @@ module Gitlab
...
@@ -74,7 +74,7 @@ module Gitlab
description:
body
,
description:
body
,
title:
issue
[
"title"
],
title:
issue
[
"title"
],
state:
%w(resolved invalid duplicate wontfix closed)
.
include?
(
issue
[
"status"
])
?
'closed'
:
'opened'
,
state:
%w(resolved invalid duplicate wontfix closed)
.
include?
(
issue
[
"status"
])
?
'closed'
:
'opened'
,
author_id:
g
l
_user_id
(
project
,
reporter
)
author_id:
g
itlab
_user_id
(
project
,
reporter
)
)
)
end
end
rescue
ActiveRecord
::
RecordInvalid
=>
e
rescue
ActiveRecord
::
RecordInvalid
=>
e
...
...
lib/gitlab/github_import/base_formatter.rb
View file @
9a9e22a8
...
@@ -15,7 +15,7 @@ module Gitlab
...
@@ -15,7 +15,7 @@ module Gitlab
private
private
def
g
l
_user_id
(
github_id
)
def
g
itlab
_user_id
(
github_id
)
User
.
joins
(
:identities
).
User
.
joins
(
:identities
).
find_by
(
"identities.extern_uid = ? AND identities.provider = 'github'"
,
github_id
.
to_s
).
find_by
(
"identities.extern_uid = ? AND identities.provider = 'github'"
,
github_id
.
to_s
).
try
(
:id
)
try
(
:id
)
...
...
lib/gitlab/github_import/comment_formatter.rb
View file @
9a9e22a8
...
@@ -21,7 +21,7 @@ module Gitlab
...
@@ -21,7 +21,7 @@ module Gitlab
end
end
def
author_id
def
author_id
g
l
_user_id
(
raw_data
.
user
.
id
)
||
project
.
creator_id
g
itlab
_user_id
(
raw_data
.
user
.
id
)
||
project
.
creator_id
end
end
def
body
def
body
...
...
lib/gitlab/github_import/issue_formatter.rb
View file @
9a9e22a8
...
@@ -40,7 +40,7 @@ module Gitlab
...
@@ -40,7 +40,7 @@ module Gitlab
def
assignee_id
def
assignee_id
if
assigned?
if
assigned?
g
l
_user_id
(
raw_data
.
assignee
.
id
)
g
itlab
_user_id
(
raw_data
.
assignee
.
id
)
end
end
end
end
...
@@ -49,7 +49,7 @@ module Gitlab
...
@@ -49,7 +49,7 @@ module Gitlab
end
end
def
author_id
def
author_id
g
l
_user_id
(
raw_data
.
user
.
id
)
||
project
.
creator_id
g
itlab
_user_id
(
raw_data
.
user
.
id
)
||
project
.
creator_id
end
end
def
body
def
body
...
...
lib/gitlab/github_import/pull_request_formatter.rb
View file @
9a9e22a8
...
@@ -68,7 +68,7 @@ module Gitlab
...
@@ -68,7 +68,7 @@ module Gitlab
def
assignee_id
def
assignee_id
if
assigned?
if
assigned?
g
l
_user_id
(
raw_data
.
assignee
.
id
)
g
itlab
_user_id
(
raw_data
.
assignee
.
id
)
end
end
end
end
...
@@ -77,7 +77,7 @@ module Gitlab
...
@@ -77,7 +77,7 @@ module Gitlab
end
end
def
author_id
def
author_id
g
l
_user_id
(
raw_data
.
user
.
id
)
||
project
.
creator_id
g
itlab
_user_id
(
raw_data
.
user
.
id
)
||
project
.
creator_id
end
end
def
body
def
body
...
...
lib/gitlab/gitlab_import/importer.rb
View file @
9a9e22a8
...
@@ -41,7 +41,7 @@ module Gitlab
...
@@ -41,7 +41,7 @@ module Gitlab
title:
issue
[
"title"
],
title:
issue
[
"title"
],
state:
issue
[
"state"
],
state:
issue
[
"state"
],
updated_at:
issue
[
"updated_at"
],
updated_at:
issue
[
"updated_at"
],
author_id:
g
l
_user_id
(
project
,
issue
[
"author"
][
"id"
])
author_id:
g
itlab
_user_id
(
project
,
issue
[
"author"
][
"id"
])
)
)
end
end
end
end
...
@@ -51,7 +51,7 @@ module Gitlab
...
@@ -51,7 +51,7 @@ module Gitlab
private
private
def
g
l
_user_id
(
project
,
gitlab_id
)
def
g
itlab
_user_id
(
project
,
gitlab_id
)
user
=
User
.
joins
(
:identities
).
find_by
(
"identities.extern_uid = ? AND identities.provider = 'gitlab'"
,
gitlab_id
.
to_s
)
user
=
User
.
joins
(
:identities
).
find_by
(
"identities.extern_uid = ? AND identities.provider = 'gitlab'"
,
gitlab_id
.
to_s
)
(
user
&&
user
.
id
)
||
project
.
creator_id
(
user
&&
user
.
id
)
||
project
.
creator_id
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