Skip to content
Snippets Groups Projects
Commit 1e736fb5 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre
Browse files

Allow users to import cross-repository pull requests from GitHub

parent 51cf14b3
No related branches found
No related tags found
No related merge requests found
Loading
@@ -18,9 +18,6 @@ At its current state, GitHub importer can import:
Loading
@@ -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
Loading
Loading
Loading
@@ -33,7 +33,7 @@ module Gitlab
Loading
@@ -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
Loading
@@ -68,10 +68,6 @@ module Gitlab
Loading
@@ -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
Loading
Loading
Loading
@@ -178,8 +178,8 @@ describe Gitlab::GithubImport::PullRequestFormatter, lib: true do
Loading
@@ -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 false' do it 'returns true' do
expect(pull_request.valid?).to eq false expect(pull_request.valid?).to eq true
end end
end end
   
Loading
@@ -187,8 +187,8 @@ describe Gitlab::GithubImport::PullRequestFormatter, lib: true do
Loading
@@ -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 false' do it 'returns true' do
expect(pull_request.valid?).to eq false expect(pull_request.valid?).to eq true
end end
end end
end end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment