Skip to content

Commit 8290420

Browse files
committed
Merge remote-tracking branch 'upstream' into oauth-client-type
2 parents 8a238ed + 63ebb53 commit 8290420

File tree

347 files changed

+11577
-9387
lines changed

Some content is hidden

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

347 files changed

+11577
-9387
lines changed

.drone.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,8 @@ steps:
626626
commit_message: "[skip ci] Updated translations via Crowdin"
627627
remote: "[email protected]:go-gitea/gitea.git"
628628
environment:
629+
DRONE_COMMIT_AUTHOR_EMAIL: "[email protected]"
630+
DRONE_COMMIT_AUTHOR: GiteaBot
629631
GIT_PUSH_SSH_KEY:
630632
from_secret: git_push_ssh_key
631633

@@ -670,12 +672,14 @@ steps:
670672
pull: always
671673
settings:
672674
author_email: "[email protected]"
673-
author_name: GiteaBot
675+
author_name: "GiteaBot"
674676
branch: main
675677
commit: true
676-
commit_message: "[skip ci] Updated licenses and gitignores "
678+
commit_message: "[skip ci] Updated licenses and gitignores"
677679
remote: "[email protected]:go-gitea/gitea.git"
678680
environment:
681+
DRONE_COMMIT_AUTHOR_EMAIL: "[email protected]"
682+
DRONE_COMMIT_AUTHOR: "GiteaBot"
679683
GIT_PUSH_SSH_KEY:
680684
from_secret: git_push_ssh_key
681685

.eslintrc.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ overrides:
3535
rules:
3636
import/no-unresolved: [0]
3737
import/no-extraneous-dependencies: [0]
38-
- files: ["*.test.js"]
39-
env:
40-
jest: true
4138
- files: ["*.config.js"]
4239
rules:
4340
import/no-unused-modules: [0]

.gitpod.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
image: gitpod/workspace-full:latest
2-
31
tasks:
42
- name: Setup
53
init: |
@@ -16,10 +14,13 @@ tasks:
1614
command: |
1715
gp sync-await setup
1816
mkdir -p custom/conf/
19-
echo -e "[server]\nROOT_URL=https://3000-$GITPOD_WORKSPACE_ID.${GITPOD_WORKSPACE_CLUSTER_HOST}/" > custom/conf/app.ini
20-
echo -e "\n[database]\nDB_TYPE = sqlite3\nPATH = /workspace/gitea/data/gitea.db" >> custom/conf/app.ini
17+
echo -e "[server]\nROOT_URL=$(gp url 3000)/" > custom/conf/app.ini
18+
echo -e "\n[database]\nDB_TYPE = sqlite3\nPATH = $GITPOD_REPO_ROOT/data/gitea.db" >> custom/conf/app.ini
2119
export TAGS="sqlite sqlite_unlock_notify"
2220
make watch-backend
21+
- name: Run docs
22+
before: sudo bash -c "$(grep 'https://github.com/gohugoio/hugo/releases/download' Makefile | tr -d '\')" # install hugo
23+
command: cd docs && make clean update && hugo server -D -F --baseUrl $(gp url 1313) --liveReloadPort=443 --appendPort=false --bind=0.0.0.0
2324

2425
vscode:
2526
extensions:
@@ -28,7 +29,12 @@ vscode:
2829
- golang.go
2930
- stylelint.vscode-stylelint
3031
- DavidAnson.vscode-markdownlint
32+
- johnsoncodehk.volar
33+
- ms-azuretools.vscode-docker
34+
- zixuanchen.vitest-explorer
3135

3236
ports:
3337
- name: Gitea
3438
port: 3000
39+
- name: Docs
40+
port: 1313

.golangci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ linters:
1212
- dupl
1313
#- gocyclo # The cyclomatic complexety of a lot of functions is too high, we should refactor those another time.
1414
- gofmt
15-
- misspell
1615
- gocritic
1716
- bidichk
1817
- ineffassign
@@ -148,9 +147,6 @@ issues:
148147
- path: models/issue_comment_list.go
149148
linters:
150149
- dupl
151-
- linters:
152-
- misspell
153-
text: '`Unknwon` is a misspelling of `Unknown`'
154150
- path: models/update.go
155151
linters:
156152
- unused

CHANGELOG.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,86 @@ 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.17.3](https://github.com/go-gitea/gitea/releases/tag/v1.17.3) - 2022-10-15
8+
9+
* SECURITY
10+
* Sanitize and Escape refs in git backend (#21464) (#21463)
11+
* Bump `golang.org/x/text` (#21412) (#21413)
12+
* Update bluemonday (#21281) (#21287)
13+
* ENHANCEMENTS
14+
* Fix empty container layer history and UI (#21251) (#21278)
15+
* Use en-US as fallback when using other default language (#21200) (#21256)
16+
* Make the vscode clone link respect transport protocol (#20557) (#21128)
17+
* BUGFIXES
18+
* Do DB update after merge in hammer context (#21401) (#21416)
19+
* Add Num{Issues,Pulls} stats checks (#21404) (#21414)
20+
* Stop logging CheckPath returns error: context canceled (#21064) (#21405)
21+
* Parse OAuth Authorization header when request omits client secret (#21351) (#21374)
22+
* Ignore port for loopback redirect URIs (#21293) (#21373)
23+
* Set SemverCompatible to false for Conan packages (#21275) (#21366)
24+
* Tag list should include draft releases with existing tags (#21263) (#21365)
25+
* Fix linked account translation (#21331) (#21334)
26+
* Make NuGet service index publicly accessible (#21242) (#21277)
27+
* Foreign ID conflicts if ID is 0 for each item (#21271) (#21272)
28+
* Use absolute links in feeds (#21229) (#21265)
29+
* Prevent invalid behavior for file reviewing when loading more files (#21230) (#21234)
30+
* Respect `REQUIRE_SIGNIN_VIEW` for packages (#20873) (#21232)
31+
* Treat git object mode 40755 as directory (#21195) (#21218)
32+
* Allow uppercase ASCII alphabet in PyPI package names (#21095) (#21217)
33+
* Fix limited user cannot view himself's profile (#21212)
34+
* Fix template bug of admin monitor (#21209)
35+
* Fix reaction of issues (#21185) (#21196)
36+
* Fix CSV diff for added/deleted files (#21189) (#21193)
37+
* Fix pagination limit parameter problem (#21111)
38+
* TESTING
39+
* Fix missing m.Run() in TestMain (#21341)
40+
* BUILD
41+
* Use Go 1.19 fmt for Gitea 1.17, sync emoji data (#21239)
42+
43+
## [1.17.2](https://github.com/go-gitea/gitea/releases/tag/v1.17.2) - 2022-09-06
44+
45+
* SECURITY
46+
* Double check CloneURL is acceptable (#20869) (#20892)
47+
* Add more checks in migration code (#21011) (#21050)
48+
* ENHANCEMENTS
49+
* Fix hard-coded timeout and error panic in API archive download endpoint (#20925) (#21051)
50+
* Improve arc-green code theme (#21039) (#21042)
51+
* Enable contenthash in filename for dynamic assets (#20813) (#20932)
52+
* Don't open new page for ext wiki on same repository (#20725) (#20910)
53+
* Disable doctor logging on panic (#20847) (#20898)
54+
* Remove calls to load Mirrors in user.Dashboard (#20855) (#20897)
55+
* Update codemirror to 5.65.8 (#20875)
56+
* Rework repo buttons (#20602, #20718) (#20719)
57+
* BUGFIXES
58+
* Ensure delete user deletes all comments (#21067) (#21068)
59+
* Delete unreferenced packages when deleting a package version (#20977) (#21060)
60+
* Redirect if user does not exist on admin pages (#20981) (#21059)
61+
* Set uploadpack.allowFilter etc on gitea serv to enable partial clones with ssh (#20902) (#21058)
62+
* Fix 500 on time in timeline API (#21052) (#21057)
63+
* Fill the specified ref in webhook test payload (#20961) (#21055)
64+
* Add another index for Action table on postgres (#21033) (#21054)
65+
* Fix broken insecureskipverify handling in redis connection uris (#20967) (#21053)
66+
* Add Dev, Peer and Optional dependencies to npm PackageMetadataVersion (#21017) (#21044)
67+
* Do not add links to Posters or Assignees with ID < 0 (#20577) (#21037)
68+
* Fix modified due date message (#20388) (#21032)
69+
* Fix missed sort bug (#21006)
70+
* Fix input.value attr for RequiredClaimName/Value (#20946) (#21001)
71+
* Change review buttons to icons to make space for text (#20934) (#20978)
72+
* Fix download archiver of a commit (#20962) (#20971)
73+
* Return 404 NotFound if requested attachment does not exist (#20886) (#20941)
74+
* Set no-tags in git fetch on compare (#20893) (#20936)
75+
* Allow multiple metadata files for Maven packages (#20674) (#20916)
76+
* Increase Content field size of gpg_key and public_key to MEDIUMTEXT (#20896) (#20911)
77+
* Fix mirror address setting not working (#20850) (#20904)
78+
* Fix push mirror address backend get error Address cause setting page display error (#20593) (#20901)
79+
* Fix panic when an invalid oauth2 name is passed (#20820) (#20900)
80+
* In PushMirrorsIterate and MirrorsIterate if limit is negative do not set it (#20837) (#20899)
81+
* Ensure that graceful start-up is informed of unused SSH listener (#20877) (#20888)
82+
* Pad GPG Key ID with preceding zeroes (#20878) (#20885)
83+
* Fix SQL Query for `SearchTeam` (#20844) (#20872)
84+
* Fix the mode of custom dir to 0700 in docker-rootless (#20861) (#20867)
85+
* Fix UI mis-align for PR commit history (#20845) (#20859)
86+
787
## [1.17.1](https://github.com/go-gitea/gitea/releases/tag/1.17.1) - 2022-08-17
888

989
* SECURITY

CONTRIBUTING.md

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,16 @@ If your PR could cause a breaking change you must add a BREAKING section to this
146146

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

149+
Once code review starts on your PR, do not rebase nor squash your branch as it makes it
150+
difficult to review the new changes. Only if there is a need, sync your branch by merging
151+
the base branch into yours. Don't worry about merge commits messing up your tree as
152+
the final merge process squashes all commits into one, with the visible commit message (first
153+
line) being the PR title + PR index and description being the PR's first comment.
154+
155+
Once your PR gets the `lgtm/done` label, don't worry about keeping it up-to-date or breaking
156+
builds (unless there's a merge conflict or a request is made by a maintainer to make
157+
modifications). It is the maintainer team's responsibility from this point to get it merged.
158+
149159
## Styleguide
150160

151161
For imports you should use the following format (*without* the comments)
@@ -170,17 +180,22 @@ import (
170180

171181
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:
172182

173-
- **integration:** Integration tests
174183
- **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).
175184
- **models/fixtures:** Sample model data used in integration tests.
176185
- **models/migrations:** Handling of database migrations between versions. PRs that changes a database structure shall also have a migration step.
177-
- **modules:** Different modules to handle specific functionality in Gitea.
186+
- **modules:** Different modules to handle specific functionality in Gitea. Shall only depend on other modules but not other packages (models, services).
178187
- **public:** Frontend files (javascript, images, css, etc.)
179-
- **routers:** Handling of server requests. As it uses other Gitea packages to serve the request, other packages (models, modules or services) shall not depend on routers
188+
- **routers:** Handling of server requests. As it uses other Gitea packages to serve the request, other packages (models, modules or services) shall not depend on routers.
180189
- **services:** Support functions for common routing operations. Uses models and modules to handle the request.
181190
- **templates:** Golang templates for generating the html output.
191+
- **tests/e2e:** End to end tests
192+
- **tests/integration:** Integration tests
182193
- **vendor:** External code that Gitea depends on.
183194

195+
## Documentation
196+
197+
If you add a new feature or change an existing aspect of Gitea, the documentation for that feature must be created or updated.
198+
184199
## API v1
185200

186201
The API is documented by [swagger](http://try.gitea.io/api/swagger) and is based on [GitHub API v3](https://developer.github.com/v3/).
@@ -229,27 +244,6 @@ An endpoint which changes/edits an object expects all fields to be optional (exc
229244
- support pagination (`page` & `limit` options in query)
230245
- set `X-Total-Count` header via **SetTotalCountHeader** ([example](https://github.com/go-gitea/gitea/blob/7aae98cc5d4113f1e9918b7ee7dd09f67c189e3e/routers/api/v1/repo/issue.go#L444))
231246

232-
## Large Character Comments
233-
234-
Throughout the codebase there are large-text comments for sections of code, e.g.:
235-
236-
```go
237-
// __________ .__
238-
// \______ \ _______ _|__| ______ _ __
239-
// | _// __ \ \/ / |/ __ \ \/ \/ /
240-
// | | \ ___/\ /| \ ___/\ /
241-
// |____|_ /\___ >\_/ |__|\___ >\/\_/
242-
// \/ \/ \/
243-
```
244-
245-
These were created using the `figlet` tool with the `graffiti` font.
246-
247-
A simple way of creating these is to use the following:
248-
249-
```bash
250-
figlet -f graffiti Review | sed -e's+^+// +' - | xclip -sel clip -in
251-
```
252-
253247
## Backports and Frontports
254248

255249
Occasionally backports of PRs are required.

Makefile

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ TEST_TAGS ?= sqlite sqlite_unlock_notify
130130
TAR_EXCLUDES := .git data indexers queues log node_modules $(EXECUTABLE) $(FOMANTIC_WORK_DIR)/node_modules $(DIST) $(MAKE_EVIDENCE_DIR) $(AIR_TMP_DIR) $(GO_LICENSE_TMP_DIR)
131131

132132
GO_DIRS := cmd tests models modules routers build services tools
133+
WEB_DIRS := web_src/js web_src/less
133134

134135
GO_SOURCES := $(wildcard *.go)
135136
GO_SOURCES += $(shell find $(GO_DIRS) -type f -name "*.go" -not -path modules/options/bindata.go -not -path modules/public/bindata.go -not -path modules/templates/bindata.go)
@@ -263,11 +264,24 @@ clean:
263264

264265
.PHONY: fmt
265266
fmt:
266-
@MISSPELL_PACKAGE=$(MISSPELL_PACKAGE) GOFUMPT_PACKAGE=$(GOFUMPT_PACKAGE) $(GO) run build/code-batch-process.go gitea-fmt -w '{file-list}'
267+
GOFUMPT_PACKAGE=$(GOFUMPT_PACKAGE) $(GO) run build/code-batch-process.go gitea-fmt -w '{file-list}'
267268
$(eval TEMPLATES := $(shell find templates -type f -name '*.tmpl'))
268269
@# strip whitespace after '{{' and before `}}` unless there is only whitespace before it
269270
@$(SED_INPLACE) -e 's/{{[ ]\{1,\}/{{/g' -e '/^[ ]\{1,\}}}/! s/[ ]\{1,\}}}/}}/g' $(TEMPLATES)
270271

272+
.PHONY: fmt-check
273+
fmt-check: fmt
274+
@diff=$$(git diff $(GO_SOURCES) templates $(WEB_DIRS)); \
275+
if [ -n "$$diff" ]; then \
276+
echo "Please run 'make fmt' and commit the result:"; \
277+
echo "$${diff}"; \
278+
exit 1; \
279+
fi
280+
281+
.PHONY: misspell-check
282+
misspell-check:
283+
go run $(MISSPELL_PACKAGE) -error $(GO_DIRS) $(WEB_DIRS)
284+
271285
.PHONY: vet
272286
vet:
273287
@echo "Running go vet..."
@@ -311,30 +325,14 @@ errcheck:
311325
@echo "Running errcheck..."
312326
$(GO) run $(ERRCHECK_PACKAGE) $(GO_PACKAGES)
313327

314-
.PHONY: fmt-check
315-
fmt-check:
316-
@# get all go files and run gitea-fmt (with gofmt) on them
317-
@diff=$$(MISSPELL_PACKAGE=$(MISSPELL_PACKAGE) GOFUMPT_PACKAGE=$(GOFUMPT_PACKAGE) $(GO) run build/code-batch-process.go gitea-fmt -l '{file-list}'); \
318-
if [ -n "$$diff" ]; then \
319-
echo "Please run 'make fmt' and commit the result:"; \
320-
echo "$${diff}"; \
321-
exit 1; \
322-
fi
323-
@diff2=$$(git diff templates); \
324-
if [ -n "$$diff2" ]; then \
325-
echo "Please run 'make fmt' and commit the result:"; \
326-
echo "$${diff2}"; \
327-
exit 1; \
328-
fi
329-
330328
.PHONY: checks
331329
checks: checks-frontend checks-backend
332330

333331
.PHONY: checks-frontend
334332
checks-frontend: lockfile-check svg-check
335333

336334
.PHONY: checks-backend
337-
checks-backend: tidy-check swagger-check swagger-validate
335+
checks-backend: tidy-check swagger-check fmt-check misspell-check swagger-validate
338336

339337
.PHONY: lint
340338
lint: lint-frontend lint-backend
@@ -372,7 +370,7 @@ test-backend:
372370

373371
.PHONY: test-frontend
374372
test-frontend: node_modules
375-
@NODE_OPTIONS="--experimental-vm-modules --no-warnings" npx jest --color
373+
npx vitest
376374

377375
.PHONY: test-check
378376
test-check:

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
<a href="https://opensource.org/licenses/MIT" title="License: MIT">
3434
<img src="https://img.shields.io/badge/License-MIT-blue.svg">
3535
</a>
36+
<a href="https://gitpod.io/#https://github.com/go-gitea/gitea">
37+
<img
38+
src="https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod"
39+
alt="Contribute with Gitpod"
40+
/>
41+
</a>
3642
<a href="https://crowdin.com/project/gitea" title="Crowdin">
3743
<img src="https://badges.crowdin.net/gitea/localized.svg">
3844
</a>
@@ -145,6 +151,7 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
145151
<a href="https://opencollective.com/gitea/sponsor/7/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/7/avatar.svg"></a>
146152
<a href="https://opencollective.com/gitea/sponsor/8/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/8/avatar.svg"></a>
147153
<a href="https://opencollective.com/gitea/sponsor/9/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/9/avatar.svg"></a>
154+
<a href="https://cynkra.com/" target="_blank"><img src="https://images.opencollective.com/cynkra/logo/square/64/192.png"></a>
148155

149156
## FAQ
150157

README_ZH.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
<a href="https://opensource.org/licenses/MIT" title="License: MIT">
3434
<img src="https://img.shields.io/badge/License-MIT-blue.svg">
3535
</a>
36+
<a href="https://gitpod.io/#https://github.com/go-gitea/gitea">
37+
<img
38+
src="https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod"
39+
alt="Contribute with Gitpod"
40+
/>
41+
</a>
3642
<a href="https://crowdin.com/project/gitea" title="Crowdin">
3743
<img src="https://badges.crowdin.net/gitea/localized.svg">
3844
</a>

0 commit comments

Comments
 (0)