diff options
author | John Kristensen <john@jerrykan.com> | 2019-06-11 10:27:26 +0300 |
---|---|---|
committer | John Kristensen <john@jerrykan.com> | 2019-06-12 03:52:54 +0300 |
commit | e47d9b3d0414176c77533d814656a6c691001ea9 (patch) | |
tree | bc5f25761bb33fe32b90c16095e919bb39429b6a /spec/lib/gitlab/legacy_github_import | |
parent | c6152f3d28fd609600eeea10fbd38202b33af2d9 (diff) |
Don't import pull request comments from Gitea repos
The Gitea API does not provide the following API endpoint for pull request
comments:
/api/v1/repos/{owner}/{repo}/pulls/comments
When the importer attempts to request this endpoint it receives a '404
Not Found' error which causes the import to fail. By skipping any
attempts to import pull requests comments from Gitea we can ensure that
the import can complete successfully.
Diffstat (limited to 'spec/lib/gitlab/legacy_github_import')
-rw-r--r-- | spec/lib/gitlab/legacy_github_import/importer_spec.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/spec/lib/gitlab/legacy_github_import/importer_spec.rb b/spec/lib/gitlab/legacy_github_import/importer_spec.rb index 6bc3792eb22..70a09c4bdc5 100644 --- a/spec/lib/gitlab/legacy_github_import/importer_spec.rb +++ b/spec/lib/gitlab/legacy_github_import/importer_spec.rb @@ -24,7 +24,13 @@ describe Gitlab::LegacyGithubImport::Importer do end expect(importer).to receive(:import_comments).with(:issues) - expect(importer).to receive(:import_comments).with(:pull_requests) + + if expected_not_called.include? :import_comments_pull_requests + expect(importer).not_to receive(:import_comments).with(:pull_requests) + expected_not_called.delete_at expected_not_called.index :import_comments_pull_requests + else + expect(importer).to receive(:import_comments).with(:pull_requests) + end expected_not_called.each do |method_name| expect(importer).not_to receive(method_name) @@ -289,7 +295,7 @@ describe Gitlab::LegacyGithubImport::Importer do end it_behaves_like 'Gitlab::LegacyGithubImport::Importer#execute' do - let(:expected_not_called) { [:import_releases] } + let(:expected_not_called) { [:import_releases, :import_comments_pull_requests] } end it_behaves_like 'Gitlab::LegacyGithubImport::Importer#execute an error occurs' it_behaves_like 'Gitlab::LegacyGithubImport unit-testing' |