From f6b933d36c05c9d6cc294f08b5262cf56d620183 Mon Sep 17 00:00:00 2001 From: "Kazushi (Jam) Marukawa" Date: Tue, 9 Apr 2024 23:18:58 +0900 Subject: [PATCH] Change the default maxPerPage for gitbucket Change to use an internal perPage of gitbucket as maxPerPage numer. Description is available on https://github.com/go-gitea/gitea/issues/30316. --- services/migrations/gitbucket.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/migrations/gitbucket.go b/services/migrations/gitbucket.go index 5f11555839b5c..4fe9e30a39c90 100644 --- a/services/migrations/gitbucket.go +++ b/services/migrations/gitbucket.go @@ -72,6 +72,11 @@ func (g *GitBucketDownloader) LogString() string { // NewGitBucketDownloader creates a GitBucket downloader func NewGitBucketDownloader(ctx context.Context, baseURL, userName, password, token, repoOwner, repoName string) *GitBucketDownloader { githubDownloader := NewGithubDownloaderV3(ctx, baseURL, userName, password, token, repoOwner, repoName) + // Gitbucket 4.40 uses different internal hard-coded perPage values. + // Issues, PRs, and other major parts use 25. Release page uses 10. + // Some API doesn't support paging yet. Sounds difficult, but using + // minimum number among them worked out very well. + githubDownloader.maxPerPage = 10 githubDownloader.SkipReactions = true githubDownloader.SkipReviews = true return &GitBucketDownloader{