Skip to content

Commit 3ba7c55

Browse files
authored
Merge branch 'master' into master
2 parents 0a3aea7 + 72e0ad8 commit 3ba7c55

File tree

92 files changed

+1604
-887
lines changed

Some content is hidden

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

92 files changed

+1604
-887
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ _testmain.go
3232

3333
*coverage.out
3434
coverage.all
35+
cpu.out
3536

3637
/modules/options/bindata.go
3738
/modules/options/bindata.go.hash

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,36 @@ This changelog goes through all the changes that have been made in each release
44
without substantial changes to our git log; to see the highlights of what has
55
been added to each release, please refer to the [blog](https://blog.gitea.io).
66

7+
## [1.14.1](https://github.com/go-gitea/gitea/releases/tag/v1.14.1) - 2021-04-15
8+
9+
* BUGFIXES
10+
* Fix bug clone wiki (#15499) (#15502)
11+
* Github Migration ignore rate limit, if not enabled (#15490) (#15495)
12+
* Use subdir for URL (#15446) (#15493)
13+
* Query the DB for the hash before inserting in to email_hash (#15457) (#15491)
14+
* Ensure review dismissal only dismisses the correct review (#15477) (#15489)
15+
* Use index of the supported tags to choose user lang (#15452) (#15488)
16+
* Fix wrong file link in code search page (#15466) (#15486)
17+
* Quick template fix for built-in SSH server in admin config (#15464) (#15481)
18+
* Prevent superfluous response.WriteHeader (#15456) (#15476)
19+
* Fix ambiguous argument error on tags (#15432) (#15474)
20+
* Add created_unix instead of expiry to migration (#15458) (#15463)
21+
* Fix repository search (#15428) (#15442)
22+
* Prevent NPE on avatar direct rendering if federated avatars disabled (#15434) (#15439)
23+
* Fix wiki clone urls (#15430) (#15431)
24+
* Fix dingtalk icon url at webhook (#15417) (#15426)
25+
* Standardise icon on projects PR page (#15387) (#15408)
26+
* ENHANCEMENTS
27+
* Add option to skip LFS/attachment files for `dump` (#15407) (#15492)
28+
* Clone panel fixes (#15436)
29+
* Use semantic dropdown for code search query type (#15276) (#15364)
30+
* BUILD
31+
* Build go-git variants for windows (#15482) (#15487)
32+
* Lock down build-images dependencies (Partial #15479) (#15480)
33+
* MISC
34+
* Performance improvement for list pull requests (#15447) (#15500)
35+
* Fix potential copy lfs records failure when fork a repository (#15441) (#15485)
36+
737
## [1.14.0](https://github.com/go-gitea/gitea/releases/tag/v1.14.0) - 2021-04-11
838

939
* SECURITY

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,10 @@ git-check:
210210
.PHONY: node-check
211211
node-check:
212212
$(eval NODE_VERSION := $(shell printf "%03d%03d%03d" $(shell node -v | cut -c2- | tr '.' ' ');))
213+
$(eval MIN_NODE_VER_FMT := $(shell printf "%g.%g.%g" $(shell echo $(MIN_NODE_VERSION) | grep -o ...)))
213214
$(eval NPM_MISSING := $(shell hash npm > /dev/null 2>&1 || echo 1))
214215
@if [ "$(NODE_VERSION)" -lt "$(MIN_NODE_VERSION)" -o "$(NPM_MISSING)" = "1" ]; then \
215-
echo "Gitea requires Node.js 10 or greater and npm to build. You can get it at https://nodejs.org/en/download/"; \
216+
echo "Gitea requires Node.js $(MIN_NODE_VER_FMT) or greater and npm to build. You can get it at https://nodejs.org/en/download/"; \
216217
exit 1; \
217218
fi
218219

contrib/pr/checkout.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func runPR() {
114114

115115
log.Printf("[PR] Setting up router\n")
116116
//routers.GlobalInit()
117-
external.RegisterParsers()
117+
external.RegisterRenderers()
118118
markup.Init()
119119
c := routes.NormalRoutes()
120120

docs/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ params:
1818
description: Git with a cup of tea
1919
author: The Gitea Authors
2020
website: https://docs.gitea.io
21-
version: 1.14.0
21+
version: 1.14.1
2222
minGoVersion: 1.14
2323
goVersion: 1.16
2424
minNodeVersion: 12.17

docs/content/doc/advanced/customizing-gitea.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ environment variable; this can be used to override the default path to something
4242
`GITEA_CUSTOM` might, for example, be set by an init script. You can check whether the value
4343
is set under the "Configuration" tab on the site administration page.
4444

45-
- [List of Environment Variables](https://docs.gitea.io/en-us/specific-variables/)
45+
- [List of Environment Variables](https://docs.gitea.io/en-us/environment-variables/)
4646

4747
**Note:** Gitea must perform a full restart to see configuration changes.
4848

docs/content/doc/developers/api-usage.en-us.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ API Reference guide is auto-generated by swagger and available on:
7979
or on
8080
[gitea demo instance](https://try.gitea.io/api/swagger)
8181

82+
The OpenAPI document is at:
83+
`https://gitea.your.host/swagger.v1.json`
84+
8285
## Listing your issued tokens via the API
8386

8487
As mentioned in

docs/content/doc/help/seek-help.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ If you found a bug, please create an [issue on GitHub](https://github.com/go-git
3333

3434
## Chinese Support
3535

36-
Support for the Chinese language is provided at [gocn.vip](https://gocn.vip/topic/gitea).
36+
Support for the Chinese language is provided at [Our discourse](https://discourse.gitea.io/c/5-category/5).

docs/content/doc/help/seek-help.zh-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ menu:
1818
如果您在使用或者开发过程中遇到问题,请到以下渠道咨询:
1919

2020
-[Github issue](https://github.com/go-gitea/gitea/issues)提问(因为项目维护人员来自世界各地,为保证沟通顺畅,请使用英文提问)
21-
- 中文问题到[gocn.vip](https://gocn.vip/topic/gitea)提问
21+
- 中文问题到 [Gitea 论坛](https://discourse.gitea.io/c/5-category/5)提问
2222
- 访问 [Discord server - 英文](https://discord.gg/Gitea)
2323
- 加入 QQ群 328432459 获得进一步的支持

docs/content/doc/installation/with-docker-rootless.en-us.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ services:
8989
server:
9090
image: gitea/gitea:latest-rootless
9191
+ environment:
92-
+ - GITEA__database__TYPE=mysql
92+
+ - GITEA__database__DB_TYPE=mysql
9393
+ - GITEA__database__HOST=db:3306
9494
+ - GITEA__database__NAME=gitea
9595
+ - GITEA__database__USER=gitea
@@ -130,7 +130,7 @@ services:
130130
server:
131131
image: gitea/gitea:latest-rootless
132132
environment:
133-
+ - GITEA__database__TYPE=postgres
133+
+ - GITEA__database__DB_TYPE=postgres
134134
+ - GITEA__database__HOST=db:5432
135135
+ - GITEA__database__NAME=gitea
136136
+ - GITEA__database__USER=gitea

docs/content/doc/installation/with-docker.en-us.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ services:
118118
environment:
119119
- USER_UID=1000
120120
- USER_GID=1000
121-
+ - GITEA__database__TYPE=mysql
121+
+ - GITEA__database__DB_TYPE=mysql
122122
+ - GITEA__database__HOST=db:3306
123123
+ - GITEA__database__NAME=gitea
124124
+ - GITEA__database__USER=gitea
@@ -169,7 +169,7 @@ services:
169169
environment:
170170
- USER_UID=1000
171171
- USER_GID=1000
172-
+ - GITEA__database__TYPE=postgres
172+
+ - GITEA__database__DB_TYPE=postgres
173173
+ - GITEA__database__HOST=db:5432
174174
+ - GITEA__database__NAME=gitea
175175
+ - GITEA__database__USER=gitea

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ require (
122122
github.com/unknwon/com v1.0.1
123123
github.com/unknwon/i18n v0.0.0-20210321134014-0ebbf2df1c44
124124
github.com/unknwon/paginater v0.0.0-20200328080006-042474bd0eae
125-
github.com/unrolled/render v1.0.3
125+
github.com/unrolled/render v1.1.0
126126
github.com/urfave/cli v1.22.5
127127
github.com/willf/bitset v1.1.11 // indirect
128128
github.com/xanzy/go-gitlab v0.44.0

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,8 @@ github.com/unknwon/paginater v0.0.0-20200328080006-042474bd0eae h1:ihaXiJkaca54I
11151115
github.com/unknwon/paginater v0.0.0-20200328080006-042474bd0eae/go.mod h1:1fdkY6xxl6ExVs2QFv7R0F5IRZHKA8RahhB9fMC9RvM=
11161116
github.com/unrolled/render v1.0.3 h1:baO+NG1bZSF2WR4zwh+0bMWauWky7DVrTOfvE2w+aFo=
11171117
github.com/unrolled/render v1.0.3/go.mod h1:gN9T0NhL4Bfbwu8ann7Ry/TGHYfosul+J0obPf6NBdM=
1118+
github.com/unrolled/render v1.1.0 h1:gvpR9hHxTt6DcGqRYuVVFcfd8rtK+nyEPUJN06KB57Q=
1119+
github.com/unrolled/render v1.1.0/go.mod h1:gN9T0NhL4Bfbwu8ann7Ry/TGHYfosul+J0obPf6NBdM=
11181120
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
11191121
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
11201122
github.com/urfave/cli v1.22.5 h1:lNq9sAHXK2qfdI8W+GRItjCEkI+2oR4d+MEHy1CKXoU=

integrations/api_branch_test.go

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -151,22 +151,28 @@ func testAPICreateBranches(t *testing.T, giteaURL *url.URL) {
151151
for _, test := range tests {
152152
defer resetFixtures(t)
153153
session := ctx.Session
154-
token := getTokenForLoggedInUser(t, session)
155-
req := NewRequestWithJSON(t, "POST", "/api/v1/repos/user2/my-noo-repo/branches?token="+token, &api.CreateBranchRepoOption{
156-
BranchName: test.NewBranch,
157-
OldBranchName: test.OldBranch,
158-
})
159-
resp := session.MakeRequest(t, req, test.ExpectedHTTPStatus)
160-
161-
var branch api.Branch
162-
DecodeJSON(t, resp, &branch)
163-
164-
if test.ExpectedHTTPStatus == http.StatusCreated {
165-
assert.EqualValues(t, test.NewBranch, branch.Name)
166-
}
154+
testAPICreateBranch(t, session, "user2", "my-noo-repo", test.OldBranch, test.NewBranch, test.ExpectedHTTPStatus)
167155
}
168156
}
169157

158+
func testAPICreateBranch(t testing.TB, session *TestSession, user, repo, oldBranch, newBranch string, status int) bool {
159+
token := getTokenForLoggedInUser(t, session)
160+
req := NewRequestWithJSON(t, "POST", "/api/v1/repos/"+user+"/"+repo+"/branches?token="+token, &api.CreateBranchRepoOption{
161+
BranchName: newBranch,
162+
OldBranchName: oldBranch,
163+
})
164+
resp := session.MakeRequest(t, req, status)
165+
166+
var branch api.Branch
167+
DecodeJSON(t, resp, &branch)
168+
169+
if status == http.StatusCreated {
170+
assert.EqualValues(t, newBranch, branch.Name)
171+
}
172+
173+
return resp.Result().StatusCode == status
174+
}
175+
170176
func TestAPIBranchProtection(t *testing.T) {
171177
defer prepareTestEnv(t)()
172178

integrations/api_repo_file_create_test.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,36 @@ func getExpectedFileResponseForCreate(commitID, treePath string) *api.FileRespon
105105
}
106106
}
107107

108+
func BenchmarkAPICreateFileSmall(b *testing.B) {
109+
onGiteaRunTB(b, func(t testing.TB, u *url.URL) {
110+
b := t.(*testing.B)
111+
user2 := models.AssertExistsAndLoadBean(t, &models.User{ID: 2}).(*models.User) // owner of the repo1 & repo16
112+
repo1 := models.AssertExistsAndLoadBean(t, &models.Repository{ID: 1}).(*models.Repository) // public repo
113+
114+
for n := 0; n < b.N; n++ {
115+
treePath := fmt.Sprintf("update/file%d.txt", n)
116+
createFileInBranch(user2, repo1, treePath, repo1.DefaultBranch, treePath)
117+
}
118+
})
119+
}
120+
121+
func BenchmarkAPICreateFileMedium(b *testing.B) {
122+
data := make([]byte, 10*1024*1024)
123+
124+
onGiteaRunTB(b, func(t testing.TB, u *url.URL) {
125+
b := t.(*testing.B)
126+
user2 := models.AssertExistsAndLoadBean(t, &models.User{ID: 2}).(*models.User) // owner of the repo1 & repo16
127+
repo1 := models.AssertExistsAndLoadBean(t, &models.Repository{ID: 1}).(*models.Repository) // public repo
128+
129+
b.ResetTimer()
130+
for n := 0; n < b.N; n++ {
131+
treePath := fmt.Sprintf("update/file%d.txt", n)
132+
copy(data, treePath)
133+
createFileInBranch(user2, repo1, treePath, repo1.DefaultBranch, treePath)
134+
}
135+
})
136+
}
137+
108138
func TestAPICreateFile(t *testing.T) {
109139
onGiteaRun(t, func(t *testing.T, u *url.URL) {
110140
user2 := models.AssertExistsAndLoadBean(t, &models.User{ID: 2}).(*models.User) // owner of the repo1 & repo16

integrations/api_repo_file_helpers.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ import (
1010
api "code.gitea.io/gitea/modules/structs"
1111
)
1212

13-
func createFileInBranch(user *models.User, repo *models.Repository, treePath, branchName string) (*api.FileResponse, error) {
13+
func createFileInBranch(user *models.User, repo *models.Repository, treePath, branchName, content string) (*api.FileResponse, error) {
1414
opts := &repofiles.UpdateRepoFileOptions{
1515
OldBranch: branchName,
1616
TreePath: treePath,
17-
Content: "This is a NEW file",
17+
Content: content,
1818
IsNewFile: true,
1919
Author: nil,
2020
Committer: nil,
@@ -23,5 +23,5 @@ func createFileInBranch(user *models.User, repo *models.Repository, treePath, br
2323
}
2424

2525
func createFile(user *models.User, repo *models.Repository, treePath string) (*api.FileResponse, error) {
26-
return createFileInBranch(user, repo, treePath, repo.DefaultBranch)
26+
return createFileInBranch(user, repo, treePath, repo.DefaultBranch, "This is a NEW file")
2727
}

0 commit comments

Comments
 (0)