Skip to content

Commit

Permalink
Merge remote-tracking branch 'giteaofficial/main'
Browse files Browse the repository at this point in the history
* 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)
  ...
  • Loading branch information
zjjhot committed Feb 2, 2022
2 parents a3eff2e + 76e3111 commit 8503c0b
Show file tree
Hide file tree
Showing 134 changed files with 1,759 additions and 848 deletions.
12 changes: 8 additions & 4 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ steps:

- name: coverage-codecov
pull: always
image: plugins/codecov
image: woodpeckerci/plugin-codecov:next-alpine
settings:
files:
- coverage.all
Expand Down Expand Up @@ -567,7 +567,7 @@ steps:
settings:
acl: public-read
bucket: gitea-artifacts
endpoint: https://storage.gitea.io
endpoint: https://ams3.digitaloceanspaces.com
path_style: true
source: "dist/release/*"
strip_prefix: dist/release/
Expand All @@ -588,7 +588,7 @@ steps:
settings:
acl: public-read
bucket: gitea-artifacts
endpoint: https://storage.gitea.io
endpoint: https://ams3.digitaloceanspaces.com
path_style: true
source: "dist/release/*"
strip_prefix: dist/release/
Expand Down Expand Up @@ -641,6 +641,7 @@ steps:
environment:
GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
TAGS: bindata sqlite sqlite_unlock_notify
depends_on: [fetch-tags]

- name: gpg-sign
pull: always
Expand All @@ -656,14 +657,15 @@ steps:
from_secret: gpgsign_key
GPGSIGN_PASSPHRASE:
from_secret: gpgsign_passphrase
depends_on: [static]

- name: release-tag
pull: always
image: woodpeckerci/plugin-s3:latest
settings:
acl: public-read
bucket: gitea-artifacts
endpoint: https://storage.gitea.io
endpoint: https://ams3.digitaloceanspaces.com
path_style: true
source: "dist/release/*"
strip_prefix: dist/release/
Expand All @@ -673,6 +675,7 @@ steps:
from_secret: aws_access_key_id
AWS_SECRET_ACCESS_KEY:
from_secret: aws_secret_access_key
depends_on: [gpg-sign]

- name: github
pull: always
Expand All @@ -683,6 +686,7 @@ steps:
environment:
GITHUB_TOKEN:
from_secret: github_token
depends_on: [gpg-sign]

---
kind: pipeline
Expand Down
4 changes: 0 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ env:

globals:
__webpack_public_path__: true
CodeMirror: false
Dropzone: false
SimpleMDE: false

settings:
html/html-extensions: [".tmpl"]
Expand All @@ -34,7 +31,6 @@ overrides:
- files: ["web_src/**/*.js", "web_src/**/*.vue", "templates/**/*.tmpl"]
env:
browser: true
jquery: true
node: false
- files: ["templates/**/*.tmpl"]
rules:
Expand Down
29 changes: 27 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ This changelog goes through all the changes that have been made in each release
without substantial changes to our git log; to see the highlights of what has
been added to each release, please refer to the [blog](https://blog.gitea.io).

## [1.16.0-rc1](https://github.com/go-gitea/gitea/releases/tag/v1.16.0-rc1) - 2022-01-19
## [1.16.0](https://github.com/go-gitea/gitea/releases/tag/v1.16.0) - 2022-01-30

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

## [1.15.11](https://github.com/go-gitea/gitea/releases/tag/v1.15.11) - 2022-01-29

* SECURITY
* Only view milestones from current repo (#18414) (#18418)
* BUGFIXES
* Fix broken when no commits and default branch is not master (#18422) (#18424)
* Fix commit's time (#18375) (#18409)
* Fix restore without topic failure (#18387) (#18401)
* Fix mermaid import in 1.15 (it uses ESModule now) (#18382)
* Update to go/text 0.3.7 (#18336)
* MISC
* Upgrade EasyMDE to 2.16.1 (#18278) (#18279)

## [1.15.10](https://github.com/go-gitea/gitea/releases/tag/v1.15.10) - 2022-01-14

* BUGFIXES
Expand Down
78 changes: 74 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,15 @@ Some of the key points:
if that is not related to your PR, please make *another* PR for that.
* Split big pull requests into multiple small ones. An incremental change
will be faster to review than a huge PR.
* Use the first comment as a summary explainer of your PR and you should keep this up-to-date as the PR evolves.

If your PR could cause a breaking change you must add a BREAKING section to this comment e.g.:

```
## :warning: BREAKING :warning:
```

To explain how this could affect users and how to mitigate these changes.

## Styleguide

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


An endpoint which changes/edits an object expects all fields to be optional (except ones to identify the object, which are required).

### Endpoints returning lists should
* support pagination (`page` & `limit` options in query)
* set `X-Total-Count` header via **SetTotalCountHeader** ([example](https://github.com/go-gitea/gitea/blob/7aae98cc5d4113f1e9918b7ee7dd09f67c189e3e/routers/api/v1/repo/issue.go#L444))

## Large Character Comments

Throughout the codebase there are large-text comments for sections of code, e.g.:

```go
// __________ .__
// \______ \ _______ _|__| ______ _ __
// | _// __ \ \/ / |/ __ \ \/ \/ /
// | | \ ___/\ /| \ ___/\ /
// |____|_ /\___ >\_/ |__|\___ >\/\_/
// \/ \/ \/
```

These were created using the `figlet` tool with the `graffiti` font.

A simple way of creating these is to use the following:

```bash
figlet -f graffiti Review | sed -e's+^+// +' - | xclip -sel clip -in
```

## Backports and Frontports

Occasionally backports of PRs are required.

The backported PR title should be:

```
Title of backported PR (#ORIGINAL_PR_NUMBER)
```

The first two lines of the summary of the backporting PR should be:

```
Backport #ORIGINAL_PR_NUMBER
```

with the rest of the summary matching the original PR. Similarly for frontports

---

The below is a script that may be helpful in creating backports. YMMV.

```bash
#!/bin/sh
PR="$1"
SHA="$2"
VERSION="$3"

if [ -z "$SHA" ]; then
SHA=$(gh api /repos/go-gitea/gitea/pulls/$PR -q '.merge_commit_sha')
fi

if [ -z "$VERSION" ]; then
VERSION="v1.16"
fi

echo git checkout origin/release/"$VERSION" -b backport-$PR-$VERSION
git checkout origin/release/"$VERSION" -b backport-$PR-$VERSION
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

```

## Developer Certificate of Origin (DCO)

Expand Down Expand Up @@ -351,15 +421,15 @@ be reviewed by two maintainers and must pass the automatic tests.
* If it is bugfix version create PR for changelog on branch `release/v$vmaj.$vmin` and wait till it is reviewed and merged.
* 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`.
* 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.)
* If needed send PR for changelog on branch `main`.
* 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.
* Send PR to [blog repository](https://gitea.com/gitea/blog) announcing the release.

## Copyright

Code that you contribute should use the standard copyright header:

```
// Copyright 2020 The Gitea Authors. All rights reserved.
// Copyright 2022 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
```
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,13 @@ clean:

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

.PHONY: vet
vet:
Expand Down
2 changes: 1 addition & 1 deletion docker/rootless/usr/local/bin/gitea
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ for i in "$@"; do
done

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


Expand Down
2 changes: 1 addition & 1 deletion docs/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ params:
description: Git with a cup of tea
author: The Gitea Authors
website: https://docs.gitea.io
version: 1.15.10
version: 1.16.0
minGoVersion: 1.16
goVersion: 1.17
minNodeVersion: 12.17
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ require (
github.com/urfave/cli v1.22.5
github.com/xanzy/go-gitlab v0.50.1
github.com/yohcop/openid-go v1.0.0
github.com/yuin/goldmark v1.4.0
github.com/yuin/goldmark v1.4.4
github.com/yuin/goldmark-highlighting v0.0.0-20210516132338-9216f9c5aa01
github.com/yuin/goldmark-meta v1.0.0
go.etcd.io/bbolt v1.3.6 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1170,8 +1170,8 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.6/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.0 h1:OtISOGfH6sOWa1/qXqqAiOIAO6Z5J3AEAE18WAq6BiQ=
github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.4 h1:zNWRjYUW32G9KirMXYHQHVNFkXvMI7LpgNW2AgYAoIs=
github.com/yuin/goldmark v1.4.4/go.mod h1:rmuwmfZ0+bvzB24eSC//bk1R1Zp3hM0OXYv/G2LIilg=
github.com/yuin/goldmark-highlighting v0.0.0-20210516132338-9216f9c5aa01 h1:0SJnXjE4jDClMW6grE0xpNhwpqbPwkBTn8zpVw5C0SI=
github.com/yuin/goldmark-highlighting v0.0.0-20210516132338-9216f9c5aa01/go.mod h1:TwKQPa5XkCCRC2GRZ5wtfNUTQ2+9/i19mGRijFeJ4BE=
github.com/yuin/goldmark-meta v1.0.0 h1:ScsatUIT2gFS6azqzLGUjgOnELsBOxMXerM3ogdJhAM=
Expand Down
24 changes: 14 additions & 10 deletions integrations/api_helper_for_declarative_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"context"
"fmt"
"net/http"
"net/http/httptest"
"net/url"
"os"
"testing"
Expand Down Expand Up @@ -262,23 +263,26 @@ func doAPIMergePullRequest(ctx APITestContext, owner, repo string, index int64)
return func(t *testing.T) {
urlStr := fmt.Sprintf("/api/v1/repos/%s/%s/pulls/%d/merge?token=%s",
owner, repo, index, ctx.Token)
req := NewRequestWithJSON(t, http.MethodPost, urlStr, &forms.MergePullRequestForm{
MergeMessageField: "doAPIMergePullRequest Merge",
Do: string(repo_model.MergeStyleMerge),
})

resp := ctx.Session.MakeRequest(t, req, NoExpectedStatus)
var req *http.Request
var resp *httptest.ResponseRecorder

if resp.Code == http.StatusMethodNotAllowed {
err := api.APIError{}
DecodeJSON(t, resp, &err)
assert.EqualValues(t, "Please try again later", err.Message)
queue.GetManager().FlushAll(context.Background(), 5*time.Second)
for i := 0; i < 6; i++ {
req = NewRequestWithJSON(t, http.MethodPost, urlStr, &forms.MergePullRequestForm{
MergeMessageField: "doAPIMergePullRequest Merge",
Do: string(repo_model.MergeStyleMerge),
})

resp = ctx.Session.MakeRequest(t, req, NoExpectedStatus)

if resp.Code != http.StatusMethodNotAllowed {
break
}
err := api.APIError{}
DecodeJSON(t, resp, &err)
assert.EqualValues(t, "Please try again later", err.Message)
queue.GetManager().FlushAll(context.Background(), 5*time.Second)
<-time.After(1 * time.Second)
}

expected := ctx.ExpectedCode
Expand Down
2 changes: 1 addition & 1 deletion integrations/mssql.ini.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ PROVIDER_CONFIG = integrations/gitea-integration-mssql/data/sessions

[log]
MODE = test,file
ROOT_PATH = mssql-log
ROOT_PATH = {{REPO_TEST_DIR}}mssql-log
ROUTER = ,
XORM = file
ENABLE_SSH_LOG = true
Expand Down
2 changes: 1 addition & 1 deletion integrations/mysql.ini.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ PROVIDER_CONFIG = integrations/gitea-integration-mysql/data/sessions

[log]
MODE = test,file
ROOT_PATH = mysql-log
ROOT_PATH = {{REPO_TEST_DIR}}mysql-log
ROUTER = ,
XORM = file
ENABLE_SSH_LOG = true
Expand Down
2 changes: 1 addition & 1 deletion integrations/mysql8.ini.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ PROVIDER_CONFIG = integrations/gitea-integration-mysql8/data/sessions

[log]
MODE = test,file
ROOT_PATH = mysql8-log
ROOT_PATH = {{REPO_TEST_DIR}}mysql8-log
ROUTER = ,
XORM = file
ENABLE_SSH_LOG = true
Expand Down
2 changes: 1 addition & 1 deletion integrations/pgsql.ini.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ PROVIDER_CONFIG = integrations/gitea-integration-pgsql/data/sessions

[log]
MODE = test,file
ROOT_PATH = pgsql-log
ROOT_PATH = {{REPO_TEST_DIR}}pgsql-log
ROUTER = ,
XORM = file
ENABLE_SSH_LOG = true
Expand Down
2 changes: 1 addition & 1 deletion integrations/sqlite.ini.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ PROVIDER_CONFIG = integrations/gitea-integration-sqlite/data/sessions

[log]
MODE = test,file
ROOT_PATH = sqlite-log
ROOT_PATH = {{REPO_TEST_DIR}}sqlite-log
ROUTER = ,
XORM = file
ENABLE_SSH_LOG = true
Expand Down
Loading

0 comments on commit 8503c0b

Please sign in to comment.