Skip to content

Commit 3199a48

Browse files
committed
Merge branch 'main' into lunny/fix_comment_close_reopen
2 parents 6d50074 + c5332fd commit 3199a48

File tree

282 files changed

+4495
-3223
lines changed

Some content is hidden

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

282 files changed

+4495
-3223
lines changed

.eslintrc.cjs

Lines changed: 0 additions & 1005 deletions
This file was deleted.

.github/workflows/pull-db-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ jobs:
7272
go-version-file: go.mod
7373
check-latest: true
7474
- run: make deps-backend
75-
- run: make backend
75+
- run: GOEXPERIMENT='' make backend
7676
env:
7777
TAGS: bindata gogit sqlite sqlite_unlock_notify
7878
- name: run migration tests
7979
run: make test-sqlite-migration
8080
- name: run tests
81-
run: make test-sqlite
81+
run: GOEXPERIMENT='' make test-sqlite
8282
timeout-minutes: 50
8383
env:
8484
TAGS: bindata gogit sqlite sqlite_unlock_notify
@@ -142,7 +142,7 @@ jobs:
142142
RACE_ENABLED: true
143143
GITHUB_READ_TOKEN: ${{ secrets.GITHUB_READ_TOKEN }}
144144
- name: unit-tests-gogit
145-
run: make unit-test-coverage test-check
145+
run: GOEXPERIMENT='' make unit-test-coverage test-check
146146
env:
147147
TAGS: bindata gogit
148148
RACE_ENABLED: true

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ DIST := dist
1818
DIST_DIRS := $(DIST)/binaries $(DIST)/release
1919
IMPORT := code.gitea.io/gitea
2020

21+
# By default use go's 1.25 experimental json v2 library when building
22+
# TODO: remove when no longer experimental
23+
export GOEXPERIMENT ?= jsonv2
24+
2125
GO ?= go
2226
SHASUM ?= shasum -a 256
2327
HAS_GO := $(shell hash $(GO) > /dev/null 2>&1 && echo yes)
@@ -162,7 +166,7 @@ TAR_EXCLUDES := .git data indexers queues log node_modules $(EXECUTABLE) $(DIST)
162166
GO_DIRS := build cmd models modules routers services tests
163167
WEB_DIRS := web_src/js web_src/css
164168

165-
ESLINT_FILES := web_src/js tools *.ts *.cjs tests/e2e
169+
ESLINT_FILES := web_src/js tools *.ts tests/e2e
166170
STYLELINT_FILES := web_src/css web_src/js/components/*.vue
167171
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/*))
168172
EDITORCONFIG_FILES := templates .github/workflows options/locale/locale_en-US.ini
@@ -346,12 +350,12 @@ lint-backend-fix: lint-go-fix lint-go-gitea-vet lint-editorconfig ## lint backen
346350

347351
.PHONY: lint-js
348352
lint-js: node_modules ## lint js files
349-
$(NODE_VARS) pnpm exec eslint --color --max-warnings=0 --ext js,ts,vue $(ESLINT_FILES)
353+
$(NODE_VARS) pnpm exec eslint --color --max-warnings=0 --flag unstable_native_nodejs_ts_config $(ESLINT_FILES)
350354
$(NODE_VARS) pnpm exec vue-tsc
351355

352356
.PHONY: lint-js-fix
353357
lint-js-fix: node_modules ## lint js files and fix issues
354-
$(NODE_VARS) pnpm exec eslint --color --max-warnings=0 --ext js,ts,vue $(ESLINT_FILES) --fix
358+
$(NODE_VARS) pnpm exec eslint --color --max-warnings=0 --flag unstable_native_nodejs_ts_config $(ESLINT_FILES) --fix
355359
$(NODE_VARS) pnpm exec vue-tsc
356360

357361
.PHONY: lint-css
@@ -766,7 +770,7 @@ generate-go: $(TAGS_PREREQ)
766770

767771
.PHONY: security-check
768772
security-check:
769-
go run $(GOVULNCHECK_PACKAGE) -show color ./...
773+
GOEXPERIMENT= go run $(GOVULNCHECK_PACKAGE) -show color ./...
770774

771775
$(EXECUTABLE): $(GO_SOURCES) $(TAGS_PREREQ)
772776
ifneq ($(and $(STATIC),$(findstring pam,$(TAGS))),)

assets/go-licenses.json

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/dump.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ func runDump(ctx context.Context, cmd *cli.Command) error {
265265
excludes = append(excludes, setting.LFS.Storage.Path)
266266
excludes = append(excludes, setting.Attachment.Storage.Path)
267267
excludes = append(excludes, setting.Packages.Storage.Path)
268+
excludes = append(excludes, setting.RepoArchive.Storage.Path)
268269
excludes = append(excludes, setting.Log.RootPath)
269270
if err := dumper.AddRecursiveExclude("data", setting.AppDataPath, excludes); err != nil {
270271
fatal("Failed to include data directory: %v", err)

cmd/embedded.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ import (
1212
"strings"
1313

1414
"code.gitea.io/gitea/modules/assetfs"
15+
"code.gitea.io/gitea/modules/glob"
1516
"code.gitea.io/gitea/modules/log"
1617
"code.gitea.io/gitea/modules/options"
1718
"code.gitea.io/gitea/modules/public"
1819
"code.gitea.io/gitea/modules/setting"
1920
"code.gitea.io/gitea/modules/templates"
2021
"code.gitea.io/gitea/modules/util"
2122

22-
"github.com/gobwas/glob"
2323
"github.com/urfave/cli/v3"
2424
)
2525

cmd/hook.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"time"
1616

1717
"code.gitea.io/gitea/modules/git"
18+
"code.gitea.io/gitea/modules/git/gitcmd"
1819
"code.gitea.io/gitea/modules/log"
1920
"code.gitea.io/gitea/modules/private"
2021
repo_module "code.gitea.io/gitea/modules/repository"
@@ -312,7 +313,7 @@ func runHookPostReceive(ctx context.Context, c *cli.Command) error {
312313
setup(ctx, c.Bool("debug"))
313314

314315
// First of all run update-server-info no matter what
315-
if _, _, err := git.NewCommand("update-server-info").RunStdString(ctx, nil); err != nil {
316+
if _, _, err := gitcmd.NewCommand("update-server-info").RunStdString(ctx, nil); err != nil {
316317
return fmt.Errorf("failed to call 'git update-server-info': %w", err)
317318
}
318319

cmd/serv.go

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"code.gitea.io/gitea/models/perm"
2222
"code.gitea.io/gitea/models/repo"
2323
"code.gitea.io/gitea/modules/git"
24+
"code.gitea.io/gitea/modules/git/gitcmd"
2425
"code.gitea.io/gitea/modules/json"
2526
"code.gitea.io/gitea/modules/lfstransfer"
2627
"code.gitea.io/gitea/modules/log"
@@ -312,30 +313,30 @@ func runServ(ctx context.Context, c *cli.Command) error {
312313
return nil
313314
}
314315

315-
var gitcmd *exec.Cmd
316-
gitBinPath := filepath.Dir(git.GitExecutable) // e.g. /usr/bin
317-
gitBinVerb := filepath.Join(gitBinPath, verb) // e.g. /usr/bin/git-upload-pack
316+
var command *exec.Cmd
317+
gitBinPath := filepath.Dir(gitcmd.GitExecutable) // e.g. /usr/bin
318+
gitBinVerb := filepath.Join(gitBinPath, verb) // e.g. /usr/bin/git-upload-pack
318319
if _, err := os.Stat(gitBinVerb); err != nil {
319320
// if the command "git-upload-pack" doesn't exist, try to split "git-upload-pack" to use the sub-command with git
320321
// ps: Windows only has "git.exe" in the bin path, so Windows always uses this way
321322
verbFields := strings.SplitN(verb, "-", 2)
322323
if len(verbFields) == 2 {
323324
// use git binary with the sub-command part: "C:\...\bin\git.exe", "upload-pack", ...
324-
gitcmd = exec.CommandContext(ctx, git.GitExecutable, verbFields[1], repoPath)
325+
command = exec.CommandContext(ctx, gitcmd.GitExecutable, verbFields[1], repoPath)
325326
}
326327
}
327-
if gitcmd == nil {
328+
if command == nil {
328329
// by default, use the verb (it has been checked above by allowedCommands)
329-
gitcmd = exec.CommandContext(ctx, gitBinVerb, repoPath)
330+
command = exec.CommandContext(ctx, gitBinVerb, repoPath)
330331
}
331332

332-
process.SetSysProcAttribute(gitcmd)
333-
gitcmd.Dir = setting.RepoRootPath
334-
gitcmd.Stdout = os.Stdout
335-
gitcmd.Stdin = os.Stdin
336-
gitcmd.Stderr = os.Stderr
337-
gitcmd.Env = append(gitcmd.Env, os.Environ()...)
338-
gitcmd.Env = append(gitcmd.Env,
333+
process.SetSysProcAttribute(command)
334+
command.Dir = setting.RepoRootPath
335+
command.Stdout = os.Stdout
336+
command.Stdin = os.Stdin
337+
command.Stderr = os.Stderr
338+
command.Env = append(command.Env, os.Environ()...)
339+
command.Env = append(command.Env,
339340
repo_module.EnvRepoIsWiki+"="+strconv.FormatBool(results.IsWiki),
340341
repo_module.EnvRepoName+"="+results.RepoName,
341342
repo_module.EnvRepoUsername+"="+results.OwnerName,
@@ -350,9 +351,9 @@ func runServ(ctx context.Context, c *cli.Command) error {
350351
)
351352
// to avoid breaking, here only use the minimal environment variables for the "gitea serv" command.
352353
// it could be re-considered whether to use the same git.CommonGitCmdEnvs() as "git" command later.
353-
gitcmd.Env = append(gitcmd.Env, git.CommonCmdServEnvs()...)
354+
command.Env = append(command.Env, gitcmd.CommonCmdServEnvs()...)
354355

355-
if err = gitcmd.Run(); err != nil {
356+
if err = command.Run(); err != nil {
356357
return fail(ctx, "Failed to execute git command", "Failed to execute git command: %v", err)
357358
}
358359

contrib/backport/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The default version will read from `docs/config.yml`. You can override this
1111
using the option `--version`.
1212

1313
The upstream branches will be fetched, using the remote `origin`. This can
14-
be overrided using `--upstream`, and fetching can be avoided using
14+
be overridden using `--upstream`, and fetching can be avoided using
1515
`--no-fetch`.
1616

1717
By default the branch created will be called `backport-$PR-$VERSION`. You

contrib/legal/privacy.html.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150

151151
<p>In general, Your Gitea Instance retains User Personal Information for as long as your account is active, or as needed to provide you service.</p>
152152

153-
<p>If you would like to cancel your account or delete your User Personal Information, you may do so in your user profile. We retain and use your information as necessary to comply with our legal obligations, resolve disputes, and enforce our agreements, but barring legal requirements, we will delete your full profile (within reason) within 90 days of your request. Feel free to contact our support to request erasure of the data we process on the bassis of consent within 30 days.</p>
153+
<p>If you would like to cancel your account or delete your User Personal Information, you may do so in your user profile. We retain and use your information as necessary to comply with our legal obligations, resolve disputes, and enforce our agreements, but barring legal requirements, we will delete your full profile (within reason) within 90 days of your request. Feel free to contact our support to request erasure of the data we process on the basis of consent within 30 days.</p>
154154

155155
<p>After an account has been deleted, certain data, such as contributions to other Users' repositories and comments in others' issues, will remain. However, we will delete or de-identify your User Personal Information, including your username and email address, from the author field of issues, pull requests, and comments by associating them with a ghost user.</p>
156156

0 commit comments

Comments
 (0)