Skip to content

Commit b9c7353

Browse files
committed
Merge branch 'main' into deps-api
2 parents 0dc9bbc + 67d7388 commit b9c7353

File tree

485 files changed

+10650
-5872
lines changed

Some content is hidden

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

485 files changed

+10650
-5872
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Please check the following:
44
55
1. Make sure you are targeting the `main` branch, pull requests on release branches are only allowed for bug fixes.
6-
2. Read contributing guidelines: https://github.com/go-gitea/gitea/blob/master/CONTRIBUTING.md
6+
2. Read contributing guidelines: https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md
77
3. Describe what your pull request does and which issue you're targeting (if any)
88
99
-->

.golangci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ linters:
1616
- gocritic
1717
- bidichk
1818
- ineffassign
19+
- revive
1920
enable-all: false
2021
disable-all: true
2122
fast: false
@@ -28,6 +29,34 @@ linters-settings:
2829
disabled-checks:
2930
- ifElseChain
3031
- singleCaseSwitch # Every time this occurred in the code, there was no other way.
32+
revive:
33+
ignore-generated-header: false
34+
severity: warning
35+
confidence: 0.8
36+
errorCode: 1
37+
warningCode: 1
38+
rules:
39+
- name: blank-imports
40+
- name: context-as-argument
41+
- name: context-keys-type
42+
- name: dot-imports
43+
- name: error-return
44+
- name: error-strings
45+
- name: error-naming
46+
- name: exported
47+
- name: if-return
48+
- name: increment-decrement
49+
- name: var-naming
50+
- name: var-declaration
51+
- name: package-comments
52+
- name: range
53+
- name: receiver-naming
54+
- name: time-naming
55+
- name: unexported-return
56+
- name: indent-error-flow
57+
- name: errorf
58+
- name: duplicated-imports
59+
- name: modifies-value-receiver
3160

3261
issues:
3362
exclude-rules:

.revive.toml

Lines changed: 0 additions & 26 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@ 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.15.9](https://github.com/go-gitea/gitea/releases/tag/v1.15.9) - 2021-12-30
8+
9+
* BUGFIXES
10+
* Fix wrong redirect on org labels (#18128) (#18134)
11+
* Fix: unstable sort skips/duplicates issues across pages (#18094) (#18095)
12+
* Revert "Fix delete u2f keys bug (#18042)" (#18107)
13+
* Migrating wiki don't require token, so we should move it out of the require form (#17645) (#18104)
14+
* Prevent NPE if gitea uploader fails to open url (#18080) (#18101)
15+
* Reset locale on login (#17734) (#18100)
16+
* Correctly handle failed migrations (#17575) (#18099)
17+
* Instead of using routerCtx just escape the url before routing (#18086) (#18098)
18+
* Quote references to the user table in consistency checks (#18072) (#18073)
19+
* Add NotFound handler (#18062) (#18067)
20+
* Ensure that git repository is closed before transfer (#18049) (#18057)
21+
* Use common sessioner for API and web routes (#18114)
22+
* TRANSLATION
23+
* Fix code search result hint on zh-CN (#18053)
24+
725
## [1.15.8](https://github.com/go-gitea/gitea/releases/tag/v1.15.8) - 2021-12-20
826

927
* BUGFIXES
@@ -90,7 +108,7 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
90108
* Fix unwanted team review request deletion (#17257) (#17264)
91109
* Fix broken Activities link in team dashboard (#17255) (#17258)
92110
* API pull's head/base have correct permission(#17214) (#17245)
93-
* Fix stange behavior of DownloadPullDiffOrPatch in incorect index (#17223) (#17227)
111+
* Fix strange behavior of DownloadPullDiffOrPatch in incorrect index (#17223) (#17227)
94112
* Upgrade xorm to v1.2.5 (#17177) (#17188)
95113
* Fix missing repo link in issue/pull assigned emails (#17183) (#17184)
96114
* Fix bug of get context user (#17169) (#17172)

CONTRIBUTING.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ Here's how to run the test suite:
8181
|``make lint-frontend`` | lint frontend files |
8282
|``make lint-backend`` | lint backend files |
8383

84-
- run test code (Suggest run in linux)
84+
- run test code (Suggest run in Linux)
8585

8686
| | |
8787
| :------------------------------------- | :----------------------------------------------- |
8888
|``make test[\#TestSpecificName]`` | run unit test |
89-
|``make test-sqlite[\#TestSpecificName]``| run [integration](integrations) test for sqlite |
90-
|[More detail message about integrations](integrations/README.md) |
89+
|``make test-sqlite[\#TestSpecificName]``| run [integration](integrations) test for SQLite |
90+
|[More details about integrations](integrations/README.md) |
9191

9292
## Vendoring
9393

@@ -106,7 +106,7 @@ You can find more information on how to get started with it on the [Modules Wiki
106106
## Translation
107107

108108
We do all translation work inside [Crowdin](https://crowdin.com/project/gitea).
109-
The only translation that is maintained in this git repository is
109+
The only translation that is maintained in this Git repository is
110110
[`en_US.ini`](https://github.com/go-gitea/gitea/blob/master/options/locale/locale_en-US.ini)
111111
and is synced regularly to Crowdin. Once a translation has reached
112112
A SATISFACTORY PERCENTAGE it will be synced back into this repo and
@@ -157,7 +157,7 @@ import (
157157

158158
## Design guideline
159159

160-
To maintain understandable code and avoid circular dependencies it is important to have a good structure of the code. The gitea code is divided into the following parts:
160+
To maintain understandable code and avoid circular dependencies it is important to have a good structure of the code. The Gitea code is divided into the following parts:
161161

162162
- **integration:** Integrations tests
163163
- **models:** Contains the data structures used by xorm to construct database tables. It also contains supporting functions to query and update the database. Dependencies to other code in Gitea should be avoided although some modules might be needed (for example for logging).
@@ -223,7 +223,7 @@ Additionally you could add a line at the end of your commit message.
223223
Signed-off-by: Joe Smith <[email protected]>
224224
```
225225

226-
If you set your `user.name` and `user.email` git configs, you can add the
226+
If you set your `user.name` and `user.email` Git configs, you can add the
227227
line to the end of your commit automatically with `git commit -s`.
228228

229229
We assume in good faith that the information you provide is legally binding.
@@ -268,7 +268,7 @@ to the maintainers team. If a maintainer is inactive for more than 3
268268
months and forgets to leave the maintainers team, the owners may move
269269
him or her from the maintainers team to the advisors team.
270270
For security reasons, Maintainers should use 2FA for their accounts and
271-
if possible provide gpg signed commits.
271+
if possible provide GPG signed commits.
272272
https://help.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/
273273
https://help.github.com/articles/signing-commits-with-gpg/
274274

@@ -299,6 +299,11 @@ and lead the development of Gitea.
299299
To honor the past owners, here's the history of the owners and the time
300300
they served:
301301

302+
* 2022-01-01 ~ 2022-12-31 - https://github.com/go-gitea/gitea/issues/17872
303+
* [Lunny Xiao](https://gitea.com/lunny) <[email protected]>
304+
* [Matti Ranta](https://gitea.com/techknowlogick) <[email protected]>
305+
* [Andrew Thornton](https://gitea.com/zeripath) <[email protected]>
306+
302307
* 2021-01-01 ~ 2021-12-31 - https://github.com/go-gitea/gitea/issues/13801
303308
* [Lunny Xiao](https://gitea.com/lunny) <[email protected]>
304309
* [Lauris Bukšis-Haberkorns](https://gitea.com/lafriks) <[email protected]>
@@ -326,28 +331,28 @@ they served:
326331

327332
## Versions
328333

329-
Gitea has the `master` branch as a tip branch and has version branches
334+
Gitea has the `main` branch as a tip branch and has version branches
330335
such as `release/v0.9`. `release/v0.9` is a release branch and we will
331336
tag `v0.9.0` for binary download. If `v0.9.0` has bugs, we will accept
332337
pull requests on the `release/v0.9` branch and publish a `v0.9.1` tag,
333-
after bringing the bug fix also to the master branch.
338+
after bringing the bug fix also to the main branch.
334339

335-
Since the `master` branch is a tip version, if you wish to use Gitea
340+
Since the `main` branch is a tip version, if you wish to use Gitea
336341
in production, please download the latest release tag version. All the
337342
branches will be protected via GitHub, all the PRs to every branch must
338343
be reviewed by two maintainers and must pass the automatic tests.
339344

340345
## Releasing Gitea
341346

342347
* Let $vmaj, $vmin and $vpat be Major, Minor and Patch version numbers, $vpat should be rc1, rc2, 0, 1, ...... $vmaj.$vmin will be kept the same as milestones on github or gitea in future.
343-
* Before releasing, confirm all the version's milestone issues or PRs has been resolved. Then discuss the release on discord channel #maintainers and get agreed with almost all the owners and mergers. Or you can declare the version and if nobody against in about serval hours.
344-
* If this is a big version first you have to create PR for changelog on branch `master` with PRs with label `changelog` and after it has been merged do following steps:
348+
* Before releasing, confirm all the version's milestone issues or PRs has been resolved. Then discuss the release on Discord channel #maintainers and get agreed with almost all the owners and mergers. Or you can declare the version and if nobody against in about serval hours.
349+
* If this is a big version first you have to create PR for changelog on branch `main` with PRs with label `changelog` and after it has been merged do following steps:
345350
* Create `-dev` tag as `git tag -s -F release.notes v$vmaj.$vmin.0-dev` and push the tag as `git push origin v$vmaj.$vmin.0-dev`.
346351
* When CI has finished building tag then you have to create a new branch named `release/v$vmaj.$vmin`
347352
* If it is bugfix version create PR for changelog on branch `release/v$vmaj.$vmin` and wait till it is reviewed and merged.
348353
* 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`.
349-
* And then push the tag as `git push origin v$vmaj.$vmin.$`. Drone CI will automatically created a release and upload all the compiled binary. (But currently it didn't add the release notes automatically. Maybe we should fix that.)
350-
* If needed send PR for changelog on branch `master`.
354+
* 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.)
355+
* If needed send PR for changelog on branch `main`.
351356
* Send PR to [blog repository](https://gitea.com/gitea/blog) announcing the release.
352357

353358
## Copyright

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ Steven Kriegler <[email protected]> (@justusbunsi)
4545
Jimmy Praet <[email protected]> (@jpraet)
4646
Leon Hofmeister <[email protected]> (@delvh)
4747
Gusted <[email protected]) (@Gusted)
48+
singuliere <[email protected]> (@singuliere)

Makefile

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,6 @@ help:
186186
@echo " - generate-swagger generate the swagger spec from code comments"
187187
@echo " - swagger-validate check if the swagger spec is valid"
188188
@echo " - golangci-lint run golangci-lint linter"
189-
@echo " - revive run revive linter"
190-
@echo " - misspell check for misspellings"
191189
@echo " - vet examines Go source code and reports suspicious constructs"
192190
@echo " - test[\#TestSpecificName] run unit test"
193191
@echo " - test-sqlite[\#TestSpecificName] run integration test for sqlite"
@@ -239,7 +237,6 @@ fmt:
239237
.PHONY: vet
240238
vet:
241239
@echo "Running go vet..."
242-
@$(GO) vet $(GO_PACKAGES)
243240
@GOOS= GOARCH= $(GO) build -mod=vendor code.gitea.io/gitea-vet
244241
@$(GO) vet -vettool=gitea-vet $(GO_PACKAGES)
245242

@@ -281,29 +278,6 @@ errcheck:
281278
@echo "Running errcheck..."
282279
@errcheck $(GO_PACKAGES)
283280

284-
.PHONY: revive
285-
revive:
286-
@hash revive > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
287-
$(GO) install github.com/mgechev/[email protected]; \
288-
fi
289-
@revive -config .revive.toml -exclude=./vendor/... ./...
290-
291-
.PHONY: misspell-check
292-
misspell-check:
293-
@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
294-
$(GO) install github.com/client9/misspell/cmd/[email protected]; \
295-
fi
296-
@echo "Running misspell-check..."
297-
@$(GO) run build/code-batch-process.go misspell -error -i unknwon '{file-list}'
298-
299-
.PHONY: misspell
300-
misspell:
301-
@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
302-
$(GO) install github.com/client9/misspell/cmd/[email protected]; \
303-
fi
304-
@echo "Running go misspell..."
305-
@$(GO) run build/code-batch-process.go misspell -w -i unknwon '{file-list}'
306-
307281
.PHONY: fmt-check
308282
fmt-check:
309283
# get all go files and run go fmt on them
@@ -321,7 +295,7 @@ checks: checks-frontend checks-backend
321295
checks-frontend: svg-check
322296

323297
.PHONY: checks-backend
324-
checks-backend: misspell-check test-vendor swagger-check swagger-validate
298+
checks-backend: test-vendor swagger-check swagger-validate
325299

326300
.PHONY: lint
327301
lint: lint-frontend lint-backend
@@ -333,7 +307,7 @@ lint-frontend: node_modules
333307
npx editorconfig-checker templates
334308

335309
.PHONY: lint-backend
336-
lint-backend: golangci-lint revive vet
310+
lint-backend: golangci-lint vet
337311

338312
.PHONY: watch
339313
watch:

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
<a href="https://crowdin.com/project/gitea" title="Crowdin">
3737
<img src="https://badges.crowdin.net/gitea/localized.svg">
3838
</a>
39-
<a href="https://www.tickgit.com/browse?repo=github.com/go-gitea/gitea" title="TODOs">
40-
<img src="https://badgen.net/https/api.tickgit.com/badgen/github.com/go-gitea/gitea">
39+
<a href="https://www.tickgit.com/browse?repo=github.com/go-gitea/gitea&branch=main" title="TODOs">
40+
<img src="https://badgen.net/https/api.tickgit.com/badgen/github.com/go-gitea/gitea/main">
4141
</a>
4242
<a href="https://www.bountysource.com/teams/gitea" title="Bountysource">
4343
<img src="https://img.shields.io/bountysource/team/gitea/activity">
@@ -67,7 +67,7 @@ From the root of the source tree, run:
6767

6868
TAGS="bindata" make build
6969

70-
or if sqlite support is required:
70+
or if SQLite support is required:
7171

7272
TAGS="bindata sqlite sqlite_unlock_notify" make build
7373

README_ZH.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
<a href="https://crowdin.com/project/gitea" title="Crowdin">
3737
<img src="https://badges.crowdin.net/gitea/localized.svg">
3838
</a>
39-
<a href="https://www.tickgit.com/browse?repo=github.com/go-gitea/gitea" title="TODOs">
40-
<img src="https://badgen.net/https/api.tickgit.com/badgen/github.com/go-gitea/gitea">
39+
<a href="https://www.tickgit.com/browse?repo=github.com/go-gitea/gitea&branch=main" title="TODOs">
40+
<img src="https://badgen.net/https/api.tickgit.com/badgen/github.com/go-gitea/gitea/main">
4141
</a>
4242
<a href="https://img.shields.io/bountysource/team/gitea" title="Bountysource">
4343
<img src="https://img.shields.io/bountysource/team/gitea/activity">

build/generate-bindata.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,15 @@ func needsUpdate(dir string, filename string) (bool, []byte) {
5858
}
5959

6060
func main() {
61-
if len(os.Args) != 4 {
61+
if len(os.Args) < 4 {
6262
log.Fatal("Insufficient number of arguments. Need: directory packageName filename")
6363
}
6464

6565
dir, packageName, filename := os.Args[1], os.Args[2], os.Args[3]
66+
var useGlobalModTime bool
67+
if len(os.Args) == 5 {
68+
useGlobalModTime, _ = strconv.ParseBool(os.Args[4])
69+
}
6670

6771
update, newHash := needsUpdate(dir, filename)
6872

@@ -74,10 +78,11 @@ func main() {
7478
fmt.Printf("generating bindata for %s\n", packageName)
7579
var fsTemplates http.FileSystem = http.Dir(dir)
7680
err := vfsgen.Generate(fsTemplates, vfsgen.Options{
77-
PackageName: packageName,
78-
BuildTags: "bindata",
79-
VariableName: "Assets",
80-
Filename: filename,
81+
PackageName: packageName,
82+
BuildTags: "bindata",
83+
VariableName: "Assets",
84+
Filename: filename,
85+
UseGlobalModTime: useGlobalModTime,
8186
})
8287
if err != nil {
8388
log.Fatalf("%v\n", err)

0 commit comments

Comments
 (0)