summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-12-20 11:11:24 +0000
committerRémy Coutable <remy@rymai.me>2016-12-20 11:11:24 +0000
commit367b68a01d7faaab601519993bea609118a93bbb (patch)
tree69881e90733d3d2cb8b312b4cf7c1f3f14f58769 /spec/models
parent4e169327bf031603d31398940a86346d44e7521a (diff)
parentab06313c36fc5856b2472d3dfcb966a8c6341d0b (diff)
downloadgitlab-ce-367b68a01d7faaab601519993bea609118a93bbb.tar.gz
Merge branch '22348-gitea-importer' into 'master'
It adds a brand new importer for Gitea! This is a continuation of !6945 started by @bkc. Gitea aims to be 100% GitHub-compatible but there's a few differences: - Gitea is not an OAuth provider (yet): https://github.com/go-gitea/gitea/issues/27 - This means we cannot map Gitea users given an assignee ID => assignees are not set on imported issues and merge requests - No releases API for now: https://github.com/go-gitea/gitea/issues/330 - API version is `v1` (GitHub is `v3`) - The IID field for milestones is `id` compared to `number` in GitHub. - Issues, PRs, milestones, labels don't have a `url` field (the importer now fallback to `''` in that case) **Known issues:** - Comments are not imported because comments JSON always have a blank `html_url`/`issue_url`/`pull_request_url`, so the IID cannot be extracted and the issuable cannot be found... :( This is tracked in https://github.com/go-gitea/gitea/issues/401, and solved by https://github.com/gogits/gogs/pull/3624 but this needs to be submitted / merged in Gitea. This is noted in the documentation. ## Are there points in the code the reviewer needs to double check? 1. I've made `Import::GiteaController` inherit from `Import::GithubController` since both controllers should be identical in the long-term and their current differences are small. 1. I've added a base `IssuableFormatter` class from which `IssueFormatter` & `PullRequestFormatter` inherit 1. I've added shared examples for GitHub/Gitea importer classes 1. I've made `Gitlab::ImportSources` more robust and tested! :christmas_tree: 1. I've added routing specs for import routes! :christmas_tree: Closes #22348 See merge request !8116
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/project_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index 53b504fdfba..0455cd2fe49 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -1458,6 +1458,18 @@ describe Project, models: true do
end
end
+ describe '#gitlab_project_import?' do
+ subject(:project) { build(:project, import_type: 'gitlab_project') }
+
+ it { expect(project.gitlab_project_import?).to be true }
+ end
+
+ describe '#gitea_import?' do
+ subject(:project) { build(:project, import_type: 'gitea') }
+
+ it { expect(project.gitea_import?).to be true }
+ end
+
describe '#lfs_enabled?' do
let(:project) { create(:project) }