Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ XGO_VERSION := go-1.25.x
AIR_PACKAGE ?= github.com/air-verse/air@v1
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/v3/cmd/editorconfig-checker@v3
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.9.2
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.10.1
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.11.2
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.15
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/misspell@v0.8.0
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.33.1
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module code.gitea.io/gitea

go 1.26.0
go 1.26.1

// rfc5280 said: "The serial number is an integer assigned by the CA to each certificate."
// But some CAs use negative serial number, just relax the check. related:
Expand Down
7 changes: 4 additions & 3 deletions tests/integration/api_packages_conan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,15 +346,16 @@ func TestPackageConan(t *testing.T) {
pb, err := packages.GetBlobByID(t.Context(), pf.BlobID)
assert.NoError(t, err)

if pf.Name == conanfileName {
switch pf.Name {
case conanfileName:
assert.True(t, pf.IsLead)

assert.Equal(t, int64(len(buildConanfileContent(name, version1))), pb.Size)
} else if pf.Name == conaninfoName {
case conaninfoName:
assert.False(t, pf.IsLead)

assert.Equal(t, int64(len(contentConaninfo)), pb.Size)
} else {
default:
assert.FailNow(t, "unknown file", "unknown file: %s", pf.Name)
}
}
Expand Down
7 changes: 4 additions & 3 deletions tests/integration/api_packages_generic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,12 @@ func TestPackageGeneric(t *testing.T) {
t.Run("ServeDirect", func(t *testing.T) {
defer tests.PrintCurrentTest(t)()

if setting.Packages.Storage.Type == setting.MinioStorageType {
switch setting.Packages.Storage.Type {
case setting.MinioStorageType:
defer test.MockVariableValue(&setting.Packages.Storage.MinioConfig.ServeDirect, true)()
} else if setting.Packages.Storage.Type == setting.AzureBlobStorageType {
case setting.AzureBlobStorageType:
defer test.MockVariableValue(&setting.Packages.Storage.AzureBlobConfig.ServeDirect, true)()
} else {
default:
t.Skip("Test skipped for non-Minio-storage and non-AzureBlob-storage.")
}

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/api_releases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ func TestAPIUploadAssetRelease(t *testing.T) {
defer tests.PrintCurrentTest(t)()
const filename = "image.png"

performUpload := func(t *testing.T, uploadURL string, buf []byte, expectedStatus int) *httptest.ResponseRecorder {
performUpload := func(t *testing.T, uploadURL string, _ []byte, _ int) *httptest.ResponseRecorder {
body := &bytes.Buffer{}
writer := multipart.NewWriter(body)
part, err := writer.CreateFormFile("attachment", filename)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/api_repo_get_contents_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func TestAPIGetContents(t *testing.T) {
})
}

func testAPIGetContents(t *testing.T, u *url.URL) {
func testAPIGetContents(t *testing.T, _ *url.URL) {
/*** SETUP ***/
user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) // owner of the repo1 & repo16
org3 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 3}) // owner of the repo3, is an org
Expand Down
7 changes: 4 additions & 3 deletions tests/integration/api_token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,11 +502,12 @@ func runTestCase(t *testing.T, testCase *requiredScopeTestCase, user *user_model
}
unauthorizedLevel := auth_model.Write
if categoryIsRequired {
if minRequiredLevel == auth_model.Read {
switch minRequiredLevel {
case auth_model.Read:
unauthorizedLevel = auth_model.NoAccess
} else if minRequiredLevel == auth_model.Write {
case auth_model.Write:
unauthorizedLevel = auth_model.Read
} else {
default:
assert.FailNow(t, "Invalid test case", "Unknown access token scope level: %v", minRequiredLevel)
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/pull_comment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func testPullCommentRebase(t *testing.T, u *url.URL, session *TestSession) {
assert.True(t, lastComment.IsForcePush)
}

func testPullCommentRetarget(t *testing.T, u *url.URL, session *TestSession) {
func testPullCommentRetarget(t *testing.T, _ *url.URL, session *TestSession) {
testPRTitle := "Test PR for retarget comment"
// keep a non-conflict branch
testCreateBranch(t, session, "user2", "repo1", "branch/test-branch/retarget", "test-branch/retarget-no-conflict", http.StatusSeeOther)
Expand Down
5 changes: 3 additions & 2 deletions tests/integration/repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ func testViewRepoWithCache(t *testing.T) {
tds := s.Find(".repo-file-cell")
var f file
tds.Each(func(i int, s *goquery.Selection) {
if i == 0 {
switch i {
case 0:
f.fileName = strings.TrimSpace(s.Text())
} else if i == 1 {
case 1:
a := s.Find("a")
f.commitMsg = strings.TrimSpace(a.Text())
l, _ := a.Attr("href")
Expand Down