Skip to content

Commit 4666bc1

Browse files
authored
Merge branch 'main' into lunny/milestone_order_due_date
2 parents d91604e + 0c31499 commit 4666bc1

File tree

101 files changed

+2080
-2038
lines changed

Some content is hidden

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

101 files changed

+2080
-2038
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ cpu.out
7474
/tests/*.ini
7575
/tests/**/*.git/**/*.sample
7676
/node_modules
77-
/tools/node_modules
7877
/.venv
7978
/yarn.lock
8079
/yarn-error.log
8180
/npm-debug.log*
81+
/.pnpm-store
8282
/public/assets/js
8383
/public/assets/css
8484
/public/assets/fonts

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ RUN apk --no-cache add \
1818
&& npm install -g pnpm@10 \
1919
&& rm -rf /var/cache/apk/*
2020

21+
# workaround for node >= 22.18.0 on alpine 3.22. Remove when upgrading to alpine 3.23
22+
COPY --from=docker.io/node:22-alpine3.22 /usr/local/bin/node /usr/local/bin/node
23+
2124
# Setup repo
2225
COPY . ${GOPATH}/src/code.gitea.io/gitea
2326
WORKDIR ${GOPATH}/src/code.gitea.io/gitea

Dockerfile.rootless

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ RUN apk --no-cache add \
1818
&& npm install -g pnpm@10 \
1919
&& rm -rf /var/cache/apk/*
2020

21+
# workaround for node >= 22.18.0 on alpine 3.22. Remove when upgrading to alpine 3.23
22+
COPY --from=docker.io/node:22-alpine3.22 /usr/local/bin/node /usr/local/bin/node
23+
2124
# Setup repo
2225
COPY . ${GOPATH}/src/code.gitea.io/gitea
2326
WORKDIR ${GOPATH}/src/code.gitea.io/gitea

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,4 @@ hiifong <[email protected]> (@hiifong)
6363
metiftikci <[email protected]> (@metiftikci)
6464
Christopher Homberger <[email protected]> (@ChristopherHX)
6565
Tobias Balle-Petersen <[email protected]> (@tobiasbp)
66+
TheFox <[email protected]> (@TheFox0x7)

Makefile

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ GOFUMPT_PACKAGE ?= mvdan.cc/[email protected]
3131
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/v2/cmd/[email protected]
3232
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/[email protected]
3333
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/[email protected]
34-
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.32.3
34+
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@717e3cb29becaaf00e56953556c6d80f8a01b286
3535
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
3636
GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1
3737
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@v1
@@ -127,7 +127,7 @@ GO_TEST_PACKAGES ?= $(filter-out $(shell $(GO) list code.gitea.io/gitea/models/m
127127
MIGRATE_TEST_PACKAGES ?= $(shell $(GO) list code.gitea.io/gitea/models/migrations/...)
128128

129129
WEBPACK_SOURCES := $(shell find web_src/js web_src/css -type f)
130-
WEBPACK_CONFIGS := webpack.config.js tailwind.config.js
130+
WEBPACK_CONFIGS := webpack.config.ts tailwind.config.ts
131131
WEBPACK_DEST := public/assets/js/index.js public/assets/css/index.css
132132
WEBPACK_DEST_ENTRIES := public/assets/js public/assets/css public/assets/fonts
133133

@@ -153,9 +153,9 @@ TAR_EXCLUDES := .git data indexers queues log node_modules $(EXECUTABLE) $(DIST)
153153
GO_DIRS := build cmd models modules routers services tests
154154
WEB_DIRS := web_src/js web_src/css
155155

156-
ESLINT_FILES := web_src/js tools *.js *.ts *.cjs tests/e2e
156+
ESLINT_FILES := web_src/js tools *.ts *.cjs tests/e2e
157157
STYLELINT_FILES := web_src/css web_src/js/components/*.vue
158-
SPELLCHECK_FILES := $(GO_DIRS) $(WEB_DIRS) templates options/locale/locale_en-US.ini .github $(filter-out CHANGELOG.md, $(wildcard *.go *.js *.md *.yml *.yaml *.toml)) $(filter-out tools/misspellings.csv, $(wildcard tools/*))
158+
SPELLCHECK_FILES := $(GO_DIRS) $(WEB_DIRS) templates options/locale/locale_en-US.ini .github $(filter-out CHANGELOG.md, $(wildcard *.go *.md *.yml *.yaml *.toml)) $(filter-out tools/misspellings.csv, $(wildcard tools/*))
159159
EDITORCONFIG_FILES := templates .github/workflows options/locale/locale_en-US.ini
160160

161161
GO_SOURCES := $(wildcard *.go)
@@ -230,7 +230,7 @@ node-check:
230230

231231
.PHONY: clean-all
232232
clean-all: clean ## delete backend, frontend and integration files
233-
rm -rf $(WEBPACK_DEST_ENTRIES) node_modules tools/node_modules
233+
rm -rf $(WEBPACK_DEST_ENTRIES) node_modules
234234

235235
.PHONY: clean
236236
clean: ## delete backend and integration files
@@ -407,7 +407,7 @@ lint-actions: ## lint action workflow files
407407

408408
.PHONY: lint-templates
409409
lint-templates: .venv node_modules ## lint template files
410-
@node tools/lint-templates-svg.js
410+
@node tools/lint-templates-svg.ts
411411
@uv run --frozen djlint $(shell find templates -type f -iname '*.tmpl')
412412

413413
.PHONY: lint-yaml
@@ -421,7 +421,7 @@ watch: ## watch everything and continuously rebuild
421421
.PHONY: watch-frontend
422422
watch-frontend: node-check node_modules ## watch frontend files and continuously rebuild
423423
@rm -rf $(WEBPACK_DEST_ENTRIES)
424-
NODE_ENV=development pnpm exec webpack --watch --progress
424+
NODE_ENV=development pnpm exec webpack --watch --progress --disable-interpret
425425

426426
.PHONY: watch-backend
427427
watch-backend: go-check ## watch backend files and continuously rebuild
@@ -847,10 +847,6 @@ node_modules: pnpm-lock.yaml
847847
pnpm install --frozen-lockfile
848848
@touch node_modules
849849

850-
tools/node_modules: tools/package.json
851-
cd tools && pnpm install
852-
@touch tools/node_modules
853-
854850
.venv: uv.lock
855851
uv sync
856852
@touch .venv
@@ -881,13 +877,13 @@ $(WEBPACK_DEST): $(WEBPACK_SOURCES) $(WEBPACK_CONFIGS) pnpm-lock.yaml
881877
@$(MAKE) -s node-check node_modules
882878
@rm -rf $(WEBPACK_DEST_ENTRIES)
883879
@echo "Running webpack..."
884-
@BROWSERSLIST_IGNORE_OLD_DATA=true pnpm exec webpack
880+
@BROWSERSLIST_IGNORE_OLD_DATA=true pnpm exec webpack --disable-interpret
885881
@touch $(WEBPACK_DEST)
886882

887883
.PHONY: svg
888884
svg: node-check | node_modules ## build svg files
889885
rm -rf $(SVG_DEST_DIR)
890-
node tools/generate-svg.js
886+
node tools/generate-svg.ts
891887

892888
.PHONY: svg-check
893889
svg-check: svg
@@ -925,8 +921,8 @@ generate-gitignore: ## update gitignore files
925921
$(GO) run build/generate-gitignores.go
926922

927923
.PHONY: generate-images
928-
generate-images: | node_modules tools/node_modules ## generate images (requires cairo development packages)
929-
cd tools && node generate-images.js $(TAGS)
924+
generate-images: | node_modules ## generate images
925+
cd tools && node generate-images.ts $(TAGS)
930926

931927
.PHONY: generate-manpage
932928
generate-manpage: ## generate manpage

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module code.gitea.io/gitea
22

3-
go 1.24.6
3+
go 1.25.1
44

55
// rfc5280 said: "The serial number is an integer assigned by the CA to each certificate."
66
// But some CAs use negative serial number, just relax the check. related:

modules/globallock/locker_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,13 @@ func testLocker(t *testing.T, locker Locker) {
105105
require.NoError(t, err)
106106

107107
wg := &sync.WaitGroup{}
108-
wg.Add(1)
109-
go func() {
110-
defer wg.Done()
108+
wg.Go(func() {
111109
started := time.Now()
112110
release, err := locker.Lock(t.Context(), "test") // should be blocked for seconds
113111
defer release()
114112
assert.Greater(t, time.Since(started), time.Second)
115113
assert.NoError(t, err)
116-
}()
114+
})
117115

118116
time.Sleep(2 * time.Second)
119117
release()

modules/log/event_writer_conn_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,9 @@ func TestConnLogger(t *testing.T) {
6262
}
6363
expected := fmt.Sprintf("%s%s %s:%d:%s [%c] %s\n", prefix, dateString, event.Filename, event.Line, event.Caller, strings.ToUpper(event.Level.String())[0], event.MsgSimpleText)
6464
var wg sync.WaitGroup
65-
wg.Add(1)
66-
go func() {
67-
defer wg.Done()
65+
wg.Go(func() {
6866
listenReadAndClose(t, l, expected)
69-
}()
67+
})
7068
logger.SendLogEvent(&event)
7169
wg.Wait()
7270

modules/queue/workergroup.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,7 @@ func resetIdleTicker(t *time.Ticker, dur time.Duration) {
153153

154154
// doStartNewWorker starts a new worker for the queue, the worker reads from worker's channel and handles the items.
155155
func (q *WorkerPoolQueue[T]) doStartNewWorker(wp *workerGroup[T]) {
156-
wp.wg.Add(1)
157-
158-
go func() {
159-
defer wp.wg.Done()
160-
156+
wp.wg.Go(func() {
161157
log.Debug("Queue %q starts new worker", q.GetName())
162158
defer log.Debug("Queue %q stops idle worker", q.GetName())
163159

@@ -192,7 +188,7 @@ func (q *WorkerPoolQueue[T]) doStartNewWorker(wp *workerGroup[T]) {
192188
q.workerNumMu.Unlock()
193189
}
194190
}
195-
}()
191+
})
196192
}
197193

198194
// doFlush flushes the queue: it tries to read all items from the queue and handles them.

modules/structs/activity.go

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,32 @@ package structs
66
import "time"
77

88
type Activity struct {
9-
ID int64 `json:"id"`
9+
// The unique identifier of the activity
10+
ID int64 `json:"id"`
11+
// The ID of the user who receives/sees this activity
1012
UserID int64 `json:"user_id"` // Receiver user
1113
// the type of action
1214
//
1315
// enum: create_repo,rename_repo,star_repo,watch_repo,commit_repo,create_issue,create_pull_request,transfer_repo,push_tag,comment_issue,merge_pull_request,close_issue,reopen_issue,close_pull_request,reopen_pull_request,delete_tag,delete_branch,mirror_sync_push,mirror_sync_create,mirror_sync_delete,approve_pull_request,reject_pull_request,comment_pull,publish_release,pull_review_dismissed,pull_request_ready_for_review,auto_merge_pull_request
14-
OpType string `json:"op_type"`
15-
ActUserID int64 `json:"act_user_id"`
16-
ActUser *User `json:"act_user"`
17-
RepoID int64 `json:"repo_id"`
18-
Repo *Repository `json:"repo"`
19-
CommentID int64 `json:"comment_id"`
20-
Comment *Comment `json:"comment"`
21-
RefName string `json:"ref_name"`
22-
IsPrivate bool `json:"is_private"`
23-
Content string `json:"content"`
24-
Created time.Time `json:"created"`
16+
OpType string `json:"op_type"`
17+
// The ID of the user who performed the action
18+
ActUserID int64 `json:"act_user_id"`
19+
// The user who performed the action
20+
ActUser *User `json:"act_user"`
21+
// The ID of the repository associated with the activity
22+
RepoID int64 `json:"repo_id"`
23+
// The repository associated with the activity
24+
Repo *Repository `json:"repo"`
25+
// The ID of the comment associated with the activity (if applicable)
26+
CommentID int64 `json:"comment_id"`
27+
// The comment associated with the activity (if applicable)
28+
Comment *Comment `json:"comment"`
29+
// The name of the git reference (branch/tag) associated with the activity
30+
RefName string `json:"ref_name"`
31+
// Whether this activity is from a private repository
32+
IsPrivate bool `json:"is_private"`
33+
// Additional content or details about the activity
34+
Content string `json:"content"`
35+
// The date and time when the activity occurred
36+
Created time.Time `json:"created"`
2537
}

0 commit comments

Comments
 (0)