mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-19 00:10:15 +00:00
Add migrate from OneDev (#16356)
* Use context to simplify logic. * Added migration from OneDev. This PR adds [OneDev](https://code.onedev.io/) as migration source. Supported: - [x] Milestones - [x] Issues - [x] Pull Requests - [x] Comments - [x] Reviews - [x] Labels
This commit is contained in:
parent
2d1935acc7
commit
cee5f7c5e2
24 changed files with 1093 additions and 92 deletions
|
@ -7,6 +7,25 @@ package base
|
|||
|
||||
import "time"
|
||||
|
||||
// IssueContext is used to map between local and foreign issue/PR ids.
|
||||
type IssueContext interface {
|
||||
LocalID() int64
|
||||
ForeignID() int64
|
||||
}
|
||||
|
||||
// BasicIssueContext is a 1:1 mapping between local and foreign ids.
|
||||
type BasicIssueContext int64
|
||||
|
||||
// LocalID gets the local id.
|
||||
func (c BasicIssueContext) LocalID() int64 {
|
||||
return int64(c)
|
||||
}
|
||||
|
||||
// ForeignID gets the foreign id.
|
||||
func (c BasicIssueContext) ForeignID() int64 {
|
||||
return int64(c)
|
||||
}
|
||||
|
||||
// Issue is a standard issue information
|
||||
type Issue struct {
|
||||
Number int64
|
||||
|
@ -25,4 +44,5 @@ type Issue struct {
|
|||
Labels []*Label
|
||||
Reactions []*Reaction
|
||||
Assignees []string
|
||||
Context IssueContext `yaml:"-"`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue