Skip to content

Commit 7e1ae38

Browse files
authored
Move migrations into services and base into modules/migration (#17663)
* Move migrtions into services and base into modules/migration * Fix imports * Fix lint
1 parent 48ccd32 commit 7e1ae38

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+51
-52
lines changed

cmd/dump_repo.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import (
1111

1212
"code.gitea.io/gitea/modules/convert"
1313
"code.gitea.io/gitea/modules/log"
14-
"code.gitea.io/gitea/modules/migrations"
15-
"code.gitea.io/gitea/modules/migrations/base"
14+
base "code.gitea.io/gitea/modules/migration"
1615
"code.gitea.io/gitea/modules/setting"
1716
"code.gitea.io/gitea/modules/structs"
17+
"code.gitea.io/gitea/services/migrations"
1818

1919
"github.com/urfave/cli"
2020
)

integrations/migrate_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ import (
88
"os"
99
"testing"
1010

11-
"code.gitea.io/gitea/models/unittest"
12-
1311
"code.gitea.io/gitea/models"
14-
"code.gitea.io/gitea/modules/migrations"
12+
"code.gitea.io/gitea/models/unittest"
1513
"code.gitea.io/gitea/modules/setting"
14+
"code.gitea.io/gitea/services/migrations"
1615

1716
"github.com/stretchr/testify/assert"
1817
)

integrations/mirror_pull_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"code.gitea.io/gitea/models"
1212
"code.gitea.io/gitea/models/unittest"
1313
"code.gitea.io/gitea/modules/git"
14-
migration "code.gitea.io/gitea/modules/migrations/base"
14+
"code.gitea.io/gitea/modules/migration"
1515
"code.gitea.io/gitea/modules/repository"
1616
mirror_service "code.gitea.io/gitea/services/mirror"
1717
release_service "code.gitea.io/gitea/services/release"

models/task.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
"code.gitea.io/gitea/models/db"
1111
"code.gitea.io/gitea/modules/json"
12-
migration "code.gitea.io/gitea/modules/migrations/base"
12+
"code.gitea.io/gitea/modules/migration"
1313
"code.gitea.io/gitea/modules/secret"
1414
"code.gitea.io/gitea/modules/setting"
1515
"code.gitea.io/gitea/modules/structs"

modules/migrations/base/comment.go renamed to modules/migration/comment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Use of this source code is governed by a MIT-style
44
// license that can be found in the LICENSE file.
55

6-
package base
6+
package migration
77

88
import "time"
99

modules/migrations/base/downloader.go renamed to modules/migration/downloader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Use of this source code is governed by a MIT-style
44
// license that can be found in the LICENSE file.
55

6-
package base
6+
package migration
77

88
import (
99
"context"

modules/migrations/base/error.go renamed to modules/migration/error.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package base
5+
package migration
66

77
import "fmt"
88

modules/migrations/base/issue.go renamed to modules/migration/issue.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Use of this source code is governed by a MIT-style
44
// license that can be found in the LICENSE file.
55

6-
package base
6+
package migration
77

88
import "time"
99

modules/migrations/base/label.go renamed to modules/migration/label.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Use of this source code is governed by a MIT-style
44
// license that can be found in the LICENSE file.
55

6-
package base
6+
package migration
77

88
// Label defines a standard label information
99
type Label struct {

modules/migrations/base/messenger.go renamed to modules/migration/messenger.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package base
5+
package migration
66

77
// Messenger is a formatting function similar to i18n.Tr
88
type Messenger func(key string, args ...interface{})

modules/migrations/base/milestone.go renamed to modules/migration/milestone.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Use of this source code is governed by a MIT-style
44
// license that can be found in the LICENSE file.
55

6-
package base
6+
package migration
77

88
import "time"
99

modules/migrations/base/null_downloader.go renamed to modules/migration/null_downloader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package base
5+
package migration
66

77
import (
88
"context"

modules/migrations/base/options.go renamed to modules/migration/options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Use of this source code is governed by a MIT-style
44
// license that can be found in the LICENSE file.
55

6-
package base
6+
package migration
77

88
import "code.gitea.io/gitea/modules/structs"
99

modules/migrations/base/pullrequest.go renamed to modules/migration/pullrequest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Use of this source code is governed by a MIT-style
44
// license that can be found in the LICENSE file.
55

6-
package base
6+
package migration
77

88
import (
99
"fmt"

modules/migrations/base/reaction.go renamed to modules/migration/reaction.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package base
5+
package migration
66

77
// Reaction represents a reaction to an issue/pr/comment.
88
type Reaction struct {

modules/migrations/base/release.go renamed to modules/migration/release.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package base
5+
package migration
66

77
import (
88
"io"

modules/migrations/base/repo.go renamed to modules/migration/repo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Use of this source code is governed by a MIT-style
44
// license that can be found in the LICENSE file.
55

6-
package base
6+
package migration
77

88
// Repository defines a standard repository information
99
type Repository struct {

modules/migrations/base/retry_downloader.go renamed to modules/migration/retry_downloader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package base
5+
package migration
66

77
import (
88
"context"

modules/migrations/base/review.go renamed to modules/migration/review.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package base
5+
package migration
66

77
import "time"
88

modules/migrations/base/uploader.go renamed to modules/migration/uploader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Use of this source code is governed by a MIT-style
44
// license that can be found in the LICENSE file.
55

6-
package base
6+
package migration
77

88
// Uploader uploads all the information of one repository
99
type Uploader interface {

modules/repository/repo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"code.gitea.io/gitea/modules/git"
1919
"code.gitea.io/gitea/modules/lfs"
2020
"code.gitea.io/gitea/modules/log"
21-
migration "code.gitea.io/gitea/modules/migrations/base"
21+
"code.gitea.io/gitea/modules/migration"
2222
"code.gitea.io/gitea/modules/setting"
2323
"code.gitea.io/gitea/modules/timeutil"
2424
"code.gitea.io/gitea/modules/util"

modules/task/migrate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ import (
1414
"code.gitea.io/gitea/modules/graceful"
1515
"code.gitea.io/gitea/modules/json"
1616
"code.gitea.io/gitea/modules/log"
17-
"code.gitea.io/gitea/modules/migrations"
18-
migration "code.gitea.io/gitea/modules/migrations/base"
17+
"code.gitea.io/gitea/modules/migration"
1918
"code.gitea.io/gitea/modules/notification"
2019
"code.gitea.io/gitea/modules/process"
2120
"code.gitea.io/gitea/modules/structs"
2221
"code.gitea.io/gitea/modules/timeutil"
2322
"code.gitea.io/gitea/modules/util"
23+
"code.gitea.io/gitea/services/migrations"
2424
)
2525

2626
func handleCreateError(owner *models.User, err error) error {

modules/task/task.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"code.gitea.io/gitea/modules/graceful"
1212
"code.gitea.io/gitea/modules/json"
1313
"code.gitea.io/gitea/modules/log"
14-
"code.gitea.io/gitea/modules/migrations/base"
14+
base "code.gitea.io/gitea/modules/migration"
1515
"code.gitea.io/gitea/modules/queue"
1616
repo_module "code.gitea.io/gitea/modules/repository"
1717
"code.gitea.io/gitea/modules/secret"

routers/api/v1/repo/migrate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ import (
1717
"code.gitea.io/gitea/modules/graceful"
1818
"code.gitea.io/gitea/modules/lfs"
1919
"code.gitea.io/gitea/modules/log"
20-
"code.gitea.io/gitea/modules/migrations"
21-
"code.gitea.io/gitea/modules/migrations/base"
20+
base "code.gitea.io/gitea/modules/migration"
2221
"code.gitea.io/gitea/modules/notification"
2322
repo_module "code.gitea.io/gitea/modules/repository"
2423
"code.gitea.io/gitea/modules/setting"
2524
api "code.gitea.io/gitea/modules/structs"
2625
"code.gitea.io/gitea/modules/util"
2726
"code.gitea.io/gitea/modules/web"
2827
"code.gitea.io/gitea/services/forms"
28+
"code.gitea.io/gitea/services/migrations"
2929
)
3030

3131
// Migrate migrate remote git repository to gitea

routers/init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424
"code.gitea.io/gitea/modules/log"
2525
"code.gitea.io/gitea/modules/markup"
2626
"code.gitea.io/gitea/modules/markup/external"
27-
repo_migrations "code.gitea.io/gitea/modules/migrations"
2827
"code.gitea.io/gitea/modules/notification"
2928
repo_module "code.gitea.io/gitea/modules/repository"
3029
"code.gitea.io/gitea/modules/setting"
@@ -43,6 +42,7 @@ import (
4342
"code.gitea.io/gitea/services/auth/source/oauth2"
4443
"code.gitea.io/gitea/services/cron"
4544
"code.gitea.io/gitea/services/mailer"
45+
repo_migrations "code.gitea.io/gitea/services/migrations"
4646
mirror_service "code.gitea.io/gitea/services/mirror"
4747
pull_service "code.gitea.io/gitea/services/pull"
4848
"code.gitea.io/gitea/services/repository"

routers/private/restore_repo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010

1111
myCtx "code.gitea.io/gitea/modules/context"
1212
"code.gitea.io/gitea/modules/json"
13-
"code.gitea.io/gitea/modules/migrations"
1413
"code.gitea.io/gitea/modules/private"
14+
"code.gitea.io/gitea/services/migrations"
1515
)
1616

1717
// RestoreRepo restore a repository from data

routers/web/repo/migrate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ import (
1414
"code.gitea.io/gitea/modules/context"
1515
"code.gitea.io/gitea/modules/lfs"
1616
"code.gitea.io/gitea/modules/log"
17-
"code.gitea.io/gitea/modules/migrations"
1817
"code.gitea.io/gitea/modules/setting"
1918
"code.gitea.io/gitea/modules/structs"
2019
"code.gitea.io/gitea/modules/task"
2120
"code.gitea.io/gitea/modules/util"
2221
"code.gitea.io/gitea/modules/web"
2322
"code.gitea.io/gitea/services/forms"
23+
"code.gitea.io/gitea/services/migrations"
2424
)
2525

2626
const (

routers/web/repo/setting.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
"code.gitea.io/gitea/modules/git"
2323
"code.gitea.io/gitea/modules/lfs"
2424
"code.gitea.io/gitea/modules/log"
25-
"code.gitea.io/gitea/modules/migrations"
2625
"code.gitea.io/gitea/modules/repository"
2726
"code.gitea.io/gitea/modules/setting"
2827
"code.gitea.io/gitea/modules/structs"
@@ -34,6 +33,7 @@ import (
3433
"code.gitea.io/gitea/routers/utils"
3534
"code.gitea.io/gitea/services/forms"
3635
"code.gitea.io/gitea/services/mailer"
36+
"code.gitea.io/gitea/services/migrations"
3737
mirror_service "code.gitea.io/gitea/services/mirror"
3838
repo_service "code.gitea.io/gitea/services/repository"
3939
wiki_service "code.gitea.io/gitea/services/wiki"

services/cron/tasks_basic.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import (
1010

1111
"code.gitea.io/gitea/models"
1212
"code.gitea.io/gitea/models/webhook"
13-
"code.gitea.io/gitea/modules/migrations"
1413
repository_service "code.gitea.io/gitea/modules/repository"
1514
"code.gitea.io/gitea/modules/setting"
1615
"code.gitea.io/gitea/services/auth"
16+
"code.gitea.io/gitea/services/migrations"
1717
mirror_service "code.gitea.io/gitea/services/mirror"
1818
)
1919

modules/migrations/dump.go renamed to services/migrations/dump.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"code.gitea.io/gitea/models"
2121
"code.gitea.io/gitea/modules/git"
2222
"code.gitea.io/gitea/modules/log"
23-
"code.gitea.io/gitea/modules/migrations/base"
23+
base "code.gitea.io/gitea/modules/migration"
2424
"code.gitea.io/gitea/modules/repository"
2525
"code.gitea.io/gitea/modules/structs"
2626

File renamed without changes.

modules/migrations/git.go renamed to services/migrations/git.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package migrations
77
import (
88
"context"
99

10-
"code.gitea.io/gitea/modules/migrations/base"
10+
base "code.gitea.io/gitea/modules/migration"
1111
)
1212

1313
var (

modules/migrations/gitbucket.go renamed to services/migrations/gitbucket.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"net/url"
1010
"strings"
1111

12-
"code.gitea.io/gitea/modules/migrations/base"
12+
base "code.gitea.io/gitea/modules/migration"
1313
"code.gitea.io/gitea/modules/structs"
1414
)
1515

modules/migrations/gitea_downloader.go renamed to services/migrations/gitea_downloader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717

1818
"code.gitea.io/gitea/models"
1919
"code.gitea.io/gitea/modules/log"
20-
"code.gitea.io/gitea/modules/migrations/base"
20+
base "code.gitea.io/gitea/modules/migration"
2121
"code.gitea.io/gitea/modules/proxy"
2222
"code.gitea.io/gitea/modules/setting"
2323
"code.gitea.io/gitea/modules/structs"

modules/migrations/gitea_downloader_test.go renamed to services/migrations/gitea_downloader_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"testing"
1313
"time"
1414

15-
"code.gitea.io/gitea/modules/migrations/base"
15+
base "code.gitea.io/gitea/modules/migration"
1616

1717
"github.com/stretchr/testify/assert"
1818
)

modules/migrations/gitea_uploader.go renamed to services/migrations/gitea_uploader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
"code.gitea.io/gitea/models/db"
2020
"code.gitea.io/gitea/modules/git"
2121
"code.gitea.io/gitea/modules/log"
22-
"code.gitea.io/gitea/modules/migrations/base"
22+
base "code.gitea.io/gitea/modules/migration"
2323
repo_module "code.gitea.io/gitea/modules/repository"
2424
"code.gitea.io/gitea/modules/setting"
2525
"code.gitea.io/gitea/modules/storage"

modules/migrations/gitea_uploader_test.go renamed to services/migrations/gitea_uploader_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"code.gitea.io/gitea/models/db"
1515
"code.gitea.io/gitea/models/unittest"
1616
"code.gitea.io/gitea/modules/graceful"
17-
"code.gitea.io/gitea/modules/migrations/base"
17+
base "code.gitea.io/gitea/modules/migration"
1818
"code.gitea.io/gitea/modules/structs"
1919
"code.gitea.io/gitea/modules/util"
2020

modules/migrations/github.go renamed to services/migrations/github.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"time"
1818

1919
"code.gitea.io/gitea/modules/log"
20-
"code.gitea.io/gitea/modules/migrations/base"
20+
base "code.gitea.io/gitea/modules/migration"
2121
"code.gitea.io/gitea/modules/proxy"
2222
"code.gitea.io/gitea/modules/setting"
2323
"code.gitea.io/gitea/modules/structs"

modules/migrations/github_test.go renamed to services/migrations/github_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"testing"
1212
"time"
1313

14-
"code.gitea.io/gitea/modules/migrations/base"
14+
base "code.gitea.io/gitea/modules/migration"
1515

1616
"github.com/stretchr/testify/assert"
1717
)

modules/migrations/gitlab.go renamed to services/migrations/gitlab.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"time"
1818

1919
"code.gitea.io/gitea/modules/log"
20-
"code.gitea.io/gitea/modules/migrations/base"
20+
base "code.gitea.io/gitea/modules/migration"
2121
"code.gitea.io/gitea/modules/proxy"
2222
"code.gitea.io/gitea/modules/setting"
2323
"code.gitea.io/gitea/modules/structs"

0 commit comments

Comments
 (0)