mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-10-01 07:06:01 +00:00
Fix migration failing when importing either issues or PRs but not the other (#8892)
Related to https://codeberg.org/Codeberg/Community/issues/1944 * Allowed the githubdownloaderv3 to know whether issues and, or PRs are requested to migrate * Used this information to decide to filter for "/pulls/" or "/issues" * Or not to filter at all if issues == true && prs == true * Added isolated test for the downloader and for the uploader * Created a new test_repo in github.com/forgejo and set it up properly together with @Gusted * Updated github_downloader_test with the new URLs and test data from the repo * Recorded the API calls for local testing * Added a minimal gitbucket test (which uses the github downloader under the hood) Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8892 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: patdyn <patdyn@noreply.codeberg.org> Co-committed-by: patdyn <patdyn@noreply.codeberg.org>
This commit is contained in:
parent
ed3b70cbb9
commit
9a423c0e67
70 changed files with 966 additions and 980 deletions
24
services/migrations/gitbucket_test.go
Normal file
24
services/migrations/gitbucket_test.go
Normal file
|
@ -0,0 +1,24 @@
|
|||
// Copyright 2025 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"forgejo.org/models/unittest"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestGitbucketDownloaderCreation(t *testing.T) {
|
||||
token := os.Getenv("GITHUB_READ_TOKEN")
|
||||
fixturePath := "./testdata/github/full_download"
|
||||
server := unittest.NewMockWebServer(t, "https://api.github.com", fixturePath, false)
|
||||
defer server.Close()
|
||||
|
||||
downloader := NewGitBucketDownloader(t.Context(), server.URL, "", "", token, "forgejo", "test_repo")
|
||||
err := downloader.RefreshRate()
|
||||
require.NoError(t, err)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue