Skip to content

Commit e844523

Browse files
authored
Merge branch 'main' into org-oauth2
2 parents 5dd629c + 623c93f commit e844523

File tree

303 files changed

+6812
-4714
lines changed

Some content is hidden

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

303 files changed

+6812
-4714
lines changed

.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: 18 additions & 0 deletions
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

CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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]>

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 & 27 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"
@@ -280,29 +278,6 @@ errcheck:
280278
@echo "Running errcheck..."
281279
@errcheck $(GO_PACKAGES)
282280

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

322297
.PHONY: checks-backend
323-
checks-backend: misspell-check test-vendor swagger-check swagger-validate
298+
checks-backend: test-vendor swagger-check swagger-validate
324299

325300
.PHONY: lint
326301
lint: lint-frontend lint-backend
@@ -332,7 +307,7 @@ lint-frontend: node_modules
332307
npx editorconfig-checker templates
333308

334309
.PHONY: lint-backend
335-
lint-backend: golangci-lint revive vet
310+
lint-backend: golangci-lint vet
336311

337312
.PHONY: watch
338313
watch:

cmd/admin.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import (
1515

1616
"code.gitea.io/gitea/models"
1717
asymkey_model "code.gitea.io/gitea/models/asymkey"
18+
"code.gitea.io/gitea/models/auth"
1819
"code.gitea.io/gitea/models/db"
19-
"code.gitea.io/gitea/models/login"
2020
user_model "code.gitea.io/gitea/models/user"
2121
"code.gitea.io/gitea/modules/git"
2222
"code.gitea.io/gitea/modules/graceful"
@@ -700,8 +700,8 @@ func runAddOauth(c *cli.Context) error {
700700
return err
701701
}
702702

703-
return login.CreateSource(&login.Source{
704-
Type: login.OAuth2,
703+
return auth.CreateSource(&auth.Source{
704+
Type: auth.OAuth2,
705705
Name: c.String("name"),
706706
IsActive: true,
707707
Cfg: parseOAuth2Config(c),
@@ -720,7 +720,7 @@ func runUpdateOauth(c *cli.Context) error {
720720
return err
721721
}
722722

723-
source, err := login.GetSourceByID(c.Int64("id"))
723+
source, err := auth.GetSourceByID(c.Int64("id"))
724724
if err != nil {
725725
return err
726726
}
@@ -801,7 +801,7 @@ func runUpdateOauth(c *cli.Context) error {
801801
oAuth2Config.CustomURLMapping = customURLMapping
802802
source.Cfg = oAuth2Config
803803

804-
return login.UpdateSource(source)
804+
return auth.UpdateSource(source)
805805
}
806806

807807
func runListAuth(c *cli.Context) error {
@@ -812,7 +812,7 @@ func runListAuth(c *cli.Context) error {
812812
return err
813813
}
814814

815-
loginSources, err := login.Sources()
815+
authSources, err := auth.Sources()
816816

817817
if err != nil {
818818
return err
@@ -831,7 +831,7 @@ func runListAuth(c *cli.Context) error {
831831
// loop through each source and print
832832
w := tabwriter.NewWriter(os.Stdout, c.Int("min-width"), c.Int("tab-width"), c.Int("padding"), padChar, flags)
833833
fmt.Fprintf(w, "ID\tName\tType\tEnabled\n")
834-
for _, source := range loginSources {
834+
for _, source := range authSources {
835835
fmt.Fprintf(w, "%d\t%s\t%s\t%t\n", source.ID, source.Name, source.Type.String(), source.IsActive)
836836
}
837837
w.Flush()
@@ -851,10 +851,10 @@ func runDeleteAuth(c *cli.Context) error {
851851
return err
852852
}
853853

854-
source, err := login.GetSourceByID(c.Int64("id"))
854+
source, err := auth.GetSourceByID(c.Int64("id"))
855855
if err != nil {
856856
return err
857857
}
858858

859-
return auth_service.DeleteLoginSource(source)
859+
return auth_service.DeleteSource(source)
860860
}

0 commit comments

Comments
 (0)