Skip to content

Commit 36e25fa

Browse files
committed
Merge branch 'main' into full-gc-lfs
2 parents 2d36bf7 + 0e46499 commit 36e25fa

File tree

229 files changed

+932
-903
lines changed

Some content is hidden

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

229 files changed

+932
-903
lines changed

.drone.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ steps:
600600
from_secret: crowdin_key
601601

602602
- name: update
603-
image: alpine:3.13
603+
image: alpine:3.17
604604
pull: always
605605
commands:
606606
- ./build/update-locales.sh

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#Build stage
2-
FROM golang:1.19-alpine3.16 AS build-env
2+
FROM golang:1.19-alpine3.17 AS build-env
33

44
ARG GOPROXY
55
ENV GOPROXY ${GOPROXY:-direct}
@@ -23,7 +23,7 @@ RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
2323
# Begin env-to-ini build
2424
RUN go build contrib/environment-to-ini/environment-to-ini.go
2525

26-
FROM alpine:3.16
26+
FROM alpine:3.17
2727
LABEL maintainer="maintainers@gitea.io"
2828

2929
EXPOSE 22 3000

Dockerfile.rootless

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#Build stage
2-
FROM golang:1.19-alpine3.16 AS build-env
2+
FROM golang:1.19-alpine3.17 AS build-env
33

44
ARG GOPROXY
55
ENV GOPROXY ${GOPROXY:-direct}
@@ -23,7 +23,7 @@ RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
2323
# Begin env-to-ini build
2424
RUN go build contrib/environment-to-ini/environment-to-ini.go
2525

26-
FROM alpine:3.16
26+
FROM alpine:3.17
2727
LABEL maintainer="maintainers@gitea.io"
2828

2929
EXPOSE 2222 3000

cmd/admin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ func runDeleteUser(c *cli.Context) error {
665665
} else if c.IsSet("username") {
666666
user, err = user_model.GetUserByName(ctx, c.String("username"))
667667
} else {
668-
user, err = user_model.GetUserByID(c.Int64("id"))
668+
user, err = user_model.GetUserByID(ctx, c.Int64("id"))
669669
}
670670
if err != nil {
671671
return err

docs/config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ params:
2323
goVersion: 1.19
2424
minNodeVersion: 14
2525
search: nav
26+
repo: "https://github.com/go-gitea/gitea"
27+
docContentPath: "docs/content"
2628

2729
outputs:
2830
home:

docs/content/doc/packages/overview.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The following package managers are currently supported:
3232
| [Generic]({{< relref "doc/packages/generic.en-us.md" >}}) | - | any HTTP client |
3333
| [Helm]({{< relref "doc/packages/helm.en-us.md" >}}) | - | any HTTP client, `cm-push` |
3434
| [Maven]({{< relref "doc/packages/maven.en-us.md" >}}) | Java | `mvn`, `gradle` |
35-
| [npm]({{< relref "doc/packages/npm.en-us.md" >}}) | JavaScript | `npm`, `yarn` |
35+
| [npm]({{< relref "doc/packages/npm.en-us.md" >}}) | JavaScript | `npm`, `yarn`, `pnpm` |
3636
| [NuGet]({{< relref "doc/packages/nuget.en-us.md" >}}) | .NET | `nuget` |
3737
| [Pub]({{< relref "doc/packages/pub.en-us.md" >}}) | Dart | `dart`, `flutter` |
3838
| [PyPI]({{< relref "doc/packages/pypi.en-us.md" >}}) | Python | `pip`, `twine` |

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module code.gitea.io/gitea
33
go 1.18
44

55
require (
6-
code.gitea.io/gitea-vet v0.2.2-0.20220122151748-48ebc902541b
6+
code.gitea.io/gitea-vet v0.2.2
77
code.gitea.io/sdk/gitea v0.15.1
88
codeberg.org/gusted/mcaptcha v0.0.0-20220723083913-4f3072e1d570
99
gitea.com/go-chi/binding v0.0.0-20221013104517-b29891619681
@@ -15,7 +15,7 @@ require (
1515
github.com/42wim/sshsig v0.0.0-20211121163825-841cf5bbc121
1616
github.com/NYTimes/gziphandler v1.1.1
1717
github.com/PuerkitoBio/goquery v1.8.0
18-
github.com/alecthomas/chroma/v2 v2.3.0
18+
github.com/alecthomas/chroma/v2 v2.4.0
1919
github.com/blevesearch/bleve/v2 v2.3.4
2020
github.com/buildkite/terminal-to-html/v3 v3.7.0
2121
github.com/caddyserver/certmagic v0.17.2

go.sum

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
6565
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
6666
cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y=
6767
code.gitea.io/gitea-vet v0.2.1/go.mod h1:zcNbT/aJEmivCAhfmkHOlT645KNOf9W2KnkLgFjGGfE=
68-
code.gitea.io/gitea-vet v0.2.2-0.20220122151748-48ebc902541b h1:uv9a8eGSdQ8Dr4HyUcuHFfDsk/QuwO+wf+Y99RYdxY0=
69-
code.gitea.io/gitea-vet v0.2.2-0.20220122151748-48ebc902541b/go.mod h1:zcNbT/aJEmivCAhfmkHOlT645KNOf9W2KnkLgFjGGfE=
68+
code.gitea.io/gitea-vet v0.2.2 h1:TEOV/Glf38iGmKzKP0EB++Z5OSL4zGg3RrAvlwaMuvk=
69+
code.gitea.io/gitea-vet v0.2.2/go.mod h1:zcNbT/aJEmivCAhfmkHOlT645KNOf9W2KnkLgFjGGfE=
7070
code.gitea.io/sdk/gitea v0.11.3/go.mod h1:z3uwDV/b9Ls47NGukYM9XhnHtqPh/J+t40lsUrR6JDY=
7171
code.gitea.io/sdk/gitea v0.15.1 h1:WJreC7YYuxbn0UDaPuWIe/mtiNKTvLN8MLkaw71yx/M=
7272
code.gitea.io/sdk/gitea v0.15.1/go.mod h1:klY2LVI3s3NChzIk/MzMn7G1FHrfU7qd63iSMVoHRBA=
@@ -160,9 +160,10 @@ github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ
160160
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c=
161161
github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c=
162162
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs=
163+
github.com/alecthomas/assert/v2 v2.2.0 h1:f6L/b7KE2bfA+9O4FL3CM/xJccDEwPVYd5fALBiuwvw=
163164
github.com/alecthomas/chroma/v2 v2.2.0/go.mod h1:vf4zrexSH54oEjJ7EdB65tGNHmH3pGZmVkgTP5RHvAs=
164-
github.com/alecthomas/chroma/v2 v2.3.0 h1:83xfxrnjv8eK+Cf8qZDzNo3PPF9IbTWHs7z28GY6D0U=
165-
github.com/alecthomas/chroma/v2 v2.3.0/go.mod h1:mZxeWZlxP2Dy+/8cBob2PYd8O2DwNAzave5AY7A2eQw=
165+
github.com/alecthomas/chroma/v2 v2.4.0 h1:Loe2ZjT5x3q1bcWwemqyqEi8p11/IV/ncFCeLYDpWC4=
166+
github.com/alecthomas/chroma/v2 v2.4.0/go.mod h1:6kHzqF5O6FUSJzBXW7fXELjb+e+7OXW4UpoPqMO7IBQ=
166167
github.com/alecthomas/kingpin v2.2.6+incompatible/go.mod h1:59OFYbFVLKQKq+mqrL6Rw5bR0c3ACQaawgXx0QYndlE=
167168
github.com/alecthomas/repr v0.0.0-20220113201626-b1b626ac65ae/go.mod h1:2kn6fqh/zIyPLmm3ugklbEi5hg5wS435eygvNfaDQL8=
168169
github.com/alecthomas/repr v0.1.0 h1:ENn2e1+J3k09gyj2shc0dHr/yjaWSHRlrJ4DPMevDqE=
@@ -830,6 +831,7 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO
830831
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
831832
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
832833
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
834+
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
833835
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
834836
github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo=
835837
github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4=

models/activities/action.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ func (a *Action) GetOpType() ActionType {
114114
}
115115

116116
// LoadActUser loads a.ActUser
117-
func (a *Action) LoadActUser() {
117+
func (a *Action) LoadActUser(ctx context.Context) {
118118
if a.ActUser != nil {
119119
return
120120
}
121121
var err error
122-
a.ActUser, err = user_model.GetUserByID(a.ActUserID)
122+
a.ActUser, err = user_model.GetUserByID(ctx, a.ActUserID)
123123
if err == nil {
124124
return
125125
} else if user_model.IsErrUserNotExist(err) {
@@ -129,26 +129,26 @@ func (a *Action) LoadActUser() {
129129
}
130130
}
131131

132-
func (a *Action) loadRepo() {
132+
func (a *Action) loadRepo(ctx context.Context) {
133133
if a.Repo != nil {
134134
return
135135
}
136136
var err error
137-
a.Repo, err = repo_model.GetRepositoryByID(a.RepoID)
137+
a.Repo, err = repo_model.GetRepositoryByID(ctx, a.RepoID)
138138
if err != nil {
139139
log.Error("repo_model.GetRepositoryByID(%d): %v", a.RepoID, err)
140140
}
141141
}
142142

143143
// GetActFullName gets the action's user full name.
144144
func (a *Action) GetActFullName() string {
145-
a.LoadActUser()
145+
a.LoadActUser(db.DefaultContext)
146146
return a.ActUser.FullName
147147
}
148148

149149
// GetActUserName gets the action's user name.
150150
func (a *Action) GetActUserName() string {
151-
a.LoadActUser()
151+
a.LoadActUser(db.DefaultContext)
152152
return a.ActUser.Name
153153
}
154154

@@ -179,7 +179,7 @@ func (a *Action) GetDisplayNameTitle() string {
179179

180180
// GetRepoUserName returns the name of the action repository owner.
181181
func (a *Action) GetRepoUserName() string {
182-
a.loadRepo()
182+
a.loadRepo(db.DefaultContext)
183183
return a.Repo.OwnerName
184184
}
185185

@@ -191,7 +191,7 @@ func (a *Action) ShortRepoUserName() string {
191191

192192
// GetRepoName returns the name of the action repository.
193193
func (a *Action) GetRepoName() string {
194-
a.loadRepo()
194+
a.loadRepo(db.DefaultContext)
195195
return a.Repo.Name
196196
}
197197

@@ -379,7 +379,7 @@ func activityQueryCondition(opts GetFeedsOptions) (builder.Cond, error) {
379379
cond := builder.NewCond()
380380

381381
if opts.RequestedTeam != nil && opts.RequestedUser == nil {
382-
org, err := user_model.GetUserByID(opts.RequestedTeam.OrgID)
382+
org, err := user_model.GetUserByID(db.DefaultContext, opts.RequestedTeam.OrgID)
383383
if err != nil {
384384
return nil, err
385385
}
@@ -489,7 +489,7 @@ func NotifyWatchers(ctx context.Context, actions ...*Action) error {
489489
}
490490

491491
if repoChanged {
492-
act.loadRepo()
492+
act.loadRepo(ctx)
493493
repo = act.Repo
494494

495495
// check repo owner exist.
@@ -514,7 +514,7 @@ func NotifyWatchers(ctx context.Context, actions ...*Action) error {
514514
permIssue = make([]bool, len(watchers))
515515
permPR = make([]bool, len(watchers))
516516
for i, watcher := range watchers {
517-
user, err := user_model.GetUserByIDCtx(ctx, watcher.UserID)
517+
user, err := user_model.GetUserByID(ctx, watcher.UserID)
518518
if err != nil {
519519
permCode[i] = false
520520
permIssue[i] = false

models/activities/action_list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (actions ActionList) loadRepoOwner(ctx context.Context, userMap map[int64]*
8181
}
8282
repoOwner, ok := userMap[action.Repo.OwnerID]
8383
if !ok {
84-
repoOwner, err = user_model.GetUserByIDCtx(ctx, action.Repo.OwnerID)
84+
repoOwner, err = user_model.GetUserByID(ctx, action.Repo.OwnerID)
8585
if err != nil {
8686
if user_model.IsErrUserNotExist(err) {
8787
continue

0 commit comments

Comments
 (0)