Skip to content

Commit 7bf8876

Browse files
committed
Merge branch 'main' into lunny/code_review_line_number
2 parents d6049cf + 0cbaa0b commit 7bf8876

File tree

421 files changed

+5253
-3642
lines changed

Some content is hidden

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

421 files changed

+5253
-3642
lines changed

.devcontainer/devcontainer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"name": "Gitea DevContainer",
33
"image": "mcr.microsoft.com/devcontainers/go:1.24-bookworm",
4+
"containerEnv": {
5+
// override "local" from packaged version
6+
"GOTOOLCHAIN": "auto"
7+
},
48
"features": {
59
// installs nodejs into container
610
"ghcr.io/devcontainers/features/node:1": {

.github/workflows/release-nightly.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,6 @@ jobs:
7575
- name: Get cleaned branch name
7676
id: clean_name
7777
run: |
78-
# if main then say nightly otherwise cleanup name
79-
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
80-
echo "branch=nightly" >> "$GITHUB_OUTPUT"
81-
exit 0
82-
fi
8378
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
8479
echo "branch=${REF_NAME}-nightly" >> "$GITHUB_OUTPUT"
8580
- name: Login to Docker Hub
@@ -122,11 +117,6 @@ jobs:
122117
- name: Get cleaned branch name
123118
id: clean_name
124119
run: |
125-
# if main then say nightly otherwise cleanup name
126-
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
127-
echo "branch=nightly" >> "$GITHUB_OUTPUT"
128-
exit 0
129-
fi
130120
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
131121
echo "branch=${REF_NAME}-nightly" >> "$GITHUB_OUTPUT"
132122
- name: Login to Docker Hub

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage
2-
FROM docker.io/library/golang:1.24-alpine3.22 AS build-env
2+
FROM docker.io/library/golang:1.25-alpine3.22 AS build-env
33

44
ARG GOPROXY
55
ENV GOPROXY=${GOPROXY:-direct}

Dockerfile.rootless

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage
2-
FROM docker.io/library/golang:1.24-alpine3.22 AS build-env
2+
FROM docker.io/library/golang:1.25-alpine3.22 AS build-env
33

44
ARG GOPROXY
55
ENV GOPROXY=${GOPROXY:-direct}

MAINTAINERS

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ a1012112796 <[email protected]> (@a1012112796)
3636
Karl Heinz Marbaise <[email protected]> (@khmarbaise)
3737
Norwin Roosen <[email protected]> (@noerw)
3838
Kyle Dumont <[email protected]> (@kdumontnu)
39-
Patrick Schratz <[email protected]> (@pat-s)
4039
Janis Estelmann <[email protected]> (@KN4CK3R)
41-
Steven Kriegler <[email protected]> (@justusbunsi)
4240
Jimmy Praet <[email protected]> (@jpraet)
4341
Leon Hofmeister <[email protected]> (@delvh)
4442
Wim <[email protected]> (@42wim)

Makefile

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ SHASUM ?= shasum -a 256
2323
HAS_GO := $(shell hash $(GO) > /dev/null 2>&1 && echo yes)
2424
COMMA := ,
2525

26-
XGO_VERSION := go-1.24.x
26+
XGO_VERSION := go-1.25.x
2727

2828
AIR_PACKAGE ?= github.com/air-verse/air@v1
2929
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/v3/cmd/editorconfig-checker@v3
3030
GOFUMPT_PACKAGE ?= mvdan.cc/[email protected]
31-
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1.6
31+
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.4.0
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]
@@ -48,6 +48,17 @@ ifeq ($(HAS_GO), yes)
4848
CGO_CFLAGS ?= $(shell $(GO) env CGO_CFLAGS) $(CGO_EXTRA_CFLAGS)
4949
endif
5050

51+
CGO_ENABLED ?= 0
52+
ifneq (,$(findstring sqlite,$(TAGS))$(findstring pam,$(TAGS)))
53+
CGO_ENABLED = 1
54+
endif
55+
56+
STATIC ?=
57+
EXTLDFLAGS ?=
58+
ifneq ($(STATIC),)
59+
EXTLDFLAGS = -extldflags "-static"
60+
endif
61+
5162
ifeq ($(GOOS),windows)
5263
IS_WINDOWS := yes
5364
else ifeq ($(patsubst Windows%,Windows,$(OS)),Windows)
@@ -746,7 +757,10 @@ security-check:
746757
go run $(GOVULNCHECK_PACKAGE) -show color ./...
747758

748759
$(EXECUTABLE): $(GO_SOURCES) $(TAGS_PREREQ)
749-
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
760+
ifneq ($(and $(STATIC),$(findstring pam,$(TAGS))),)
761+
$(error pam support set via TAGS doesn't support static builds)
762+
endif
763+
CGO_ENABLED="$(CGO_ENABLED)" CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(EXTLDFLAGS) $(LDFLAGS)' -o $@
750764

751765
.PHONY: release
752766
release: frontend generate release-windows release-linux release-darwin release-freebsd release-copy release-compress vendor release-sources release-check

cmd/admin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func runRepoSyncReleases(ctx context.Context, _ *cli.Command) error {
100100
return err
101101
}
102102

103-
if err := git.InitSimple(ctx); err != nil {
103+
if err := git.InitSimple(); err != nil {
104104
return err
105105
}
106106

cmd/admin_user_change_password_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ func TestChangePasswordCommand(t *testing.T) {
1818
ctx := t.Context()
1919

2020
defer func() {
21-
require.NoError(t, db.TruncateBeans(db.DefaultContext, &user_model.User{}))
21+
require.NoError(t, db.TruncateBeans(t.Context(), &user_model.User{}))
2222
}()
2323

2424
t.Run("change password successfully", func(t *testing.T) {
2525
// defer func() {
26-
// require.NoError(t, db.TruncateBeans(db.DefaultContext, &user_model.User{}))
26+
// require.NoError(t, db.TruncateBeans(t.Context(), &user_model.User{}))
2727
// }()
2828
// Prepare test user
2929
unittest.AssertNotExistsBean(t, &user_model.User{LowerName: "testuser"})

cmd/admin_user_create_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ import (
1919

2020
func TestAdminUserCreate(t *testing.T) {
2121
reset := func() {
22-
require.NoError(t, db.TruncateBeans(db.DefaultContext, &user_model.User{}))
23-
require.NoError(t, db.TruncateBeans(db.DefaultContext, &user_model.EmailAddress{}))
24-
require.NoError(t, db.TruncateBeans(db.DefaultContext, &auth_model.AccessToken{}))
22+
require.NoError(t, db.TruncateBeans(t.Context(), &user_model.User{}))
23+
require.NoError(t, db.TruncateBeans(t.Context(), &user_model.EmailAddress{}))
24+
require.NoError(t, db.TruncateBeans(t.Context(), &auth_model.AccessToken{}))
2525
}
2626

2727
t.Run("MustChangePassword", func(t *testing.T) {

cmd/admin_user_delete_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ import (
1919
func TestAdminUserDelete(t *testing.T) {
2020
ctx := t.Context()
2121
defer func() {
22-
require.NoError(t, db.TruncateBeans(db.DefaultContext, &user_model.User{}))
23-
require.NoError(t, db.TruncateBeans(db.DefaultContext, &user_model.EmailAddress{}))
24-
require.NoError(t, db.TruncateBeans(db.DefaultContext, &auth_model.AccessToken{}))
22+
require.NoError(t, db.TruncateBeans(t.Context(), &user_model.User{}))
23+
require.NoError(t, db.TruncateBeans(t.Context(), &user_model.EmailAddress{}))
24+
require.NoError(t, db.TruncateBeans(t.Context(), &auth_model.AccessToken{}))
2525
}()
2626

2727
setupTestUser := func(t *testing.T) {
@@ -104,8 +104,8 @@ func TestAdminUserDeleteFailure(t *testing.T) {
104104
require.Contains(t, err.Error(), tc.expectedErr)
105105
})
106106

107-
require.NoError(t, db.TruncateBeans(db.DefaultContext, &user_model.User{}))
108-
require.NoError(t, db.TruncateBeans(db.DefaultContext, &user_model.EmailAddress{}))
109-
require.NoError(t, db.TruncateBeans(db.DefaultContext, &auth_model.AccessToken{}))
107+
require.NoError(t, db.TruncateBeans(t.Context(), &user_model.User{}))
108+
require.NoError(t, db.TruncateBeans(t.Context(), &user_model.EmailAddress{}))
109+
require.NoError(t, db.TruncateBeans(t.Context(), &auth_model.AccessToken{}))
110110
}
111111
}

0 commit comments

Comments
 (0)