Resolve "Test GitHub importer with Gogs"
What does this MR do?
It adds a brand new importer for Gitea!
This is a continuation of !6945 (closed) 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 isv3
) - The IID field for milestones is
id
compared tonumber
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?
- I've made
Import::GiteaController
inherit fromImport::GithubController
since both controllers should be identical in the long-term and their current differences are small. - I've added a base
IssuableFormatter
class from whichIssueFormatter
&PullRequestFormatter
inherit - I've added shared examples for GitHub/Gitea importer classes
- I've made
Gitlab::ImportSources
more robust and tested!🎄 - I've added routing specs for import routes!
🎄
Screenshots
Usage
Issues
Gitea | GitLab |
---|---|
Pull/Merge requests
Gitea | GitLab |
---|---|
Labels
Gitea | GitLab |
---|---|
Milestones
Gitea | GitLab |
---|---|
Releases
Gitea | GitLab |
---|---|
Does this MR meet the acceptance criteria?
-
Changelog entry added -
Documentation created/updated => !8139 (merged) - Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Branch has no merge conflicts with master
(if it does - rebase it please) -
Squashed related commits together
Closes #22348 (closed)