feat: update gitea vendor
runner nix smoke / nix label and flake smoke (push) Failing after 1m28s

This commit is contained in:
2026-09-26 21:18:24 +00:00
parent c439c1b948
commit d9b2a4e787
3538 changed files with 116131 additions and 44340 deletions
@@ -6,39 +6,34 @@ package migrations
import (
"net/url"
"os"
"path/filepath"
"runtime"
"testing"
"time"
base "code.gitea.io/gitea/modules/migration"
"gitea.dev/models/unittest"
base "gitea.dev/modules/migration"
"github.com/stretchr/testify/assert"
)
func TestCodebaseDownloadRepo(t *testing.T) {
// Skip tests if Codebase token is not found
cloneUser := os.Getenv("CODEBASE_CLONE_USER")
clonePassword := os.Getenv("CODEBASE_CLONE_PASSWORD")
apiUser := os.Getenv("CODEBASE_API_USER")
apiPassword := os.Getenv("CODEBASE_API_TOKEN")
if apiUser == "" || apiPassword == "" {
t.Skip("skipped test because a CODEBASE_ variable was not in the environment")
}
liveMode := apiUser != "" && apiPassword != ""
_, callerFile, _, _ := runtime.Caller(0)
fixtureDir := filepath.Join(filepath.Dir(callerFile), "_mock_data/TestCodebaseDownloadRepo")
mockServer := unittest.NewMockWebServer(t, "https://api3.codebasehq.com", fixtureDir, liveMode)
cloneAddr := "https://gitea-test.codebasehq.com/gitea-test/test.git"
u, _ := url.Parse(cloneAddr)
if cloneUser != "" {
u.User = url.UserPassword(cloneUser, clonePassword)
}
projectURL, _ := url.Parse(cloneAddr)
projectURL.User = nil
ctx := t.Context()
factory := &CodebaseDownloaderFactory{}
downloader, err := factory.New(ctx, base.MigrateOptions{
CloneAddr: u.String(),
AuthUsername: apiUser,
AuthPassword: apiPassword,
})
if err != nil {
t.Fatalf("Error creating Codebase downloader: %v", err)
}
downloader := NewCodebaseDownloader(ctx, projectURL, "gitea-test", "test", apiUser, apiPassword)
downloader.baseURL, _ = url.Parse(mockServer.URL)
repo, err := downloader.GetRepoInfo(ctx)
assert.NoError(t, err)
assertRepositoryEqual(t, &base.Repository{
@@ -144,6 +139,6 @@ func TestCodebaseDownloadRepo(t *testing.T) {
}, prs)
rvs, err := downloader.GetReviews(ctx, prs[0])
assert.NoError(t, err)
assert.Error(t, err)
assert.Empty(t, rvs)
}