Skip to content

Commit a448016

Browse files
authored
Merge branch 'main' into update-maintainer
2 parents 9a49795 + 5e22e51 commit a448016

File tree

215 files changed

+1571
-1020
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

215 files changed

+1571
-1020
lines changed

.golangci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ linters:
1919
- revive
2020
- staticcheck
2121
- stylecheck
22+
- tenv
23+
- testifylint
2224
- typecheck
2325
- unconvert
2426
- unused
@@ -34,6 +36,10 @@ output:
3436
show-stats: true
3537

3638
linters-settings:
39+
testifylint:
40+
disable:
41+
- go-require
42+
- require-error
3743
stylecheck:
3844
checks: ["all", "-ST1005", "-ST1003"]
3945
nakedret:

Makefile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ XGO_VERSION := go-1.23.x
2828
AIR_PACKAGE ?= github.com/air-verse/air@v1
2929
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/[email protected]
3030
GOFUMPT_PACKAGE ?= mvdan.cc/[email protected]
31-
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.3
31+
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2
3232
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/[email protected]
3333
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/[email protected]
3434
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/[email protected]
@@ -377,12 +377,12 @@ lint-backend-fix: lint-go-fix lint-go-vet lint-editorconfig
377377
.PHONY: lint-js
378378
lint-js: node_modules
379379
npx eslint --color --max-warnings=0 --ext js,ts,vue $(ESLINT_FILES)
380-
# npx vue-tsc
380+
npx vue-tsc
381381

382382
.PHONY: lint-js-fix
383383
lint-js-fix: node_modules
384384
npx eslint --color --max-warnings=0 --ext js,ts,vue $(ESLINT_FILES) --fix
385-
# npx vue-tsc
385+
npx vue-tsc
386386

387387
.PHONY: lint-css
388388
lint-css: node_modules
@@ -451,10 +451,6 @@ lint-templates: .venv node_modules
451451
lint-yaml: .venv
452452
@poetry run yamllint .
453453

454-
.PHONY: tsc
455-
tsc:
456-
npx vue-tsc
457-
458454
.PHONY: watch
459455
watch:
460456
@bash tools/watch.sh

custom/conf/app.example.ini

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,9 +1040,13 @@ LEVEL = Info
10401040
;; Don't allow download source archive files from UI
10411041
;DISABLE_DOWNLOAD_SOURCE_ARCHIVES = false
10421042

1043-
;; Allow fork repositories without maximum number limit
1043+
;; Allow to fork repositories without maximum number limit
10441044
;ALLOW_FORK_WITHOUT_MAXIMUM_LIMIT = true
10451045

1046+
;; Allow to fork repositories into the same owner (user or organization)
1047+
;; This feature is experimental, not fully tested, and may be changed in the future
1048+
;ALLOW_FORK_INTO_SAME_OWNER = false
1049+
10461050
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
10471051
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
10481052
;[repository.editor]

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ require (
4848
github.com/ethantkoenig/rupture v1.0.1
4949
github.com/felixge/fgprof v0.9.5
5050
github.com/fsnotify/fsnotify v1.7.0
51-
github.com/gliderlabs/ssh v0.3.7
51+
github.com/gliderlabs/ssh v0.3.8
5252
github.com/go-ap/activitypub v0.0.0-20240910141749-b4b8c8aa484c
5353
github.com/go-ap/jsonld v0.0.0-20221030091449-f2a191312c73
5454
github.com/go-chi/chi/v5 v5.1.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv
293293
github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
294294
github.com/git-lfs/pktline v0.0.0-20230103162542-ca444d533ef1 h1:mtDjlmloH7ytdblogrMz1/8Hqua1y8B4ID+bh3rvod0=
295295
github.com/git-lfs/pktline v0.0.0-20230103162542-ca444d533ef1/go.mod h1:fenKRzpXDjNpsIBhuhUzvjCKlDjKam0boRAenTE0Q6A=
296-
github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE=
297-
github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8=
296+
github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c=
297+
github.com/gliderlabs/ssh v0.3.8/go.mod h1:xYoytBv1sV0aL3CavoDuJIQNURXkkfPA/wxQ1pL1fAU=
298298
github.com/glycerine/go-unsnap-stream v0.0.0-20181221182339-f9677308dec2/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE=
299299
github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24=
300300
github.com/go-ap/activitypub v0.0.0-20240910141749-b4b8c8aa484c h1:82lzmsy5Nr6JA6HcLRVxGfbdSoWfW45C6jnY3zFS7Ks=

models/actions/run_job.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func UpdateRunJob(ctx context.Context, job *ActionRunJob, cond builder.Cond, col
137137
if err != nil {
138138
return 0, err
139139
}
140-
run.Status = aggregateJobStatus(jobs)
140+
run.Status = AggregateJobStatus(jobs)
141141
if run.Started.IsZero() && run.Status.IsRunning() {
142142
run.Started = timeutil.TimeStampNow()
143143
}
@@ -152,7 +152,7 @@ func UpdateRunJob(ctx context.Context, job *ActionRunJob, cond builder.Cond, col
152152
return affected, nil
153153
}
154154

155-
func aggregateJobStatus(jobs []*ActionRunJob) Status {
155+
func AggregateJobStatus(jobs []*ActionRunJob) Status {
156156
allDone := true
157157
allWaiting := true
158158
hasFailure := false

models/actions/runner_token_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func TestGetLatestRunnerToken(t *testing.T) {
1717
token := unittest.AssertExistsAndLoadBean(t, &ActionRunnerToken{ID: 3})
1818
expectedToken, err := GetLatestRunnerToken(db.DefaultContext, 1, 0)
1919
assert.NoError(t, err)
20-
assert.EqualValues(t, token, expectedToken)
20+
assert.EqualValues(t, expectedToken, token)
2121
}
2222

2323
func TestNewRunnerToken(t *testing.T) {
@@ -26,7 +26,7 @@ func TestNewRunnerToken(t *testing.T) {
2626
assert.NoError(t, err)
2727
expectedToken, err := GetLatestRunnerToken(db.DefaultContext, 1, 0)
2828
assert.NoError(t, err)
29-
assert.EqualValues(t, token, expectedToken)
29+
assert.EqualValues(t, expectedToken, token)
3030
}
3131

3232
func TestUpdateRunnerToken(t *testing.T) {
@@ -36,5 +36,5 @@ func TestUpdateRunnerToken(t *testing.T) {
3636
assert.NoError(t, UpdateRunnerToken(db.DefaultContext, token))
3737
expectedToken, err := GetLatestRunnerToken(db.DefaultContext, 1, 0)
3838
assert.NoError(t, err)
39-
assert.EqualValues(t, token, expectedToken)
39+
assert.EqualValues(t, expectedToken, token)
4040
}

models/activities/user_heatmap_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
package activities_test
55

66
import (
7-
"fmt"
87
"testing"
98
"time"
109

@@ -91,11 +90,11 @@ func TestGetUserHeatmapDataByUser(t *testing.T) {
9190
assert.NoError(t, err)
9291
assert.Len(t, actions, contributions, "invalid action count: did the test data became too old?")
9392
assert.Equal(t, count, int64(contributions))
94-
assert.Equal(t, tc.CountResult, contributions, fmt.Sprintf("testcase '%s'", tc.desc))
93+
assert.Equal(t, tc.CountResult, contributions, "testcase '%s'", tc.desc)
9594

9695
// Test JSON rendering
9796
jsonData, err := json.Marshal(heatmap)
9897
assert.NoError(t, err)
99-
assert.Equal(t, tc.JSONResult, string(jsonData))
98+
assert.JSONEq(t, tc.JSONResult, string(jsonData))
10099
}
101100
}

models/auth/oauth2_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func TestOAuth2Application_GenerateClientSecret(t *testing.T) {
1818
app := unittest.AssertExistsAndLoadBean(t, &auth_model.OAuth2Application{ID: 1})
1919
secret, err := app.GenerateClientSecret(db.DefaultContext)
2020
assert.NoError(t, err)
21-
assert.True(t, len(secret) > 0)
21+
assert.NotEmpty(t, secret)
2222
unittest.AssertExistsAndLoadBean(t, &auth_model.OAuth2Application{ID: 1, ClientSecret: app.ClientSecret})
2323
}
2424

@@ -165,7 +165,7 @@ func TestOAuth2Grant_GenerateNewAuthorizationCode(t *testing.T) {
165165
code, err := grant.GenerateNewAuthorizationCode(db.DefaultContext, "https://example2.com/callback", "CjvyTLSdR47G5zYenDA-eDWW4lRrO8yvjcWwbD_deOg", "S256")
166166
assert.NoError(t, err)
167167
assert.NotNil(t, code)
168-
assert.True(t, len(code.Code) > 32) // secret length > 32
168+
assert.Greater(t, len(code.Code), 32) // secret length > 32
169169
}
170170

171171
func TestOAuth2Grant_TableName(t *testing.T) {

models/db/iterate_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ func TestIterate(t *testing.T) {
3838
if !has {
3939
return db.ErrNotExist{Resource: "repo_unit", ID: repoUnit.ID}
4040
}
41-
assert.EqualValues(t, repoUnit.RepoID, repoUnit.RepoID)
42-
assert.EqualValues(t, repoUnit.CreatedUnix, repoUnit.CreatedUnix)
4341
return nil
4442
})
4543
assert.NoError(t, err)

0 commit comments

Comments
 (0)