Skip to content

Commit f98f234

Browse files
authored
Merge branch 'main' into main
2 parents 1905d60 + d2fac63 commit f98f234

File tree

129 files changed

+2025
-468
lines changed

Some content is hidden

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

129 files changed

+2025
-468
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
-->

.revive.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ warningCode = 1
2424
[rule.indent-error-flow]
2525
[rule.errorf]
2626
[rule.duplicated-imports]
27+
[rule.modifies-value-receiver]

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@ 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.8](https://github.com/go-gitea/gitea/releases/tag/v1.15.8) - 2021-12-20
8+
9+
* BUGFIXES
10+
* Move POST /{username}/action/{action} to simply POST /{username} (#18045) (#18046)
11+
* Fix delete u2f keys bug (#18040) (#18042)
12+
* Reset Session ID on login (#18018) (#18041)
13+
* Prevent off-by-one error on comments on newly appended lines (#18029) (#18035)
14+
* Stop printing 03d after escaped characters in logs (#18030) (#18034)
15+
* Reset locale on login (#18023) (#18025)
16+
* Fix reset password email template (#17025) (#18022)
17+
* Fix outType on gitea dump (#18000) (#18016)
18+
* Ensure complexity, minlength and isPwned are checked on password setting (#18005) (#18015)
19+
* Fix rename notification bug (#18011)
20+
* Prevent double decoding of % in url params (#17997) (#18001)
21+
* Prevent hang in git cat-file if the repository is not a valid repository (Partial #17991) (#17992)
22+
* Prevent deadlock in create issue (#17970) (#17982)
23+
* TESTING
24+
* Use non-expiring key. (#17984) (#17985)
25+
726
## [1.15.7](https://github.com/go-gitea/gitea/releases/tag/v1.15.7) - 2021-12-01
827

928
* ENHANCEMENTS

CONTRIBUTING.md

Lines changed: 14 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

@@ -326,28 +326,28 @@ they served:
326326

327327
## Versions
328328

329-
Gitea has the `master` branch as a tip branch and has version branches
329+
Gitea has the `main` branch as a tip branch and has version branches
330330
such as `release/v0.9`. `release/v0.9` is a release branch and we will
331331
tag `v0.9.0` for binary download. If `v0.9.0` has bugs, we will accept
332332
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.
333+
after bringing the bug fix also to the main branch.
334334

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

340340
## Releasing Gitea
341341

342342
* 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:
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 `main` with PRs with label `changelog` and after it has been merged do following steps:
345345
* 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`.
346346
* When CI has finished building tag then you have to create a new branch named `release/v$vmaj.$vmin`
347347
* If it is bugfix version create PR for changelog on branch `release/v$vmaj.$vmin` and wait till it is reviewed and merged.
348348
* 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`.
349+
* 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.)
350+
* If needed send PR for changelog on branch `main`.
351351
* Send PR to [blog repository](https://gitea.com/gitea/blog) announcing the release.
352352

353353
## Copyright

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
###################################
3-
#Build stage
4-
FROM golang:1.17-alpine3.13 AS build-env
3+
#Build stage - temporarily using techknowlogick image until we upgrade to latest official alpine/go image
4+
FROM techknowlogick/go:1.17-alpine3.13 AS build-env
55

66
ARG GOPROXY
77
ENV GOPROXY ${GOPROXY:-direct}

Dockerfile.rootless

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
###################################
3-
#Build stage
4-
FROM golang:1.17-alpine3.13 AS build-env
3+
#Build stage - temporarily using techknowlogick image until we upgrade to latest official alpine/go image
4+
FROM techknowlogick/go:1.17-alpine3.13 AS build-env
55

66
ARG GOPROXY
77
ENV GOPROXY ${GOPROXY:-direct}

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ fmt:
239239
.PHONY: vet
240240
vet:
241241
@echo "Running go vet..."
242-
@$(GO) vet $(GO_PACKAGES)
243242
@GOOS= GOARCH= $(GO) build -mod=vendor code.gitea.io/gitea-vet
244243
@$(GO) vet -vettool=gitea-vet $(GO_PACKAGES)
245244

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

cmd/serv.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ func runServ(c *cli.Context) error {
191191
return fail("Invalid repo name", "Invalid repo name: %s", reponame)
192192
}
193193

194-
if setting.EnablePprof || c.Bool("enable-pprof") {
194+
if c.Bool("enable-pprof") {
195195
if err := os.MkdirAll(setting.PprofDataPath, os.ModePerm); err != nil {
196196
return fail("Error while trying to create PPROF_DATA_PATH", "Error while trying to create PPROF_DATA_PATH: %v", err)
197197
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dashboards_out
2+
vendor
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
JSONNET_FMT := jsonnetfmt -n 2 --max-blank-lines 1 --string-style s --comment-style s
2+
3+
.PHONY: all
4+
all: build dashboards_out
5+
6+
vendor: jsonnetfile.json
7+
jb install
8+
9+
.PHONY: build
10+
build: vendor
11+
12+
.PHONY: fmt
13+
fmt:
14+
find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \
15+
xargs -n 1 -- $(JSONNET_FMT) -i
16+
17+
.PHONY: lint
18+
lint: build
19+
find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \
20+
while read f; do \
21+
$(JSONNET_FMT) "$$f" | diff -u "$$f" -; \
22+
done
23+
mixtool lint mixin.libsonnet
24+
25+
dashboards_out: mixin.libsonnet config.libsonnet $(wildcard dashboards/*)
26+
@mkdir -p dashboards_out
27+
jsonnet -J vendor -m dashboards_out lib/dashboards.jsonnet
28+
29+
.PHONY: clean
30+
clean:
31+
rm -rf dashboards_out
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Gitea Mixin
2+
3+
Gitea Mixin is a set of configurable Grafana dashboards based on the metrics exported by the Gitea built-in metrics endpoint.
4+
5+
## Generate config files
6+
7+
You can manually generate dashboards, but first you should install some tools:
8+
9+
```bash
10+
go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@latest
11+
go install github.com/google/go-jsonnet/cmd/jsonnet@latest
12+
# or in brew: brew install go-jsonnet
13+
```
14+
15+
For linting and formatting, you would also need `mixtool` and `jsonnetfmt` installed. If you
16+
have a working Go development environment, it's easiest to run the following:
17+
18+
```bash
19+
go install github.com/monitoring-mixins/mixtool/cmd/mixtool@latest
20+
go install github.com/google/go-jsonnet/cmd/jsonnetfmt@latest
21+
```
22+
23+
The files in `dashboards_out` need to be imported
24+
into your Grafana server. The exact details will be depending on your environment.
25+
26+
Edit `config.libsonnet` if required and then build JSON dashboard files for Grafana:
27+
28+
```bash
29+
make
30+
```
31+
32+
For more advanced uses of mixins, see
33+
https://github.com/monitoring-mixins/docs.
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
{
2+
_config+:: {
3+
local c = self,
4+
dashboardNamePrefix: 'Gitea',
5+
dashboardTags: ['gitea'],
6+
dashboardPeriod: 'now-1h',
7+
dashboardTimezone: 'default',
8+
dashboardRefresh: '1m',
9+
10+
// please see https://docs.gitea.io/en-us/config-cheat-sheet/#metrics-metrics
11+
// Show issue by repository metrics with format gitea_issues_by_repository{repository="org/repo"} 5.
12+
// Requires Gitea 1.16.0 with ENABLED_ISSUE_BY_REPOSITORY set to true.
13+
showIssuesByRepository: true,
14+
// Show graphs for issue by label metrics with format gitea_issues_by_label{label="bug"} 2.
15+
// Requires Gitea 1.16.0 with ENABLED_ISSUE_BY_LABEL set to true.
16+
showIssuesByLabel: true,
17+
18+
// Requires Gitea 1.16.0.
19+
showIssuesOpenClose: true,
20+
21+
// add or remove metrics from dashboard
22+
giteaStatMetrics:
23+
[
24+
{
25+
name: 'gitea_organizations',
26+
description: 'Organizations',
27+
},
28+
{
29+
name: 'gitea_teams',
30+
description: 'Teams',
31+
},
32+
{
33+
name: 'gitea_users',
34+
description: 'Users',
35+
},
36+
{
37+
name: 'gitea_repositories',
38+
description: 'Repositories',
39+
},
40+
{
41+
name: 'gitea_milestones',
42+
description: 'Milestones',
43+
},
44+
{
45+
name: 'gitea_stars',
46+
description: 'Stars',
47+
},
48+
{
49+
name: 'gitea_releases',
50+
description: 'Releases',
51+
},
52+
]
53+
+
54+
if c.showIssuesOpenClose then
55+
[
56+
{
57+
name: 'gitea_issues_open',
58+
description: 'Issues opened',
59+
},
60+
{
61+
name: 'gitea_issues_closed',
62+
description: 'Issues closed',
63+
},
64+
] else
65+
[
66+
{
67+
name: 'gitea_issues',
68+
description: 'Issues',
69+
},
70+
],
71+
//set this for using label colors on graphs
72+
issueLabels: [
73+
{
74+
label: 'bug',
75+
color: '#ee0701',
76+
},
77+
{
78+
label: 'duplicate',
79+
color: '#cccccc',
80+
},
81+
{
82+
label: 'invalid',
83+
color: '#e6e6e6',
84+
},
85+
{
86+
label: 'enhancement',
87+
color: '#84b6eb',
88+
},
89+
{
90+
label: 'help wanted',
91+
color: '#128a0c',
92+
},
93+
{
94+
label: 'question',
95+
color: '#cc317c',
96+
},
97+
],
98+
},
99+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(import 'overview.libsonnet')

0 commit comments

Comments
 (0)