BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
4a788f8a
Unverified
Commit
4a788f8a
authored
Aug 29, 2016
by
Andrew Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only add the original author if there isn't a linked GitLab account
parent
7f07b1b6
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
42 additions
and
6 deletions
+42
-6
CHANGELOG
CHANGELOG
+1
-0
base_formatter.rb
lib/gitlab/github_import/base_formatter.rb
+5
-0
comment_formatter.rb
lib/gitlab/github_import/comment_formatter.rb
+6
-2
issue_formatter.rb
lib/gitlab/github_import/issue_formatter.rb
+6
-2
pull_request_formatter.rb
lib/gitlab/github_import/pull_request_formatter.rb
+6
-2
comment_formatter_spec.rb
spec/lib/gitlab/github_import/comment_formatter_spec.rb
+6
-0
issue_formatter_spec.rb
spec/lib/gitlab/github_import/issue_formatter_spec.rb
+6
-0
pull_request_formatter_spec.rb
spec/lib/gitlab/github_import/pull_request_formatter_spec.rb
+6
-0
No files found.
CHANGELOG
View file @
4a788f8a
...
...
@@ -75,6 +75,7 @@ v 8.12.0 (unreleased)
- Fix repo title alignment (ClemMakesApps)
- Change update interval of contacted_at
- Fix branch title trailing space on hover (ClemMakesApps)
- Don't include 'Created By' tag line when importing from GitHub if there is a linked GitLab account (EspadaV8)
- Award emoji tooltips containing more than 10 usernames are now truncated !4780 (jlogandavison)
- Fix duplicate "me" in award emoji tooltip !5218 (jlogandavison)
- Order award emoji tooltips in order they were added (EspadaV8)
...
...
lib/gitlab/github_import/base_formatter.rb
View file @
4a788f8a
...
...
@@ -20,6 +20,11 @@ module Gitlab
find_by
(
"identities.extern_uid = ? AND identities.provider = 'github'"
,
github_id
.
to_s
).
try
(
:id
)
end
def
gitlab_author_id
return
@gitlab_author_id
if
defined?
(
@gitlab_author_id
)
@gitlab_author_id
=
gitlab_user_id
(
raw_data
.
user
.
id
)
end
end
end
end
lib/gitlab/github_import/comment_formatter.rb
View file @
4a788f8a
...
...
@@ -21,7 +21,7 @@ module Gitlab
end
def
author_id
gitlab_
user_id
(
raw_data
.
user
.
id
)
||
project
.
creator_id
gitlab_
author_id
||
project
.
creator_id
end
def
body
...
...
@@ -52,7 +52,11 @@ module Gitlab
end
def
note
formatter
.
author_line
(
author
)
+
body
if
gitlab_author_id
body
else
formatter
.
author_line
(
author
)
+
body
end
end
def
type
...
...
lib/gitlab/github_import/issue_formatter.rb
View file @
4a788f8a
...
...
@@ -49,7 +49,7 @@ module Gitlab
end
def
author_id
gitlab_
user_id
(
raw_data
.
user
.
id
)
||
project
.
creator_id
gitlab_
author_id
||
project
.
creator_id
end
def
body
...
...
@@ -57,7 +57,11 @@ module Gitlab
end
def
description
@formatter
.
author_line
(
author
)
+
body
if
gitlab_author_id
body
else
formatter
.
author_line
(
author
)
+
body
end
end
def
milestone
...
...
lib/gitlab/github_import/pull_request_formatter.rb
View file @
4a788f8a
...
...
@@ -77,7 +77,7 @@ module Gitlab
end
def
author_id
gitlab_
user_id
(
raw_data
.
user
.
id
)
||
project
.
creator_id
gitlab_
author_id
||
project
.
creator_id
end
def
body
...
...
@@ -85,7 +85,11 @@ module Gitlab
end
def
description
formatter
.
author_line
(
author
)
+
body
if
gitlab_author_id
body
else
formatter
.
author_line
(
author
)
+
body
end
end
def
milestone
...
...
spec/lib/gitlab/github_import/comment_formatter_spec.rb
View file @
4a788f8a
...
...
@@ -73,6 +73,12 @@ describe Gitlab::GithubImport::CommentFormatter, lib: true do
gl_user
=
create
(
:omniauth_user
,
extern_uid:
octocat
.
id
,
provider:
'github'
)
expect
(
comment
.
attributes
.
fetch
(
:author_id
)).
to
eq
gl_user
.
id
end
it
'returns note without created at tag line'
do
create
(
:omniauth_user
,
extern_uid:
octocat
.
id
,
provider:
'github'
)
expect
(
comment
.
attributes
.
fetch
(
:note
)).
to
eq
(
"I'm having a problem with this."
)
end
end
end
end
spec/lib/gitlab/github_import/issue_formatter_spec.rb
View file @
4a788f8a
...
...
@@ -109,6 +109,12 @@ describe Gitlab::GithubImport::IssueFormatter, lib: true do
expect
(
issue
.
attributes
.
fetch
(
:author_id
)).
to
eq
gl_user
.
id
end
it
'returns description without created at tag line'
do
create
(
:omniauth_user
,
extern_uid:
octocat
.
id
,
provider:
'github'
)
expect
(
issue
.
attributes
.
fetch
(
:description
)).
to
eq
(
"I'm having a problem with this."
)
end
end
end
...
...
spec/lib/gitlab/github_import/pull_request_formatter_spec.rb
View file @
4a788f8a
...
...
@@ -140,6 +140,12 @@ describe Gitlab::GithubImport::PullRequestFormatter, lib: true do
expect
(
pull_request
.
attributes
.
fetch
(
:author_id
)).
to
eq
gl_user
.
id
end
it
'returns description without created at tag line'
do
create
(
:omniauth_user
,
extern_uid:
octocat
.
id
,
provider:
'github'
)
expect
(
pull_request
.
attributes
.
fetch
(
:description
)).
to
eq
(
'Please pull these awesome changes'
)
end
end
context
'when it has a milestone'
do
...
...
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