From 7e1ae380975df0afab3fdc04c7a926181e5daba9 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 16 Nov 2021 23:25:33 +0800 Subject: [PATCH] Move migrations into services and base into modules/migration (#17663) * Move migrtions into services and base into modules/migration * Fix imports * Fix lint --- cmd/dump_repo.go | 4 ++-- integrations/migrate_test.go | 5 ++--- integrations/mirror_pull_test.go | 2 +- models/task.go | 2 +- modules/{migrations/base => migration}/comment.go | 2 +- modules/{migrations/base => migration}/downloader.go | 2 +- modules/{migrations/base => migration}/error.go | 2 +- modules/{migrations/base => migration}/issue.go | 2 +- modules/{migrations/base => migration}/label.go | 2 +- modules/{migrations/base => migration}/messenger.go | 2 +- modules/{migrations/base => migration}/milestone.go | 2 +- modules/{migrations/base => migration}/null_downloader.go | 2 +- modules/{migrations/base => migration}/options.go | 2 +- modules/{migrations/base => migration}/pullrequest.go | 2 +- modules/{migrations/base => migration}/reaction.go | 2 +- modules/{migrations/base => migration}/release.go | 2 +- modules/{migrations/base => migration}/repo.go | 2 +- modules/{migrations/base => migration}/retry_downloader.go | 2 +- modules/{migrations/base => migration}/review.go | 2 +- modules/{migrations/base => migration}/uploader.go | 2 +- modules/repository/repo.go | 2 +- modules/task/migrate.go | 4 ++-- modules/task/task.go | 2 +- routers/api/v1/repo/migrate.go | 4 ++-- routers/init.go | 2 +- routers/private/restore_repo.go | 2 +- routers/web/repo/migrate.go | 2 +- routers/web/repo/setting.go | 2 +- services/cron/tasks_basic.go | 2 +- {modules => services}/migrations/dump.go | 2 +- {modules => services}/migrations/error.go | 0 {modules => services}/migrations/git.go | 2 +- {modules => services}/migrations/gitbucket.go | 2 +- {modules => services}/migrations/gitea_downloader.go | 2 +- {modules => services}/migrations/gitea_downloader_test.go | 2 +- {modules => services}/migrations/gitea_uploader.go | 2 +- {modules => services}/migrations/gitea_uploader_test.go | 2 +- {modules => services}/migrations/github.go | 2 +- {modules => services}/migrations/github_test.go | 2 +- {modules => services}/migrations/gitlab.go | 2 +- {modules => services}/migrations/gitlab_test.go | 2 +- {modules => services}/migrations/gogs.go | 2 +- {modules => services}/migrations/gogs_test.go | 2 +- {modules => services}/migrations/main_test.go | 2 +- {modules => services}/migrations/migrate.go | 2 +- {modules => services}/migrations/migrate_test.go | 0 {modules => services}/migrations/onedev.go | 2 +- {modules => services}/migrations/onedev_test.go | 2 +- {modules => services}/migrations/restore.go | 2 +- {modules => services}/migrations/update.go | 0 50 files changed, 51 insertions(+), 52 deletions(-) rename modules/{migrations/base => migration}/comment.go (96%) rename modules/{migrations/base => migration}/downloader.go (98%) rename modules/{migrations/base => migration}/error.go (97%) rename modules/{migrations/base => migration}/issue.go (98%) rename modules/{migrations/base => migration}/label.go (95%) rename modules/{migrations/base => migration}/messenger.go (95%) rename modules/{migrations/base => migration}/milestone.go (96%) rename modules/{migrations/base => migration}/null_downloader.go (99%) rename modules/{migrations/base => migration}/options.go (98%) rename modules/{migrations/base => migration}/pullrequest.go (99%) rename modules/{migrations/base => migration}/reaction.go (94%) rename modules/{migrations/base => migration}/release.go (98%) rename modules/{migrations/base => migration}/repo.go (96%) rename modules/{migrations/base => migration}/retry_downloader.go (99%) rename modules/{migrations/base => migration}/review.go (98%) rename modules/{migrations/base => migration}/uploader.go (97%) rename {modules => services}/migrations/dump.go (99%) rename {modules => services}/migrations/error.go (100%) rename {modules => services}/migrations/git.go (96%) rename {modules => services}/migrations/gitbucket.go (97%) rename {modules => services}/migrations/gitea_downloader.go (99%) rename {modules => services}/migrations/gitea_downloader_test.go (99%) rename {modules => services}/migrations/gitea_uploader.go (99%) rename {modules => services}/migrations/gitea_uploader_test.go (98%) rename {modules => services}/migrations/github.go (99%) rename {modules => services}/migrations/github_test.go (99%) rename {modules => services}/migrations/gitlab.go (99%) rename {modules => services}/migrations/gitlab_test.go (99%) rename {modules => services}/migrations/gogs.go (99%) rename {modules => services}/migrations/gogs_test.go (98%) rename {modules => services}/migrations/main_test.go (99%) rename {modules => services}/migrations/migrate.go (99%) rename {modules => services}/migrations/migrate_test.go (100%) rename {modules => services}/migrations/onedev.go (99%) rename {modules => services}/migrations/onedev_test.go (98%) rename {modules => services}/migrations/restore.go (99%) rename {modules => services}/migrations/update.go (100%) diff --git a/cmd/dump_repo.go b/cmd/dump_repo.go index 6274b4d865..31f4574c2d 100644 --- a/cmd/dump_repo.go +++ b/cmd/dump_repo.go @@ -11,10 +11,10 @@ import ( "code.gitea.io/gitea/modules/convert" "code.gitea.io/gitea/modules/log" - "code.gitea.io/gitea/modules/migrations" - "code.gitea.io/gitea/modules/migrations/base" + base "code.gitea.io/gitea/modules/migration" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/structs" + "code.gitea.io/gitea/services/migrations" "github.com/urfave/cli" ) diff --git a/integrations/migrate_test.go b/integrations/migrate_test.go index 80eb75d404..e22da7db90 100644 --- a/integrations/migrate_test.go +++ b/integrations/migrate_test.go @@ -8,11 +8,10 @@ import ( "os" "testing" - "code.gitea.io/gitea/models/unittest" - "code.gitea.io/gitea/models" - "code.gitea.io/gitea/modules/migrations" + "code.gitea.io/gitea/models/unittest" "code.gitea.io/gitea/modules/setting" + "code.gitea.io/gitea/services/migrations" "github.com/stretchr/testify/assert" ) diff --git a/integrations/mirror_pull_test.go b/integrations/mirror_pull_test.go index d0823a6cdb..277118a595 100644 --- a/integrations/mirror_pull_test.go +++ b/integrations/mirror_pull_test.go @@ -11,7 +11,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/models/unittest" "code.gitea.io/gitea/modules/git" - migration "code.gitea.io/gitea/modules/migrations/base" + "code.gitea.io/gitea/modules/migration" "code.gitea.io/gitea/modules/repository" mirror_service "code.gitea.io/gitea/services/mirror" release_service "code.gitea.io/gitea/services/release" diff --git a/models/task.go b/models/task.go index 7da9307c95..c8af1a4967 100644 --- a/models/task.go +++ b/models/task.go @@ -9,7 +9,7 @@ import ( "code.gitea.io/gitea/models/db" "code.gitea.io/gitea/modules/json" - migration "code.gitea.io/gitea/modules/migrations/base" + "code.gitea.io/gitea/modules/migration" "code.gitea.io/gitea/modules/secret" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/structs" diff --git a/modules/migrations/base/comment.go b/modules/migration/comment.go similarity index 96% rename from modules/migrations/base/comment.go rename to modules/migration/comment.go index 3c32e63b82..234fea3e82 100644 --- a/modules/migrations/base/comment.go +++ b/modules/migration/comment.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. -package base +package migration import "time" diff --git a/modules/migrations/base/downloader.go b/modules/migration/downloader.go similarity index 98% rename from modules/migrations/base/downloader.go rename to modules/migration/downloader.go index 3c581b8699..90e149fb1a 100644 --- a/modules/migrations/base/downloader.go +++ b/modules/migration/downloader.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. -package base +package migration import ( "context" diff --git a/modules/migrations/base/error.go b/modules/migration/error.go similarity index 97% rename from modules/migrations/base/error.go rename to modules/migration/error.go index 40ddcf4b75..b2608aa09f 100644 --- a/modules/migrations/base/error.go +++ b/modules/migration/error.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. -package base +package migration import "fmt" diff --git a/modules/migrations/base/issue.go b/modules/migration/issue.go similarity index 98% rename from modules/migrations/base/issue.go rename to modules/migration/issue.go index 7addd1336a..26812633f9 100644 --- a/modules/migrations/base/issue.go +++ b/modules/migration/issue.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. -package base +package migration import "time" diff --git a/modules/migrations/base/label.go b/modules/migration/label.go similarity index 95% rename from modules/migrations/base/label.go rename to modules/migration/label.go index 5a66e7620f..1a04a1dd3a 100644 --- a/modules/migrations/base/label.go +++ b/modules/migration/label.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. -package base +package migration // Label defines a standard label information type Label struct { diff --git a/modules/migrations/base/messenger.go b/modules/migration/messenger.go similarity index 95% rename from modules/migrations/base/messenger.go rename to modules/migration/messenger.go index a92f59ef7f..fa8218cf93 100644 --- a/modules/migrations/base/messenger.go +++ b/modules/migration/messenger.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. -package base +package migration // Messenger is a formatting function similar to i18n.Tr type Messenger func(key string, args ...interface{}) diff --git a/modules/migrations/base/milestone.go b/modules/migration/milestone.go similarity index 96% rename from modules/migrations/base/milestone.go rename to modules/migration/milestone.go index 921968fcb5..209aafe6a7 100644 --- a/modules/migrations/base/milestone.go +++ b/modules/migration/milestone.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. -package base +package migration import "time" diff --git a/modules/migrations/base/null_downloader.go b/modules/migration/null_downloader.go similarity index 99% rename from modules/migrations/base/null_downloader.go rename to modules/migration/null_downloader.go index c64d0e2633..05daf72108 100644 --- a/modules/migrations/base/null_downloader.go +++ b/modules/migration/null_downloader.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. -package base +package migration import ( "context" diff --git a/modules/migrations/base/options.go b/modules/migration/options.go similarity index 98% rename from modules/migrations/base/options.go rename to modules/migration/options.go index b12e1f94aa..1e92a1b0b3 100644 --- a/modules/migrations/base/options.go +++ b/modules/migration/options.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. -package base +package migration import "code.gitea.io/gitea/modules/structs" diff --git a/modules/migrations/base/pullrequest.go b/modules/migration/pullrequest.go similarity index 99% rename from modules/migrations/base/pullrequest.go rename to modules/migration/pullrequest.go index b51a14e47c..9ca9a70b7d 100644 --- a/modules/migrations/base/pullrequest.go +++ b/modules/migration/pullrequest.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. -package base +package migration import ( "fmt" diff --git a/modules/migrations/base/reaction.go b/modules/migration/reaction.go similarity index 94% rename from modules/migrations/base/reaction.go rename to modules/migration/reaction.go index 1519499134..004cff2f94 100644 --- a/modules/migrations/base/reaction.go +++ b/modules/migration/reaction.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. -package base +package migration // Reaction represents a reaction to an issue/pr/comment. type Reaction struct { diff --git a/modules/migrations/base/release.go b/modules/migration/release.go similarity index 98% rename from modules/migrations/base/release.go rename to modules/migration/release.go index 8b4339928b..a83f5502cb 100644 --- a/modules/migrations/base/release.go +++ b/modules/migration/release.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. -package base +package migration import ( "io" diff --git a/modules/migrations/base/repo.go b/modules/migration/repo.go similarity index 96% rename from modules/migrations/base/repo.go rename to modules/migration/repo.go index 693a96314d..d0d62de8da 100644 --- a/modules/migrations/base/repo.go +++ b/modules/migration/repo.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. -package base +package migration // Repository defines a standard repository information type Repository struct { diff --git a/modules/migrations/base/retry_downloader.go b/modules/migration/retry_downloader.go similarity index 99% rename from modules/migrations/base/retry_downloader.go rename to modules/migration/retry_downloader.go index 623bfc86b5..1f034ab0c7 100644 --- a/modules/migrations/base/retry_downloader.go +++ b/modules/migration/retry_downloader.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. -package base +package migration import ( "context" diff --git a/modules/migrations/base/review.go b/modules/migration/review.go similarity index 98% rename from modules/migrations/base/review.go rename to modules/migration/review.go index 6344f0384d..d6d15002af 100644 --- a/modules/migrations/base/review.go +++ b/modules/migration/review.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. -package base +package migration import "time" diff --git a/modules/migrations/base/uploader.go b/modules/migration/uploader.go similarity index 97% rename from modules/migrations/base/uploader.go rename to modules/migration/uploader.go index 4d0257df37..57571861aa 100644 --- a/modules/migrations/base/uploader.go +++ b/modules/migration/uploader.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. -package base +package migration // Uploader uploads all the information of one repository type Uploader interface { diff --git a/modules/repository/repo.go b/modules/repository/repo.go index 05306218de..871ba617ad 100644 --- a/modules/repository/repo.go +++ b/modules/repository/repo.go @@ -18,7 +18,7 @@ import ( "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/lfs" "code.gitea.io/gitea/modules/log" - migration "code.gitea.io/gitea/modules/migrations/base" + "code.gitea.io/gitea/modules/migration" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/timeutil" "code.gitea.io/gitea/modules/util" diff --git a/modules/task/migrate.go b/modules/task/migrate.go index 715e76b4ad..100aac1967 100644 --- a/modules/task/migrate.go +++ b/modules/task/migrate.go @@ -14,13 +14,13 @@ import ( "code.gitea.io/gitea/modules/graceful" "code.gitea.io/gitea/modules/json" "code.gitea.io/gitea/modules/log" - "code.gitea.io/gitea/modules/migrations" - migration "code.gitea.io/gitea/modules/migrations/base" + "code.gitea.io/gitea/modules/migration" "code.gitea.io/gitea/modules/notification" "code.gitea.io/gitea/modules/process" "code.gitea.io/gitea/modules/structs" "code.gitea.io/gitea/modules/timeutil" "code.gitea.io/gitea/modules/util" + "code.gitea.io/gitea/services/migrations" ) func handleCreateError(owner *models.User, err error) error { diff --git a/modules/task/task.go b/modules/task/task.go index 51377df78c..f538b36efc 100644 --- a/modules/task/task.go +++ b/modules/task/task.go @@ -11,7 +11,7 @@ import ( "code.gitea.io/gitea/modules/graceful" "code.gitea.io/gitea/modules/json" "code.gitea.io/gitea/modules/log" - "code.gitea.io/gitea/modules/migrations/base" + base "code.gitea.io/gitea/modules/migration" "code.gitea.io/gitea/modules/queue" repo_module "code.gitea.io/gitea/modules/repository" "code.gitea.io/gitea/modules/secret" diff --git a/routers/api/v1/repo/migrate.go b/routers/api/v1/repo/migrate.go index 87ceb547c6..00390dfb5f 100644 --- a/routers/api/v1/repo/migrate.go +++ b/routers/api/v1/repo/migrate.go @@ -17,8 +17,7 @@ import ( "code.gitea.io/gitea/modules/graceful" "code.gitea.io/gitea/modules/lfs" "code.gitea.io/gitea/modules/log" - "code.gitea.io/gitea/modules/migrations" - "code.gitea.io/gitea/modules/migrations/base" + base "code.gitea.io/gitea/modules/migration" "code.gitea.io/gitea/modules/notification" repo_module "code.gitea.io/gitea/modules/repository" "code.gitea.io/gitea/modules/setting" @@ -26,6 +25,7 @@ import ( "code.gitea.io/gitea/modules/util" "code.gitea.io/gitea/modules/web" "code.gitea.io/gitea/services/forms" + "code.gitea.io/gitea/services/migrations" ) // Migrate migrate remote git repository to gitea diff --git a/routers/init.go b/routers/init.go index 6df524dd57..0f19e7f732 100644 --- a/routers/init.go +++ b/routers/init.go @@ -24,7 +24,6 @@ import ( "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/markup" "code.gitea.io/gitea/modules/markup/external" - repo_migrations "code.gitea.io/gitea/modules/migrations" "code.gitea.io/gitea/modules/notification" repo_module "code.gitea.io/gitea/modules/repository" "code.gitea.io/gitea/modules/setting" @@ -43,6 +42,7 @@ import ( "code.gitea.io/gitea/services/auth/source/oauth2" "code.gitea.io/gitea/services/cron" "code.gitea.io/gitea/services/mailer" + repo_migrations "code.gitea.io/gitea/services/migrations" mirror_service "code.gitea.io/gitea/services/mirror" pull_service "code.gitea.io/gitea/services/pull" "code.gitea.io/gitea/services/repository" diff --git a/routers/private/restore_repo.go b/routers/private/restore_repo.go index b7f7ed176f..85aada192f 100644 --- a/routers/private/restore_repo.go +++ b/routers/private/restore_repo.go @@ -10,8 +10,8 @@ import ( myCtx "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/json" - "code.gitea.io/gitea/modules/migrations" "code.gitea.io/gitea/modules/private" + "code.gitea.io/gitea/services/migrations" ) // RestoreRepo restore a repository from data diff --git a/routers/web/repo/migrate.go b/routers/web/repo/migrate.go index b2e6fa890b..d5e0a7696b 100644 --- a/routers/web/repo/migrate.go +++ b/routers/web/repo/migrate.go @@ -14,13 +14,13 @@ import ( "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/lfs" "code.gitea.io/gitea/modules/log" - "code.gitea.io/gitea/modules/migrations" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/structs" "code.gitea.io/gitea/modules/task" "code.gitea.io/gitea/modules/util" "code.gitea.io/gitea/modules/web" "code.gitea.io/gitea/services/forms" + "code.gitea.io/gitea/services/migrations" ) const ( diff --git a/routers/web/repo/setting.go b/routers/web/repo/setting.go index 456084f086..cecd1da07c 100644 --- a/routers/web/repo/setting.go +++ b/routers/web/repo/setting.go @@ -22,7 +22,6 @@ import ( "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/lfs" "code.gitea.io/gitea/modules/log" - "code.gitea.io/gitea/modules/migrations" "code.gitea.io/gitea/modules/repository" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/structs" @@ -34,6 +33,7 @@ import ( "code.gitea.io/gitea/routers/utils" "code.gitea.io/gitea/services/forms" "code.gitea.io/gitea/services/mailer" + "code.gitea.io/gitea/services/migrations" mirror_service "code.gitea.io/gitea/services/mirror" repo_service "code.gitea.io/gitea/services/repository" wiki_service "code.gitea.io/gitea/services/wiki" diff --git a/services/cron/tasks_basic.go b/services/cron/tasks_basic.go index a42c031b36..57fb399d4e 100644 --- a/services/cron/tasks_basic.go +++ b/services/cron/tasks_basic.go @@ -10,10 +10,10 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/models/webhook" - "code.gitea.io/gitea/modules/migrations" repository_service "code.gitea.io/gitea/modules/repository" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/services/auth" + "code.gitea.io/gitea/services/migrations" mirror_service "code.gitea.io/gitea/services/mirror" ) diff --git a/modules/migrations/dump.go b/services/migrations/dump.go similarity index 99% rename from modules/migrations/dump.go rename to services/migrations/dump.go index 6b995c0dea..6e3596230f 100644 --- a/modules/migrations/dump.go +++ b/services/migrations/dump.go @@ -20,7 +20,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/log" - "code.gitea.io/gitea/modules/migrations/base" + base "code.gitea.io/gitea/modules/migration" "code.gitea.io/gitea/modules/repository" "code.gitea.io/gitea/modules/structs" diff --git a/modules/migrations/error.go b/services/migrations/error.go similarity index 100% rename from modules/migrations/error.go rename to services/migrations/error.go diff --git a/modules/migrations/git.go b/services/migrations/git.go similarity index 96% rename from modules/migrations/git.go rename to services/migrations/git.go index 7e41945474..37ffb674c5 100644 --- a/modules/migrations/git.go +++ b/services/migrations/git.go @@ -7,7 +7,7 @@ package migrations import ( "context" - "code.gitea.io/gitea/modules/migrations/base" + base "code.gitea.io/gitea/modules/migration" ) var ( diff --git a/modules/migrations/gitbucket.go b/services/migrations/gitbucket.go similarity index 97% rename from modules/migrations/gitbucket.go rename to services/migrations/gitbucket.go index 72090c2490..27ed584aa2 100644 --- a/modules/migrations/gitbucket.go +++ b/services/migrations/gitbucket.go @@ -9,7 +9,7 @@ import ( "net/url" "strings" - "code.gitea.io/gitea/modules/migrations/base" + base "code.gitea.io/gitea/modules/migration" "code.gitea.io/gitea/modules/structs" ) diff --git a/modules/migrations/gitea_downloader.go b/services/migrations/gitea_downloader.go similarity index 99% rename from modules/migrations/gitea_downloader.go rename to services/migrations/gitea_downloader.go index d8a3c84678..51ef0292df 100644 --- a/modules/migrations/gitea_downloader.go +++ b/services/migrations/gitea_downloader.go @@ -17,7 +17,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/log" - "code.gitea.io/gitea/modules/migrations/base" + base "code.gitea.io/gitea/modules/migration" "code.gitea.io/gitea/modules/proxy" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/structs" diff --git a/modules/migrations/gitea_downloader_test.go b/services/migrations/gitea_downloader_test.go similarity index 99% rename from modules/migrations/gitea_downloader_test.go rename to services/migrations/gitea_downloader_test.go index 71bdecaead..2c70dc4213 100644 --- a/modules/migrations/gitea_downloader_test.go +++ b/services/migrations/gitea_downloader_test.go @@ -12,7 +12,7 @@ import ( "testing" "time" - "code.gitea.io/gitea/modules/migrations/base" + base "code.gitea.io/gitea/modules/migration" "github.com/stretchr/testify/assert" ) diff --git a/modules/migrations/gitea_uploader.go b/services/migrations/gitea_uploader.go similarity index 99% rename from modules/migrations/gitea_uploader.go rename to services/migrations/gitea_uploader.go index d62ce80c77..5eecaf6c56 100644 --- a/modules/migrations/gitea_uploader.go +++ b/services/migrations/gitea_uploader.go @@ -19,7 +19,7 @@ import ( "code.gitea.io/gitea/models/db" "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/log" - "code.gitea.io/gitea/modules/migrations/base" + base "code.gitea.io/gitea/modules/migration" repo_module "code.gitea.io/gitea/modules/repository" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/storage" diff --git a/modules/migrations/gitea_uploader_test.go b/services/migrations/gitea_uploader_test.go similarity index 98% rename from modules/migrations/gitea_uploader_test.go rename to services/migrations/gitea_uploader_test.go index 99de3884ce..9b04004cd7 100644 --- a/modules/migrations/gitea_uploader_test.go +++ b/services/migrations/gitea_uploader_test.go @@ -14,7 +14,7 @@ import ( "code.gitea.io/gitea/models/db" "code.gitea.io/gitea/models/unittest" "code.gitea.io/gitea/modules/graceful" - "code.gitea.io/gitea/modules/migrations/base" + base "code.gitea.io/gitea/modules/migration" "code.gitea.io/gitea/modules/structs" "code.gitea.io/gitea/modules/util" diff --git a/modules/migrations/github.go b/services/migrations/github.go similarity index 99% rename from modules/migrations/github.go rename to services/migrations/github.go index 50cffc467a..3043d7cf75 100644 --- a/modules/migrations/github.go +++ b/services/migrations/github.go @@ -17,7 +17,7 @@ import ( "time" "code.gitea.io/gitea/modules/log" - "code.gitea.io/gitea/modules/migrations/base" + base "code.gitea.io/gitea/modules/migration" "code.gitea.io/gitea/modules/proxy" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/structs" diff --git a/modules/migrations/github_test.go b/services/migrations/github_test.go similarity index 99% rename from modules/migrations/github_test.go rename to services/migrations/github_test.go index 4a53f20a76..c8249dfdb2 100644 --- a/modules/migrations/github_test.go +++ b/services/migrations/github_test.go @@ -11,7 +11,7 @@ import ( "testing" "time" - "code.gitea.io/gitea/modules/migrations/base" + base "code.gitea.io/gitea/modules/migration" "github.com/stretchr/testify/assert" ) diff --git a/modules/migrations/gitlab.go b/services/migrations/gitlab.go similarity index 99% rename from modules/migrations/gitlab.go rename to services/migrations/gitlab.go index 91ba073d18..e285519aa5 100644 --- a/modules/migrations/gitlab.go +++ b/services/migrations/gitlab.go @@ -17,7 +17,7 @@ import ( "time" "code.gitea.io/gitea/modules/log" - "code.gitea.io/gitea/modules/migrations/base" + base "code.gitea.io/gitea/modules/migration" "code.gitea.io/gitea/modules/proxy" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/structs" diff --git a/modules/migrations/gitlab_test.go b/services/migrations/gitlab_test.go similarity index 99% rename from modules/migrations/gitlab_test.go rename to services/migrations/gitlab_test.go index c3ee8118c5..f6dc7510cb 100644 --- a/modules/migrations/gitlab_test.go +++ b/services/migrations/gitlab_test.go @@ -12,7 +12,7 @@ import ( "testing" "time" - "code.gitea.io/gitea/modules/migrations/base" + base "code.gitea.io/gitea/modules/migration" "github.com/stretchr/testify/assert" ) diff --git a/modules/migrations/gogs.go b/services/migrations/gogs.go similarity index 99% rename from modules/migrations/gogs.go rename to services/migrations/gogs.go index 06c944278b..9473bf8b48 100644 --- a/modules/migrations/gogs.go +++ b/services/migrations/gogs.go @@ -14,7 +14,7 @@ import ( "time" "code.gitea.io/gitea/modules/log" - "code.gitea.io/gitea/modules/migrations/base" + base "code.gitea.io/gitea/modules/migration" "code.gitea.io/gitea/modules/proxy" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/structs" diff --git a/modules/migrations/gogs_test.go b/services/migrations/gogs_test.go similarity index 98% rename from modules/migrations/gogs_test.go rename to services/migrations/gogs_test.go index 8816fab44f..57eda59b92 100644 --- a/modules/migrations/gogs_test.go +++ b/services/migrations/gogs_test.go @@ -11,7 +11,7 @@ import ( "testing" "time" - "code.gitea.io/gitea/modules/migrations/base" + base "code.gitea.io/gitea/modules/migration" "github.com/stretchr/testify/assert" ) diff --git a/modules/migrations/main_test.go b/services/migrations/main_test.go similarity index 99% rename from modules/migrations/main_test.go rename to services/migrations/main_test.go index e9108c3c93..660f6dd845 100644 --- a/modules/migrations/main_test.go +++ b/services/migrations/main_test.go @@ -11,7 +11,7 @@ import ( "time" "code.gitea.io/gitea/models/unittest" - "code.gitea.io/gitea/modules/migrations/base" + base "code.gitea.io/gitea/modules/migration" "github.com/stretchr/testify/assert" ) diff --git a/modules/migrations/migrate.go b/services/migrations/migrate.go similarity index 99% rename from modules/migrations/migrate.go rename to services/migrations/migrate.go index dbe69259f4..21be2d3b0d 100644 --- a/modules/migrations/migrate.go +++ b/services/migrations/migrate.go @@ -16,7 +16,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/matchlist" - "code.gitea.io/gitea/modules/migrations/base" + base "code.gitea.io/gitea/modules/migration" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/util" ) diff --git a/modules/migrations/migrate_test.go b/services/migrations/migrate_test.go similarity index 100% rename from modules/migrations/migrate_test.go rename to services/migrations/migrate_test.go diff --git a/modules/migrations/onedev.go b/services/migrations/onedev.go similarity index 99% rename from modules/migrations/onedev.go rename to services/migrations/onedev.go index e60265895f..1159026892 100644 --- a/modules/migrations/onedev.go +++ b/services/migrations/onedev.go @@ -15,7 +15,7 @@ import ( "code.gitea.io/gitea/modules/json" "code.gitea.io/gitea/modules/log" - "code.gitea.io/gitea/modules/migrations/base" + base "code.gitea.io/gitea/modules/migration" "code.gitea.io/gitea/modules/structs" ) diff --git a/modules/migrations/onedev_test.go b/services/migrations/onedev_test.go similarity index 98% rename from modules/migrations/onedev_test.go rename to services/migrations/onedev_test.go index 5dabf66bdc..59b7cae5fe 100644 --- a/modules/migrations/onedev_test.go +++ b/services/migrations/onedev_test.go @@ -12,7 +12,7 @@ import ( "testing" "time" - "code.gitea.io/gitea/modules/migrations/base" + base "code.gitea.io/gitea/modules/migration" "github.com/stretchr/testify/assert" ) diff --git a/modules/migrations/restore.go b/services/migrations/restore.go similarity index 99% rename from modules/migrations/restore.go rename to services/migrations/restore.go index 5fddf7b505..87e5316ef6 100644 --- a/modules/migrations/restore.go +++ b/services/migrations/restore.go @@ -11,7 +11,7 @@ import ( "path/filepath" "strconv" - "code.gitea.io/gitea/modules/migrations/base" + base "code.gitea.io/gitea/modules/migration" "gopkg.in/yaml.v2" ) diff --git a/modules/migrations/update.go b/services/migrations/update.go similarity index 100% rename from modules/migrations/update.go rename to services/migrations/update.go