Skip to content

Commit 8cb75e3

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Use multi reader instead to concat strings (go-gitea#22099) Fix sorting admin user list by last login (go-gitea#22081) Fix wrong default value for update checker on app.example.ini (go-gitea#22084) fix(config): remove context on config template (go-gitea#22096) [skip ci] Updated licenses and gitignores Update xorm (go-gitea#22094) Remove unnecessary whitespace in snapcraft.yaml (go-gitea#22090) Rename almost all Ctx functions (go-gitea#22071) Change ID pattern of raw content container for issue (go-gitea#21966) Optimize html templates (go-gitea#22080) Add API management for issue/pull and comment attachments (go-gitea#21783) Rename actions to operations on UI (go-gitea#22067) Update go dev dependencies (go-gitea#22064)
2 parents c3cda9e + 3e8285b commit 8cb75e3

File tree

184 files changed

+2654
-1019
lines changed

Some content is hidden

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

184 files changed

+2654
-1019
lines changed

.golangci.yml

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
linters:
22
enable:
3-
- gosimple
4-
- deadcode
5-
- typecheck
6-
- govet
7-
- errcheck
8-
- staticcheck
9-
- unused
10-
- structcheck
11-
- varcheck
3+
- bidichk
4+
# - deadcode # deprecated - https://github.com/golangci/golangci-lint/issues/1841
5+
- depguard
126
- dupl
13-
#- gocyclo # The cyclomatic complexety of a lot of functions is too high, we should refactor those another time.
14-
- gofmt
7+
- errcheck
158
- gocritic
16-
- bidichk
17-
- ineffassign
18-
- revive
9+
# - gocyclo # The cyclomatic complexety of a lot of functions is too high, we should refactor those another time.
10+
- gofmt
1911
- gofumpt
20-
- depguard
12+
- gosimple
13+
- govet
14+
- ineffassign
2115
- nakedret
22-
- unconvert
23-
- wastedassign
2416
- nolintlint
17+
- revive
18+
- staticcheck
19+
# - structcheck # deprecated - https://github.com/golangci/golangci-lint/issues/1841
2520
- stylecheck
21+
- typecheck
22+
- unconvert
23+
- unused
24+
# - varcheck # deprecated - https://github.com/golangci/golangci-lint/issues/1841
25+
# - wastedassign # disabled - https://github.com/golangci/golangci-lint/issues/2649
2626
enable-all: false
2727
disable-all: true
2828
fast: false

Makefile

+6-6
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ COMMA := ,
2626
XGO_VERSION := go-1.19.x
2727

2828
AIR_PACKAGE ?= github.com/cosmtrek/[email protected]
29-
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@2.5.0
30-
ERRCHECK_PACKAGE ?= github.com/kisielk/[email protected].1
31-
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.3.1
32-
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.47.0
29+
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@2.6.0
30+
ERRCHECK_PACKAGE ?= github.com/kisielk/[email protected].2
31+
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.4.0
32+
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1
3333
GXZ_PAGAGE ?= github.com/ulikunitz/xz/cmd/[email protected]
3434
MISSPELL_PACKAGE ?= github.com/client9/misspell/cmd/[email protected]
35-
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/[email protected].0
35+
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/[email protected].3
3636
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
37-
GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1.3.0
37+
GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1.5.0
3838
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@latest
3939

4040
DOCKER_IMAGE ?= gitea/gitea

cmd/admin.go

+1
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,7 @@ func runRepoSyncReleases(_ *cli.Context) error {
778778

779779
func getReleaseCount(id int64) (int64, error) {
780780
return repo_model.GetReleaseCountByRepoID(
781+
db.DefaultContext,
781782
id,
782783
repo_model.FindReleasesOptions{
783784
IncludeTags: true,

custom/conf/app.example.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -2147,7 +2147,7 @@ ROUTER = console
21472147
;[cron.update_checker]
21482148
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
21492149
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2150-
;ENABLED = false
2150+
;ENABLED = true
21512151
;RUN_AT_START = false
21522152
;ENABLE_SUCCESS_NOTICE = false
21532153
;SCHEDULE = @every 168h

docs/content/doc/advanced/config-cheat-sheet.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ Default templates for project boards:
10051005

10061006
#### Cron - Check for new Gitea versions ('cron.update_checker')
10071007

1008-
- `ENABLED`: **false**: Enable service.
1008+
- `ENABLED`: **true**: Enable service.
10091009
- `RUN_AT_START`: **false**: Run tasks at start up time (if ENABLED).
10101010
- `ENABLE_SUCCESS_NOTICE`: **true**: Set to false to switch off success notices.
10111011
- `SCHEDULE`: **@every 168h**: Cron syntax for scheduling a work, e.g. `@every 168h`.

go.mod

+3-3
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ require (
105105
gopkg.in/yaml.v3 v3.0.1
106106
mvdan.cc/xurls/v2 v2.4.0
107107
strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251
108-
xorm.io/builder v0.3.11
109-
xorm.io/xorm v1.3.2-0.20220714055524-c3bce556200f
108+
xorm.io/builder v0.3.12
109+
xorm.io/xorm v1.3.3-0.20221209153726-f1bfc5ce9830
110110
)
111111

112112
require (
@@ -182,7 +182,7 @@ require (
182182
github.com/go-openapi/strfmt v0.21.3 // indirect
183183
github.com/go-openapi/swag v0.22.3 // indirect
184184
github.com/go-openapi/validate v0.22.0 // indirect
185-
github.com/goccy/go-json v0.9.11 // indirect
185+
github.com/goccy/go-json v0.10.0 // indirect
186186
github.com/gogo/protobuf v1.3.2 // indirect
187187
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
188188
github.com/golang-sql/sqlexp v0.1.0 // indirect

go.sum

+6-6
Original file line numberDiff line numberDiff line change
@@ -599,8 +599,8 @@ github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJA
599599
github.com/goccy/go-json v0.8.1/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
600600
github.com/goccy/go-json v0.9.5/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
601601
github.com/goccy/go-json v0.9.6/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
602-
github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk=
603-
github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
602+
github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA=
603+
github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
604604
github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
605605
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
606606
github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
@@ -2379,7 +2379,7 @@ sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1
23792379
strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251 h1:mUcz5b3FJbP5Cvdq7Khzn6J9OCUQJaBwgBkCR+MOwSs=
23802380
strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251/go.mod h1:FJGmPh3vz9jSos1L/F91iAgnC/aejc0wIIrF2ZwJxdY=
23812381
xorm.io/builder v0.3.11-0.20220531020008-1bd24a7dc978/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE=
2382-
xorm.io/builder v0.3.11 h1:naLkJitGyYW7ZZdncsh/JW+HF4HshmvTHTyUyPwJS00=
2383-
xorm.io/builder v0.3.11/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE=
2384-
xorm.io/xorm v1.3.2-0.20220714055524-c3bce556200f h1:3NvNsM4lnttTsHpk8ODHqrwN1MCEjsO3bD/rpd8A47k=
2385-
xorm.io/xorm v1.3.2-0.20220714055524-c3bce556200f/go.mod h1:9NbjqdnjX6eyjRRhh01GHm64r6N9shTb/8Ak3YRt8Nw=
2382+
xorm.io/builder v0.3.12 h1:ASZYX7fQmy+o8UJdhlLHSW57JDOkM8DNhcAF5d0LiJM=
2383+
xorm.io/builder v0.3.12/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE=
2384+
xorm.io/xorm v1.3.3-0.20221209153726-f1bfc5ce9830 h1:ohaHCvT7ocSDkTEa2/2z0BXfINYlHm/Z7IzN7MeXQlM=
2385+
xorm.io/xorm v1.3.3-0.20221209153726-f1bfc5ce9830/go.mod h1:9NbjqdnjX6eyjRRhh01GHm64r6N9shTb/8Ak3YRt8Nw=

models/db/context.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ type contextKey struct {
2121
}
2222

2323
// enginedContextKey is a context key. It is used with context.Value() to get the current Engined for the context
24-
var enginedContextKey = &contextKey{"engined"}
25-
var _ Engined = &Context{}
24+
var (
25+
enginedContextKey = &contextKey{"engined"}
26+
_ Engined = &Context{}
27+
)
2628

2729
// Context represents a db context
2830
type Context struct {

models/db/engine.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ type Engine interface {
4646
Incr(column string, arg ...interface{}) *xorm.Session
4747
Insert(...interface{}) (int64, error)
4848
Iterate(interface{}, xorm.IterFunc) error
49-
Join(joinOperator string, tablename interface{}, condition string, args ...interface{}) *xorm.Session
49+
Join(joinOperator string, tablename, condition interface{}, args ...interface{}) *xorm.Session
5050
SQL(interface{}, ...interface{}) *xorm.Session
5151
Where(interface{}, ...interface{}) *xorm.Session
5252
Asc(colNames ...string) *xorm.Session

models/issues/assignees.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func toggleIssueAssignee(ctx context.Context, issue *Issue, doer *user_model.Use
102102
AssigneeID: assigneeID,
103103
}
104104
// Comment
105-
comment, err = CreateCommentCtx(ctx, opts)
105+
comment, err = CreateComment(ctx, opts)
106106
if err != nil {
107107
return false, nil, fmt.Errorf("createComment: %w", err)
108108
}

0 commit comments

Comments
 (0)