Skip to content

Commit 8adf230

Browse files
committed
* 'main' of https://github.com/go-gitea/gitea: (87 commits) Fix template bug of LFS lock (go-gitea#18784) Various Mermaid improvements (go-gitea#18776) [skip ci] Updated translations via Crowdin Fix display time of milestones (go-gitea#18753) [skip ci] Updated translations via Crowdin Prevent dangling GetAttribute calls (go-gitea#18754) Add example to render html files (go-gitea#18736) Fix a broken link in `commits_list_small.tmpl` (go-gitea#18763) Fix broken cancel button link on patch page (go-gitea#18718) Ignore the migrate if u2f_registration is not exist (go-gitea#18760) [skip ci] Updated translations via Crowdin Increase the size of the webauthn_credential credential_id field (go-gitea#18739) Fix isempty detection of git repository (go-gitea#18746) [skip ci] Updated translations via Crowdin Send mail to issue/pr assignee/reviewer also when OnMention is set (go-gitea#18707) Reduce CI go module downloads, add make targets (go-gitea#18708) Add number in queue status to monitor page (go-gitea#18712) Fix source code line highlighting (go-gitea#18729) Fix forked repositories missed tags (go-gitea#18719) [skip ci] Updated translations via Crowdin ...
2 parents 182d358 + f48771a commit 8adf230

File tree

292 files changed

+6124
-2599
lines changed

Some content is hidden

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

292 files changed

+6124
-2599
lines changed

.drone.yml

Lines changed: 320 additions & 59 deletions
Large diffs are not rendered by default.

.gitattributes

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
* text=auto eol=lf
2-
/vendor/** -text -eol linguist-vendored
3-
/public/vendor/** -text -eol linguist-vendored
4-
/web_src/js/vendor/** -text -eol linguist-vendored
5-
/templates/**/*.tmpl linguist-language=Handlebars
2+
*.tmpl linguist-language=Handlebars
63
/.eslintrc linguist-language=YAML
74
/.stylelintrc linguist-language=YAML
5+
/public/vendor/** -text -eol linguist-vendored
6+
/vendor/** -text -eol linguist-vendored
87
/web_src/fomantic/build/** linguist-generated
8+
/web_src/js/vendor/** -text -eol linguist-vendored
99
Dockerfile.* linguist-language=Dockerfile

.github/ISSUE_TEMPLATE/bug-report.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ body:
1616
4. Make sure it's not mentioned in the FAQ (https://docs.gitea.io/en-us/faq)
1717
5. Please give all relevant information below for bug reports, because
1818
incomplete details will be handled as an invalid report.
19+
6. In particular it's really important to provide pertinent logs. You must give us DEBUG level logs.
20+
Please read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems
21+
In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini
1922
- type: input
2023
id: gitea-ver
2124
attributes:

.github/ISSUE_TEMPLATE/ui.bug-report.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ body:
1515
4. Make sure it's not mentioned in the FAQ (https://docs.gitea.io/en-us/faq)
1616
5. Please give all relevant information below for bug reports, because
1717
incomplete details will be handled as an invalid report.
18+
6. In particular it's really important to provide pertinent logs. If you are certain that this is a javascript
19+
error, show us the javascript console. If the error appears to relate to Gitea the server you must also give us
20+
DEBUG level logs. (See https://docs.gitea.io/en-us/logging-configuration/#debugging-problems)
1821
- type: input
1922
id: gitea-ver
2023
attributes:

.golangci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ linters:
2424

2525
run:
2626
timeout: 3m
27+
skip-dirs:
28+
- node_modules
29+
- public
30+
- web_src
2731

2832
linters-settings:
2933
gocritic:

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,35 @@ 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.1](https://github.com/go-gitea/gitea/releases/tag/v1.16.1) - 2022-02-06
8+
9+
* SECURITY
10+
* Update JS dependencies, fix lint (#18389) (#18540)
11+
* ENHANCEMENTS
12+
* Add dropdown icon to label set template dropdown (#18564) (#18571)
13+
* BUGFIXES
14+
* comments on migrated issues/prs must link to the comment ID (#18630) (#18637)
15+
* Stop logging an error when notes are not found (#18626) (#18635)
16+
* Ensure that blob-excerpt links work for wiki (#18587) (#18624)
17+
* Only attempt to flush queue if the underlying worker pool is not finished (#18593) (#18620)
18+
* Ensure commit-statuses box is sized correctly in headers (#18538) (#18606)
19+
* Prevent merge messages from being sorted to the top of email chains (#18566) (#18588)
20+
* Prevent panic on prohibited user login with oauth2 (#18562) (#18563)
21+
* Collaborator trust model should trust collaborators (#18539) (#18557)
22+
* Detect conflicts with 3way merge (#18536) (#18537)
23+
* In docker rootless use $GITEA_APP_INI if provided (#18524) (#18535)
24+
* Add `GetUserTeams` (#18499) (#18531)
25+
* Fix review excerpt (#18502) (#18530)
26+
* Fix for AvatarURL database type (#18487) (#18529)
27+
* Use `ImagedProvider` for gplus oauth2 provider (#18504) (#18505)
28+
* Fix OAuth Source Edit Page (#18495) (#18503)
29+
* Use "read" value for General Access (#18496) (#18500)
30+
* Prevent NPE on partial match of compare URL and allow short SHA1 compare URLs (#18472) (#18473)
31+
* BUILD
32+
* Make docker gitea/gitea:v1.16-dev etc refer to the latest build on that branch (#18551) (#18569)
33+
* DOCS
34+
* Update 1.16.0 changelog to set #17846 as breaking (#18533) (#18534)
35+
736
## [1.16.0](https://github.com/go-gitea/gitea/releases/tag/v1.16.0) - 2022-01-30
837

938
* BREAKING

Makefile

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ endif
6060

6161
EXTRA_GOFLAGS ?=
6262

63-
MAKE_VERSION := $(shell $(MAKE) -v | head -n 1)
63+
MAKE_VERSION := $(shell "$(MAKE)" -v | head -n 1)
6464
MAKE_EVIDENCE_DIR := .make_evidence
6565

6666
ifeq ($(RACE_ENABLED),true)
@@ -166,6 +166,9 @@ help:
166166
@echo " - watch-backend watch backend files and continuously rebuild"
167167
@echo " - clean delete backend and integration files"
168168
@echo " - clean-all delete backend, frontend and integration files"
169+
@echo " - deps install dependencies"
170+
@echo " - deps-frontend install frontend dependencies"
171+
@echo " - deps-backend install backend dependencies"
169172
@echo " - lint lint everything"
170173
@echo " - lint-frontend lint frontend files"
171174
@echo " - lint-backend lint backend files"
@@ -231,13 +234,11 @@ clean:
231234

232235
.PHONY: fmt
233236
fmt:
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"
237237
@hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
238238
$(GO) install mvdan.cc/gofumpt@latest; \
239239
fi
240-
@gofumpt -w -l -extra -lang 1.16 .
240+
@echo "Running gitea-fmt (with gofumpt)..."
241+
@$(GO) run build/code-batch-process.go gitea-fmt -w '{file-list}'
241242

242243
.PHONY: vet
243244
vet:
@@ -285,8 +286,11 @@ errcheck:
285286

286287
.PHONY: fmt-check
287288
fmt-check:
289+
@hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
290+
$(GO) install mvdan.cc/gofumpt@latest; \
291+
fi
288292
# get all go files and run gitea-fmt (with gofmt) on them
289-
@diff=$$($(GO) run build/code-batch-process.go gitea-fmt -s -d '{file-list}'); \
293+
@diff=$$($(GO) run build/code-batch-process.go gitea-fmt -l '{file-list}'); \
290294
if [ -n "$$diff" ]; then \
291295
echo "Please run 'make fmt' and commit the result:"; \
292296
echo "$${diff}"; \
@@ -401,6 +405,11 @@ test-sqlite-migration: migrations.sqlite.test migrations.individual.sqlite.test
401405
GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/sqlite.ini ./migrations.sqlite.test
402406
GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/sqlite.ini ./migrations.individual.sqlite.test
403407

408+
.PHONY: test-sqlite-migration\#%
409+
test-sqlite-migration\#%: migrations.sqlite.test migrations.individual.sqlite.test generate-ini-sqlite
410+
GITEA_ROOT="$(CURDIR)" GITEA_CONF=integrations/sqlite.ini ./migrations.individual.sqlite.test -test.run $(subst .,/,$*)
411+
412+
404413
generate-ini-mysql:
405414
sed -e 's|{{TEST_MYSQL_HOST}}|${TEST_MYSQL_HOST}|g' \
406415
-e 's|{{TEST_MYSQL_DBNAME}}|${TEST_MYSQL_DBNAME}|g' \
@@ -661,6 +670,16 @@ docs:
661670
fi
662671
cd docs; make trans-copy clean build-offline;
663672

673+
.PHONY: deps
674+
deps: deps-frontend deps-backend
675+
676+
.PHONY: deps-frontend
677+
deps-frontend: node_modules
678+
679+
.PHONY: deps-backend
680+
deps-backend:
681+
$(GO) mod download
682+
664683
node_modules: package-lock.json
665684
npm install --no-save
666685
@touch node_modules

build/code-batch-process.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,9 @@ func containsString(a []string, s string) bool {
229229
return false
230230
}
231231

232-
func giteaFormatGoImports(files []string) error {
232+
func giteaFormatGoImports(files []string, hasChangedFiles, doWriteFile bool) error {
233233
for _, file := range files {
234-
if err := codeformat.FormatGoImports(file); err != nil {
234+
if err := codeformat.FormatGoImports(file, hasChangedFiles, doWriteFile); err != nil {
235235
log.Printf("failed to format go imports: %s, err=%v", file, err)
236236
return err
237237
}
@@ -267,10 +267,11 @@ func main() {
267267
logVerbose("batch cmd: %s %v", subCmd, substArgs)
268268
switch subCmd {
269269
case "gitea-fmt":
270-
if containsString(subArgs, "-w") {
271-
cmdErrors = append(cmdErrors, giteaFormatGoImports(files))
270+
if containsString(subArgs, "-d") {
271+
log.Print("the -d option is not supported by gitea-fmt")
272272
}
273-
cmdErrors = append(cmdErrors, passThroughCmd("gofmt", substArgs))
273+
cmdErrors = append(cmdErrors, giteaFormatGoImports(files, containsString(subArgs, "-l"), containsString(subArgs, "-w")))
274+
cmdErrors = append(cmdErrors, passThroughCmd("gofumpt", append([]string{"-extra", "-lang", "1.16"}, substArgs...)))
274275
case "misspell":
275276
cmdErrors = append(cmdErrors, passThroughCmd("misspell", substArgs))
276277
default:

build/codeformat/formatimports.go

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package codeformat
77
import (
88
"bytes"
99
"errors"
10+
"fmt"
1011
"io"
1112
"os"
1213
"sort"
@@ -158,7 +159,7 @@ func formatGoImports(contentBytes []byte) ([]byte, error) {
158159
}
159160

160161
// FormatGoImports format the imports by our rules (see unit tests)
161-
func FormatGoImports(file string) error {
162+
func FormatGoImports(file string, doChangedFiles, doWriteFile bool) error {
162163
f, err := os.Open(file)
163164
if err != nil {
164165
return err
@@ -181,11 +182,20 @@ func FormatGoImports(file string) error {
181182
if bytes.Equal(contentBytes, formattedBytes) {
182183
return nil
183184
}
184-
f, err = os.OpenFile(file, os.O_TRUNC|os.O_WRONLY, 0o644)
185-
if err != nil {
185+
186+
if doChangedFiles {
187+
fmt.Println(file)
188+
}
189+
190+
if doWriteFile {
191+
f, err = os.OpenFile(file, os.O_TRUNC|os.O_WRONLY, 0o644)
192+
if err != nil {
193+
return err
194+
}
195+
defer f.Close()
196+
_, err = f.Write(formattedBytes)
186197
return err
187198
}
188-
defer f.Close()
189-
_, err = f.Write(formattedBytes)
199+
190200
return err
191201
}

cmd/admin_auth_ldap.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ func parseLdapConfig(c *cli.Context, config *ldap.Source) error {
260260
if c.IsSet("skip-local-2fa") {
261261
config.SkipLocalTwoFA = c.Bool("skip-local-2fa")
262262
}
263-
264263
return nil
265264
}
266265

0 commit comments

Comments
 (0)