summaryrefslogtreecommitdiff
path: root/config/routes
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 /config/routes
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 'config/routes')
-rw-r--r--config/routes/import.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/config/routes/import.rb b/config/routes/import.rb
index 89f3b3f6378..c378253bf15 100644
--- a/config/routes/import.rb
+++ b/config/routes/import.rb
@@ -6,6 +6,12 @@ namespace :import do
get :jobs
end
+ resource :gitea, only: [:create, :new], controller: :gitea do
+ post :personal_access_token
+ get :status
+ get :jobs
+ end
+
resource :gitlab, only: [:create], controller: :gitlab do
get :status
get :callback