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
Tatuya Kamada
gitlab-ce
Commits
1e736fb5
Commit
1e736fb5
authored
Aug 02, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow users to import cross-repository pull requests from GitHub
parent
51cf14b3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
12 deletions
+5
-12
doc/workflow/importing/import_projects_from_github.md
doc/workflow/importing/import_projects_from_github.md
+0
-3
lib/gitlab/github_import/pull_request_formatter.rb
lib/gitlab/github_import/pull_request_formatter.rb
+1
-5
spec/lib/gitlab/github_import/pull_request_formatter_spec.rb
spec/lib/gitlab/github_import/pull_request_formatter_spec.rb
+4
-4
No files found.
doc/workflow/importing/import_projects_from_github.md
View file @
1e736fb5
...
@@ -18,9 +18,6 @@ At its current state, GitHub importer can import:
...
@@ -18,9 +18,6 @@ At its current state, GitHub importer can import:
With GitLab 8.7+, references to pull requests and issues are preserved.
With GitLab 8.7+, references to pull requests and issues are preserved.
It is not yet possible to import your cross-repository pull requests (those from
forks). We are working on improving this in the near future.
The importer page is visible when you
[
create a new project
][
new-project
]
.
The importer page is visible when you
[
create a new project
][
new-project
]
.
Click on the
**GitHub**
link and, if you are logged in via the GitHub
Click on the
**GitHub**
link and, if you are logged in via the GitHub
integration, you will be redirected to GitHub for permission to access your
integration, you will be redirected to GitHub for permission to access your
...
...
lib/gitlab/github_import/pull_request_formatter.rb
View file @
1e736fb5
...
@@ -33,7 +33,7 @@ module Gitlab
...
@@ -33,7 +33,7 @@ module Gitlab
end
end
def
valid?
def
valid?
source_branch
.
valid?
&&
target_branch
.
valid?
&&
!
cross_project?
source_branch
.
valid?
&&
target_branch
.
valid?
end
end
def
source_branch
def
source_branch
...
@@ -68,10 +68,6 @@ module Gitlab
...
@@ -68,10 +68,6 @@ module Gitlab
raw_data
.
body
||
""
raw_data
.
body
||
""
end
end
def
cross_project?
source_branch_repo
.
id
!=
target_branch_repo
.
id
end
def
description
def
description
formatter
.
author_line
(
author
)
+
body
formatter
.
author_line
(
author
)
+
body
end
end
...
...
spec/lib/gitlab/github_import/pull_request_formatter_spec.rb
View file @
1e736fb5
...
@@ -178,8 +178,8 @@ describe Gitlab::GithubImport::PullRequestFormatter, lib: true do
...
@@ -178,8 +178,8 @@ describe Gitlab::GithubImport::PullRequestFormatter, lib: true do
let
(
:source_repo
)
{
double
(
id:
2
)
}
let
(
:source_repo
)
{
double
(
id:
2
)
}
let
(
:raw_data
)
{
double
(
base_data
)
}
let
(
:raw_data
)
{
double
(
base_data
)
}
it
'returns
fals
e'
do
it
'returns
tru
e'
do
expect
(
pull_request
.
valid?
).
to
eq
fals
e
expect
(
pull_request
.
valid?
).
to
eq
tru
e
end
end
end
end
...
@@ -187,8 +187,8 @@ describe Gitlab::GithubImport::PullRequestFormatter, lib: true do
...
@@ -187,8 +187,8 @@ describe Gitlab::GithubImport::PullRequestFormatter, lib: true do
let
(
:target_repo
)
{
double
(
id:
2
)
}
let
(
:target_repo
)
{
double
(
id:
2
)
}
let
(
:raw_data
)
{
double
(
base_data
)
}
let
(
:raw_data
)
{
double
(
base_data
)
}
it
'returns
fals
e'
do
it
'returns
tru
e'
do
expect
(
pull_request
.
valid?
).
to
eq
fals
e
expect
(
pull_request
.
valid?
).
to
eq
tru
e
end
end
end
end
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