gitea/services/migrations
Lunny Xiao b6379d2f16
Change the default maxPerPage for gitbucket (#30392) (#30471)
Backport #30392 

This patch improves the migration from gitbucket to gitea.

The gitbucket uses it's own internal perPage value (= 25) for paging and
ignore per_page arguments in the requested URL. This cause gitea to
migrate only 25 issues and 25 PRs from gitbucket repository. This may
not happens on old gitbucket. But recent gitbucket 4.40 or 4.38.4 has
this problem.

This patch change to use this internally hardcoded perPage of gitbucket
as gitea's maxPerPage numer when migrating from gitbucket. There are
several perPage values in gitbucket like 25 for Isseus/PRs and 10 for
Releases. Some of those API doesn't support paging yet. It sounds
difficult to implement, but using the minimum number among them worked
out very well. So, I use 10 in this patch.

Brief descriptions of problems and this patch are also available in
https://github.com/go-gitea/gitea/issues/30316.

In addition, I'm not sure what kind of test cases are possible to write
here. It's a test for migration, so it requires testing gitbucket server
and gitea server, I guess. Please let me know if it is possible to write
such test cases here. Thanks!

Co-authored-by: Kazushi (Jam) Marukawa <jam@pobox.com>
2024-04-14 12:42:50 +00:00
..
codebase_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
codebase.go Replace interface{} with any (#25686) 2023-07-04 18:36:08 +00:00
common.go Replace interface{} with any (#25686) 2023-07-04 18:36:08 +00:00
dump.go Next round of db.DefaultContext refactor (#27089) 2023-09-16 14:39:12 +00:00
error.go Update github.com/google/go-github to v53 (#25157) 2023-06-09 19:42:51 +00:00
git.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
gitbucket.go Change the default maxPerPage for gitbucket (#30392) (#30471) 2024-04-14 12:42:50 +00:00
gitea_downloader_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
gitea_downloader.go Fix DownloadFunc when migrating releases (#27887) (#27890) 2023-11-03 08:29:30 +00:00
gitea_uploader_test.go Next round of db.DefaultContext refactor (#27089) 2023-09-16 14:39:12 +00:00
gitea_uploader.go Only migrate the first 255 chars of a Github issue title (#28902) (#28912) 2024-01-24 19:56:54 +08:00
github_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
github.go Fix panic when migrating a repo from GitHub with issues (#25246) 2023-06-14 14:12:39 +08:00
gitlab_test.go Use known issue IID to generate new PR index number when migrating from GitLab (#28616) (#28618) 2023-12-27 09:59:29 +08:00
gitlab.go Use known issue IID to generate new PR index number when migrating from GitLab (#28616) (#28618) 2023-12-27 09:59:29 +08:00
gogs_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
gogs.go Rewrite logger system (#24726) 2023-05-21 22:35:11 +00:00
http_client.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
main_test.go Scoped labels (#22585) 2023-02-18 21:17:39 +02:00
migrate_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
migrate.go Fix duplicate migrated milestones (#30102) (#30105) 2024-03-26 20:58:56 +08:00
onedev_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
onedev.go Replace interface{} with any (#25686) 2023-07-04 18:36:08 +00:00
restore.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
update.go Another round of db.DefaultContext refactor (#27103) (#27262) 2023-09-25 19:24:35 +02:00