Skip to content

Commit 8503c0b

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: (37 commits) Collaborator trust model should trust collaborators (go-gitea#18539) Detect conflicts with 3way merge (go-gitea#18536) [skip ci] Updated translations via Crowdin Update 1.16.0 changelog to set go-gitea#17846 as breaking (go-gitea#18533) In docker rootless use $GITEA_APP_INI if provided (go-gitea#18524) revert to node14 for snapcraft Add `GetUserTeams` (go-gitea#18499) Fix review excerpt (go-gitea#18502) Update JS dependencies, fix lint (go-gitea#18389) add test coverage for original author conversion during migrations (go-gitea#18506) add gitea-fmt back (go-gitea#18526) Fix non-ASCII search on database (go-gitea#18437) Use "read" value for General Access (go-gitea#18496) Fix for AvatarURL database type (go-gitea#18487) Remove go 1.15 support (go-gitea#18511) [skip ci] Updated translations via Crowdin Use `ImagedProvider` for gplus oauth2 provider (go-gitea#18504) build with node16 in snap (go-gitea#18508) point to s3 endpoint directly (go-gitea#18497) Fix OAuth Source Edit Page (go-gitea#18495) ...
2 parents a3eff2e + 76e3111 commit 8503c0b

File tree

134 files changed

+1759
-848
lines changed

Some content is hidden

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

134 files changed

+1759
-848
lines changed

.drone.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ steps:
305305

306306
- name: coverage-codecov
307307
pull: always
308-
image: plugins/codecov
308+
image: woodpeckerci/plugin-codecov:next-alpine
309309
settings:
310310
files:
311311
- coverage.all
@@ -567,7 +567,7 @@ steps:
567567
settings:
568568
acl: public-read
569569
bucket: gitea-artifacts
570-
endpoint: https://storage.gitea.io
570+
endpoint: https://ams3.digitaloceanspaces.com
571571
path_style: true
572572
source: "dist/release/*"
573573
strip_prefix: dist/release/
@@ -588,7 +588,7 @@ steps:
588588
settings:
589589
acl: public-read
590590
bucket: gitea-artifacts
591-
endpoint: https://storage.gitea.io
591+
endpoint: https://ams3.digitaloceanspaces.com
592592
path_style: true
593593
source: "dist/release/*"
594594
strip_prefix: dist/release/
@@ -641,6 +641,7 @@ steps:
641641
environment:
642642
GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
643643
TAGS: bindata sqlite sqlite_unlock_notify
644+
depends_on: [fetch-tags]
644645

645646
- name: gpg-sign
646647
pull: always
@@ -656,14 +657,15 @@ steps:
656657
from_secret: gpgsign_key
657658
GPGSIGN_PASSPHRASE:
658659
from_secret: gpgsign_passphrase
660+
depends_on: [static]
659661

660662
- name: release-tag
661663
pull: always
662664
image: woodpeckerci/plugin-s3:latest
663665
settings:
664666
acl: public-read
665667
bucket: gitea-artifacts
666-
endpoint: https://storage.gitea.io
668+
endpoint: https://ams3.digitaloceanspaces.com
667669
path_style: true
668670
source: "dist/release/*"
669671
strip_prefix: dist/release/
@@ -673,6 +675,7 @@ steps:
673675
from_secret: aws_access_key_id
674676
AWS_SECRET_ACCESS_KEY:
675677
from_secret: aws_secret_access_key
678+
depends_on: [gpg-sign]
676679

677680
- name: github
678681
pull: always
@@ -683,6 +686,7 @@ steps:
683686
environment:
684687
GITHUB_TOKEN:
685688
from_secret: github_token
689+
depends_on: [gpg-sign]
686690

687691
---
688692
kind: pipeline

.eslintrc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ env:
2323

2424
globals:
2525
__webpack_public_path__: true
26-
CodeMirror: false
27-
Dropzone: false
28-
SimpleMDE: false
2926

3027
settings:
3128
html/html-extensions: [".tmpl"]
@@ -34,7 +31,6 @@ overrides:
3431
- files: ["web_src/**/*.js", "web_src/**/*.vue", "templates/**/*.tmpl"]
3532
env:
3633
browser: true
37-
jquery: true
3834
node: false
3935
- files: ["templates/**/*.tmpl"]
4036
rules:

CHANGELOG.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@ 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.16.0-rc1](https://github.com/go-gitea/gitea/releases/tag/v1.16.0-rc1) - 2022-01-19
7+
## [1.16.0](https://github.com/go-gitea/gitea/releases/tag/v1.16.0) - 2022-01-30
88

99
* BREAKING
1010
* Remove golang vendored directory (#18277)
1111
* Paginate releases page & set default page size to 10 (#16857)
12+
* Use shadowing script for docker (#17846)
1213
* Only allow webhook to send requests to allowed hosts (#17482)
1314
* SECURITY
15+
* Disable content sniffing on `PlainTextBytes` (#18359) (#18365)
16+
* Only view milestones from current repo (#18414) (#18417)
1417
* Sanitize user-input on file name (#17666)
1518
* Use `hostmatcher` to replace `matchlist` to improve blocking of bad hosts in Webhooks (#17605)
1619
* FEATURES
@@ -228,6 +231,16 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
228231
* Add left padding for chunk header of split diff view (#13397)
229232
* Allow U2F 2FA without TOTP (#11573)
230233
* BUGFIXES
234+
* GitLab reviews may not have the updated_at field set (#18450) (#18461)
235+
* Fix detection of no commits when the default branch is not master (#18422) (#18423)
236+
* Fix broken oauth2 authentication source edit page (#18412) (#18419)
237+
* Place inline diff comment dialogs on split diff in 4th and 8th columns (#18403) (#18404)
238+
* Fix restore without topic failure (#18387) (#18400)
239+
* Fix commit's time (#18375) (#18392)
240+
* Fix partial cloning a repo (#18373) (#18377)
241+
* Stop trimming preceding and suffixing spaces from editor filenames (#18334)
242+
* Prevent showing webauthn error for every time visiting `/user/settings/security` (#18386)
243+
* Fix mime-type detection for HTTP server (#18370) (#18371)
231244
* Stop trimming preceding and suffixing spaces from editor filenames (#18334)
232245
* Restore propagation of ErrDependenciesLeft (#18325)
233246
* Fix PR comments UI (#18323)
@@ -295,10 +308,22 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
295308
* BUILD
296309
* Add lockfile-check (#18285)
297310
* Don't store assets modified time into generated files (#18193)
298-
* Use shadowing script for docker (#17846)
299311
* MISC
300312
* Update JS dependencies (#17611)
301313

314+
## [1.15.11](https://github.com/go-gitea/gitea/releases/tag/v1.15.11) - 2022-01-29
315+
316+
* SECURITY
317+
* Only view milestones from current repo (#18414) (#18418)
318+
* BUGFIXES
319+
* Fix broken when no commits and default branch is not master (#18422) (#18424)
320+
* Fix commit's time (#18375) (#18409)
321+
* Fix restore without topic failure (#18387) (#18401)
322+
* Fix mermaid import in 1.15 (it uses ESModule now) (#18382)
323+
* Update to go/text 0.3.7 (#18336)
324+
* MISC
325+
* Upgrade EasyMDE to 2.16.1 (#18278) (#18279)
326+
302327
## [1.15.10](https://github.com/go-gitea/gitea/releases/tag/v1.15.10) - 2022-01-14
303328

304329
* BUGFIXES

CONTRIBUTING.md

Lines changed: 74 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,15 @@ Some of the key points:
134134
if that is not related to your PR, please make *another* PR for that.
135135
* Split big pull requests into multiple small ones. An incremental change
136136
will be faster to review than a huge PR.
137+
* Use the first comment as a summary explainer of your PR and you should keep this up-to-date as the PR evolves.
138+
139+
If your PR could cause a breaking change you must add a BREAKING section to this comment e.g.:
140+
141+
```
142+
## :warning: BREAKING :warning:
143+
```
144+
145+
To explain how this could affect users and how to mitigate these changes.
137146

138147
## Styleguide
139148

@@ -203,13 +212,74 @@ In general, HTTP methods are chosen as follows:
203212
* **PUT** endpoints return status **No Content (204)**, used to **add/assign** existing Objects (e.g. User) to something (e.g. Org-Team)
204213
* **PATCH** endpoints return changed object and status **OK (200)**, used to **edit/change** an existing object
205214

206-
207215
An endpoint which changes/edits an object expects all fields to be optional (except ones to identify the object, which are required).
208-
209216
### Endpoints returning lists should
210217
* support pagination (`page` & `limit` options in query)
211218
* set `X-Total-Count` header via **SetTotalCountHeader** ([example](https://github.com/go-gitea/gitea/blob/7aae98cc5d4113f1e9918b7ee7dd09f67c189e3e/routers/api/v1/repo/issue.go#L444))
212219

220+
## Large Character Comments
221+
222+
Throughout the codebase there are large-text comments for sections of code, e.g.:
223+
224+
```go
225+
// __________ .__
226+
// \______ \ _______ _|__| ______ _ __
227+
// | _// __ \ \/ / |/ __ \ \/ \/ /
228+
// | | \ ___/\ /| \ ___/\ /
229+
// |____|_ /\___ >\_/ |__|\___ >\/\_/
230+
// \/ \/ \/
231+
```
232+
233+
These were created using the `figlet` tool with the `graffiti` font.
234+
235+
A simple way of creating these is to use the following:
236+
237+
```bash
238+
figlet -f graffiti Review | sed -e's+^+// +' - | xclip -sel clip -in
239+
```
240+
241+
## Backports and Frontports
242+
243+
Occasionally backports of PRs are required.
244+
245+
The backported PR title should be:
246+
247+
```
248+
Title of backported PR (#ORIGINAL_PR_NUMBER)
249+
```
250+
251+
The first two lines of the summary of the backporting PR should be:
252+
253+
```
254+
Backport #ORIGINAL_PR_NUMBER
255+
256+
```
257+
258+
with the rest of the summary matching the original PR. Similarly for frontports
259+
260+
---
261+
262+
The below is a script that may be helpful in creating backports. YMMV.
263+
264+
```bash
265+
#!/bin/sh
266+
PR="$1"
267+
SHA="$2"
268+
VERSION="$3"
269+
270+
if [ -z "$SHA" ]; then
271+
SHA=$(gh api /repos/go-gitea/gitea/pulls/$PR -q '.merge_commit_sha')
272+
fi
273+
274+
if [ -z "$VERSION" ]; then
275+
VERSION="v1.16"
276+
fi
277+
278+
echo git checkout origin/release/"$VERSION" -b backport-$PR-$VERSION
279+
git checkout origin/release/"$VERSION" -b backport-$PR-$VERSION
280+
git cherry-pick $SHA && git commit --amend && git push zeripath backport-$PR-$VERSION && xdg-open https://github.com/go-gitea/gitea/compare/release/"$VERSION"...zeripath:backport-$PR-$VERSION
281+
282+
```
213283

214284
## Developer Certificate of Origin (DCO)
215285

@@ -351,15 +421,15 @@ be reviewed by two maintainers and must pass the automatic tests.
351421
* If it is bugfix version create PR for changelog on branch `release/v$vmaj.$vmin` and wait till it is reviewed and merged.
352422
* Add a tag as `git tag -s -F release.notes v$vmaj.$vmin.$`, release.notes file could be a temporary file to only include the changelog this version which you added to `CHANGELOG.md`.
353423
* And then push the tag as `git push origin v$vmaj.$vmin.$`. Drone CI will automatically create a release and upload all the compiled binary. (But currently it doesn't add the release notes automatically. Maybe we should fix that.)
354-
* If needed send PR for changelog on branch `main`.
424+
* If needed send a frontport PR for the changelog to branch `main` and update the version in `docs/config.yaml` to refer to the new version.
355425
* Send PR to [blog repository](https://gitea.com/gitea/blog) announcing the release.
356426

357427
## Copyright
358428

359429
Code that you contribute should use the standard copyright header:
360430

361431
```
362-
// Copyright 2020 The Gitea Authors. All rights reserved.
432+
// Copyright 2022 The Gitea Authors. All rights reserved.
363433
// Use of this source code is governed by a MIT-style
364434
// license that can be found in the LICENSE file.
365435
```

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,13 @@ clean:
231231

232232
.PHONY: fmt
233233
fmt:
234-
@hash xgogofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
234+
@echo "Running gitea-fmt(with gofmt)..."
235+
@$(GO) run build/code-batch-process.go gitea-fmt -s -w '{file-list}'
236+
@echo "Running gofumpt"
237+
@hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
235238
$(GO) install mvdan.cc/gofumpt@latest; \
236239
fi
237-
gofumpt -w -l -extra -lang 1.16 .
240+
@gofumpt -w -l -extra -lang 1.16 .
238241

239242
.PHONY: vet
240243
vet:

docker/rootless/usr/local/bin/gitea

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ for i in "$@"; do
3232
done
3333

3434
if [ -z "$APP_INI_SET" ]; then
35-
CONF_ARG="-c \"$APP_INI\""
35+
CONF_ARG="-c \"${GITEA_APP_INI:-$APP_INI}\""
3636
fi
3737

3838

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.15.10
21+
version: 1.16.0
2222
minGoVersion: 1.16
2323
goVersion: 1.17
2424
minNodeVersion: 12.17

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ require (
113113
github.com/urfave/cli v1.22.5
114114
github.com/xanzy/go-gitlab v0.50.1
115115
github.com/yohcop/openid-go v1.0.0
116-
github.com/yuin/goldmark v1.4.0
116+
github.com/yuin/goldmark v1.4.4
117117
github.com/yuin/goldmark-highlighting v0.0.0-20210516132338-9216f9c5aa01
118118
github.com/yuin/goldmark-meta v1.0.0
119119
go.etcd.io/bbolt v1.3.6 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,8 +1170,8 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
11701170
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
11711171
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
11721172
github.com/yuin/goldmark v1.3.6/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
1173-
github.com/yuin/goldmark v1.4.0 h1:OtISOGfH6sOWa1/qXqqAiOIAO6Z5J3AEAE18WAq6BiQ=
1174-
github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
1173+
github.com/yuin/goldmark v1.4.4 h1:zNWRjYUW32G9KirMXYHQHVNFkXvMI7LpgNW2AgYAoIs=
1174+
github.com/yuin/goldmark v1.4.4/go.mod h1:rmuwmfZ0+bvzB24eSC//bk1R1Zp3hM0OXYv/G2LIilg=
11751175
github.com/yuin/goldmark-highlighting v0.0.0-20210516132338-9216f9c5aa01 h1:0SJnXjE4jDClMW6grE0xpNhwpqbPwkBTn8zpVw5C0SI=
11761176
github.com/yuin/goldmark-highlighting v0.0.0-20210516132338-9216f9c5aa01/go.mod h1:TwKQPa5XkCCRC2GRZ5wtfNUTQ2+9/i19mGRijFeJ4BE=
11771177
github.com/yuin/goldmark-meta v1.0.0 h1:ScsatUIT2gFS6azqzLGUjgOnELsBOxMXerM3ogdJhAM=

integrations/api_helper_for_declarative_test.go

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"context"
99
"fmt"
1010
"net/http"
11+
"net/http/httptest"
1112
"net/url"
1213
"os"
1314
"testing"
@@ -262,23 +263,26 @@ func doAPIMergePullRequest(ctx APITestContext, owner, repo string, index int64)
262263
return func(t *testing.T) {
263264
urlStr := fmt.Sprintf("/api/v1/repos/%s/%s/pulls/%d/merge?token=%s",
264265
owner, repo, index, ctx.Token)
265-
req := NewRequestWithJSON(t, http.MethodPost, urlStr, &forms.MergePullRequestForm{
266-
MergeMessageField: "doAPIMergePullRequest Merge",
267-
Do: string(repo_model.MergeStyleMerge),
268-
})
269266

270-
resp := ctx.Session.MakeRequest(t, req, NoExpectedStatus)
267+
var req *http.Request
268+
var resp *httptest.ResponseRecorder
271269

272-
if resp.Code == http.StatusMethodNotAllowed {
273-
err := api.APIError{}
274-
DecodeJSON(t, resp, &err)
275-
assert.EqualValues(t, "Please try again later", err.Message)
276-
queue.GetManager().FlushAll(context.Background(), 5*time.Second)
270+
for i := 0; i < 6; i++ {
277271
req = NewRequestWithJSON(t, http.MethodPost, urlStr, &forms.MergePullRequestForm{
278272
MergeMessageField: "doAPIMergePullRequest Merge",
279273
Do: string(repo_model.MergeStyleMerge),
280274
})
275+
281276
resp = ctx.Session.MakeRequest(t, req, NoExpectedStatus)
277+
278+
if resp.Code != http.StatusMethodNotAllowed {
279+
break
280+
}
281+
err := api.APIError{}
282+
DecodeJSON(t, resp, &err)
283+
assert.EqualValues(t, "Please try again later", err.Message)
284+
queue.GetManager().FlushAll(context.Background(), 5*time.Second)
285+
<-time.After(1 * time.Second)
282286
}
283287

284288
expected := ctx.ExpectedCode

integrations/mssql.ini.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ PROVIDER_CONFIG = integrations/gitea-integration-mssql/data/sessions
8282

8383
[log]
8484
MODE = test,file
85-
ROOT_PATH = mssql-log
85+
ROOT_PATH = {{REPO_TEST_DIR}}mssql-log
8686
ROUTER = ,
8787
XORM = file
8888
ENABLE_SSH_LOG = true

integrations/mysql.ini.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ PROVIDER_CONFIG = integrations/gitea-integration-mysql/data/sessions
101101

102102
[log]
103103
MODE = test,file
104-
ROOT_PATH = mysql-log
104+
ROOT_PATH = {{REPO_TEST_DIR}}mysql-log
105105
ROUTER = ,
106106
XORM = file
107107
ENABLE_SSH_LOG = true

integrations/mysql8.ini.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ PROVIDER_CONFIG = integrations/gitea-integration-mysql8/data/sessions
7979

8080
[log]
8181
MODE = test,file
82-
ROOT_PATH = mysql8-log
82+
ROOT_PATH = {{REPO_TEST_DIR}}mysql8-log
8383
ROUTER = ,
8484
XORM = file
8585
ENABLE_SSH_LOG = true

integrations/pgsql.ini.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ PROVIDER_CONFIG = integrations/gitea-integration-pgsql/data/sessions
8383

8484
[log]
8585
MODE = test,file
86-
ROOT_PATH = pgsql-log
86+
ROOT_PATH = {{REPO_TEST_DIR}}pgsql-log
8787
ROUTER = ,
8888
XORM = file
8989
ENABLE_SSH_LOG = true

integrations/sqlite.ini.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ PROVIDER_CONFIG = integrations/gitea-integration-sqlite/data/sessions
7878

7979
[log]
8080
MODE = test,file
81-
ROOT_PATH = sqlite-log
81+
ROOT_PATH = {{REPO_TEST_DIR}}sqlite-log
8282
ROUTER = ,
8383
XORM = file
8484
ENABLE_SSH_LOG = true

0 commit comments

Comments
 (0)