Skip to content

Commit 8879756

Browse files
committed
Merge remote-tracking branch 'upstream/main'
* upstream/main: Adapt `.changelog.yml` to new labeling system (go-gitea#27701) Update and add new eslint plugins (go-gitea#27698) Show total TrackedTime on issue/pull/milestone lists (go-gitea#26672) Add doctor dbconsistency fix to delete repos with no owner (go-gitea#27290) Delete repos of org when purge delete user (go-gitea#27273) Fix required checkboxes in issue forms (go-gitea#27592) Upgrade xorm (go-gitea#27673) [docs] Add note that PROTOCOL config is case-sensitive (go-gitea#25685) Remove network call on `make clean` (go-gitea#27689) Add unit tests for action runner token (go-gitea#27670) Typos fixed in documentation files (go-gitea#27687)
2 parents d796cb4 + cab7b7f commit 8879756

File tree

33 files changed

+719
-402
lines changed

33 files changed

+719
-402
lines changed

.changelog.yml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,46 +13,42 @@ groups:
1313
-
1414
name: BREAKING
1515
labels:
16-
- kind/breaking
16+
- pr/breaking
1717
-
1818
name: SECURITY
1919
labels:
20-
- kind/security
20+
- topic/security
2121
-
2222
name: FEATURES
2323
labels:
24-
- kind/feature
24+
- type/feature
2525
-
2626
name: API
2727
labels:
28-
- kind/api
28+
- modifies/api
2929
-
3030
name: ENHANCEMENTS
3131
labels:
32-
- kind/enhancement
33-
- kind/refactor
34-
- kind/ui
32+
- type/enhancement
33+
- type/refactoring
34+
- topic/ui
3535
-
3636
name: BUGFIXES
3737
labels:
38-
- kind/bug
38+
- type/bug
3939
-
4040
name: TESTING
4141
labels:
42-
- kind/testing
43-
-
44-
name: TRANSLATION
45-
labels:
46-
- kind/translation
42+
- type/testing
4743
-
4844
name: BUILD
4945
labels:
50-
- kind/build
51-
- kind/lint
46+
- topic/build
47+
- topic/code-linting
5248
-
5349
name: DOCS
5450
labels:
55-
- kind/docs
51+
- type/docs
5652
-
5753
name: MISC
5854
default: true

.eslintrc.yaml

Lines changed: 103 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ parserOptions:
1111
plugins:
1212
- "@eslint-community/eslint-plugin-eslint-comments"
1313
- eslint-plugin-array-func
14-
- eslint-plugin-import
14+
- eslint-plugin-i
1515
- eslint-plugin-jquery
1616
- eslint-plugin-no-jquery
1717
- eslint-plugin-no-use-extend-native
1818
- eslint-plugin-regexp
1919
- eslint-plugin-sonarjs
2020
- eslint-plugin-unicorn
21+
- eslint-plugin-vitest
2122
- eslint-plugin-vitest-globals
2223
- eslint-plugin-wc
2324

@@ -41,14 +42,64 @@ overrides:
4142
no-restricted-globals: [2, addEventListener, blur, close, closed, confirm, defaultStatus, defaultstatus, error, event, external, find, focus, frameElement, frames, history, innerHeight, innerWidth, isFinite, isNaN, length, locationbar, menubar, moveBy, moveTo, name, onblur, onerror, onfocus, onload, onresize, onunload, open, opener, opera, outerHeight, outerWidth, pageXOffset, pageYOffset, parent, print, removeEventListener, resizeBy, resizeTo, screen, screenLeft, screenTop, screenX, screenY, scroll, scrollbars, scrollBy, scrollTo, scrollX, scrollY, status, statusbar, stop, toolbar, top]
4243
- files: ["build/generate-images.js"]
4344
rules:
44-
import/no-unresolved: [0]
45-
import/no-extraneous-dependencies: [0]
45+
i/no-unresolved: [0]
46+
i/no-extraneous-dependencies: [0]
4647
- files: ["*.config.*"]
4748
rules:
48-
import/no-unused-modules: [0]
49+
i/no-unused-modules: [0]
4950
- files: ["**/*.test.*", "web_src/js/test/setup.js"]
5051
env:
5152
vitest-globals/env: true
53+
rules:
54+
vitest/consistent-test-filename: [0]
55+
vitest/consistent-test-it: [0]
56+
vitest/expect-expect: [0]
57+
vitest/max-expects: [0]
58+
vitest/max-nested-describe: [0]
59+
vitest/no-alias-methods: [0]
60+
vitest/no-commented-out-tests: [0]
61+
vitest/no-conditional-expect: [0]
62+
vitest/no-conditional-in-test: [0]
63+
vitest/no-conditional-tests: [0]
64+
vitest/no-disabled-tests: [0]
65+
vitest/no-done-callback: [0]
66+
vitest/no-duplicate-hooks: [0]
67+
vitest/no-focused-tests: [0]
68+
vitest/no-hooks: [0]
69+
vitest/no-identical-title: [2]
70+
vitest/no-interpolation-in-snapshots: [0]
71+
vitest/no-large-snapshots: [0]
72+
vitest/no-mocks-import: [0]
73+
vitest/no-restricted-matchers: [0]
74+
vitest/no-restricted-vi-methods: [0]
75+
vitest/no-standalone-expect: [0]
76+
vitest/no-test-prefixes: [0]
77+
vitest/no-test-return-statement: [0]
78+
vitest/prefer-called-with: [0]
79+
vitest/prefer-comparison-matcher: [0]
80+
vitest/prefer-each: [0]
81+
vitest/prefer-equality-matcher: [0]
82+
vitest/prefer-expect-resolves: [0]
83+
vitest/prefer-hooks-in-order: [0]
84+
vitest/prefer-hooks-on-top: [2]
85+
vitest/prefer-lowercase-title: [0]
86+
vitest/prefer-mock-promise-shorthand: [0]
87+
vitest/prefer-snapshot-hint: [0]
88+
vitest/prefer-spy-on: [0]
89+
vitest/prefer-strict-equal: [0]
90+
vitest/prefer-to-be: [0]
91+
vitest/prefer-to-be-falsy: [0]
92+
vitest/prefer-to-be-object: [0]
93+
vitest/prefer-to-be-truthy: [0]
94+
vitest/prefer-to-contain: [0]
95+
vitest/prefer-to-have-length: [0]
96+
vitest/prefer-todo: [0]
97+
vitest/require-hook: [0]
98+
vitest/require-to-throw-message: [0]
99+
vitest/require-top-level-describe: [0]
100+
vitest/valid-describe-callback: [2]
101+
vitest/valid-expect: [2]
102+
vitest/valid-title: [2]
52103
- files: ["web_src/js/modules/fetch.js", "web_src/js/standalone/**/*"]
53104
rules:
54105
no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement, SequenceExpression]
@@ -113,49 +164,49 @@ rules:
113164
id-length: [0]
114165
id-match: [0]
115166
implicit-arrow-linebreak: [0]
116-
import/consistent-type-specifier-style: [0]
117-
import/default: [0]
118-
import/dynamic-import-chunkname: [0]
119-
import/export: [2]
120-
import/exports-last: [0]
121-
import/extensions: [2, always, {ignorePackages: true}]
122-
import/first: [2]
123-
import/group-exports: [0]
124-
import/max-dependencies: [0]
125-
import/named: [2]
126-
import/namespace: [0]
127-
import/newline-after-import: [0]
128-
import/no-absolute-path: [0]
129-
import/no-amd: [2]
130-
import/no-anonymous-default-export: [0]
131-
import/no-commonjs: [2]
132-
import/no-cycle: [2, {ignoreExternal: true, maxDepth: 1}]
133-
import/no-default-export: [0]
134-
import/no-deprecated: [0]
135-
import/no-dynamic-require: [0]
136-
import/no-empty-named-blocks: [2]
137-
import/no-extraneous-dependencies: [2]
138-
import/no-import-module-exports: [0]
139-
import/no-internal-modules: [0]
140-
import/no-mutable-exports: [0]
141-
import/no-named-as-default-member: [0]
142-
import/no-named-as-default: [2]
143-
import/no-named-default: [0]
144-
import/no-named-export: [0]
145-
import/no-namespace: [0]
146-
import/no-nodejs-modules: [0]
147-
import/no-relative-packages: [0]
148-
import/no-relative-parent-imports: [0]
149-
import/no-restricted-paths: [0]
150-
import/no-self-import: [2]
151-
import/no-unassigned-import: [0]
152-
import/no-unresolved: [2, {commonjs: true, ignore: ["\\?.+$", ^vitest/]}]
153-
import/no-unused-modules: [2, {unusedExports: true}]
154-
import/no-useless-path-segments: [2, {commonjs: true}]
155-
import/no-webpack-loader-syntax: [2]
156-
import/order: [0]
157-
import/prefer-default-export: [0]
158-
import/unambiguous: [0]
167+
i/consistent-type-specifier-style: [0]
168+
i/default: [0]
169+
i/dynamic-import-chunkname: [0]
170+
i/export: [2]
171+
i/exports-last: [0]
172+
i/extensions: [2, always, {ignorePackages: true}]
173+
i/first: [2]
174+
i/group-exports: [0]
175+
i/max-dependencies: [0]
176+
i/named: [2]
177+
i/namespace: [0]
178+
i/newline-after-import: [0]
179+
i/no-absolute-path: [0]
180+
i/no-amd: [2]
181+
i/no-anonymous-default-export: [0]
182+
i/no-commonjs: [2]
183+
i/no-cycle: [2, {ignoreExternal: true, maxDepth: 1}]
184+
i/no-default-export: [0]
185+
i/no-deprecated: [0]
186+
i/no-dynamic-require: [0]
187+
i/no-empty-named-blocks: [2]
188+
i/no-extraneous-dependencies: [2]
189+
i/no-import-module-exports: [0]
190+
i/no-internal-modules: [0]
191+
i/no-mutable-exports: [0]
192+
i/no-named-as-default-member: [0]
193+
i/no-named-as-default: [2]
194+
i/no-named-default: [0]
195+
i/no-named-export: [0]
196+
i/no-namespace: [0]
197+
i/no-nodejs-modules: [0]
198+
i/no-relative-packages: [0]
199+
i/no-relative-parent-imports: [0]
200+
i/no-restricted-paths: [0]
201+
i/no-self-import: [2]
202+
i/no-unassigned-import: [0]
203+
i/no-unresolved: [2, {commonjs: true, ignore: ["\\?.+$", ^vitest/]}]
204+
i/no-unused-modules: [2, {unusedExports: true}]
205+
i/no-useless-path-segments: [2, {commonjs: true}]
206+
i/no-webpack-loader-syntax: [2]
207+
i/order: [0]
208+
i/prefer-default-export: [0]
209+
i/unambiguous: [0]
159210
indent: [2, 2, {SwitchCase: 1}]
160211
init-declarations: [0]
161212
jquery/no-ajax-events: [2]
@@ -501,6 +552,7 @@ rules:
501552
regexp/no-empty-character-class: [0]
502553
regexp/no-empty-group: [2]
503554
regexp/no-empty-lookarounds-assertion: [2]
555+
regexp/no-empty-string-literal: [2]
504556
regexp/no-escape-backspace: [2]
505557
regexp/no-extra-lookaround-assertions: [0]
506558
regexp/no-invalid-regexp: [2]
@@ -531,6 +583,8 @@ rules:
531583
regexp/no-useless-non-capturing-group: [2]
532584
regexp/no-useless-quantifier: [2]
533585
regexp/no-useless-range: [2]
586+
regexp/no-useless-set-operand: [2]
587+
regexp/no-useless-string-literal: [2]
534588
regexp/no-useless-two-nums-quantifier: [2]
535589
regexp/no-zero-quantifier: [2]
536590
regexp/optimal-lookaround-quantifier: [2]
@@ -550,10 +604,12 @@ rules:
550604
regexp/prefer-regexp-exec: [2]
551605
regexp/prefer-regexp-test: [2]
552606
regexp/prefer-result-array-groups: [0]
607+
regexp/prefer-set-operation: [2]
553608
regexp/prefer-star-quantifier: [2]
554609
regexp/prefer-unicode-codepoint-escapes: [2]
555610
regexp/prefer-w: [0]
556611
regexp/require-unicode-regexp: [0]
612+
regexp/simplify-set-operations: [2]
557613
regexp/sort-alternatives: [0]
558614
regexp/sort-character-class-elements: [0]
559615
regexp/sort-flags: [0]

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@ clean-all: clean
278278

279279
.PHONY: clean
280280
clean:
281-
$(GO) clean -i ./...
282281
rm -rf $(EXECUTABLE) $(DIST) $(BINDATA_DEST) $(BINDATA_HASH) \
283282
integrations*.test \
284283
e2e*.test \

custom/conf/app.example.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ RUN_USER = ; git
6060
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6161
;;
6262
;; The protocol the server listens on. One of 'http', 'https', 'http+unix', 'fcgi' or 'fcgi+unix'. Defaults to 'http'
63+
;; Note: Value must be lowercase.
6364
;PROTOCOL = http
6465
;;
6566
;; Expect PROXY protocol headers on connections

docs/content/administration/config-cheat-sheet.en-us.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
281281

282282
- `APP_DATA_PATH`: **_`AppWorkPath`_/data**: This is the default root path for storing data.
283283
- `PROTOCOL`: **http**: \[http, https, fcgi, http+unix, fcgi+unix\]
284+
- Note: Value must be lowercase.
284285
- `USE_PROXY_PROTOCOL`: **false**: Expect PROXY protocol headers on connections
285286
- `PROXY_PROTOCOL_TLS_BRIDGING`: **false**: When protocol is https, expect PROXY protocol headers after TLS negotiation.
286287
- `PROXY_PROTOCOL_HEADER_TIMEOUT`: **5s**: Timeout to wait for PROXY protocol header (set to 0 to have no timeout)
@@ -616,7 +617,7 @@ And the following unique queues:
616617
- `REQUIRE_SIGNIN_VIEW`: **false**: Enable this to force users to log in to view any page or to use API.
617618
- `ENABLE_NOTIFY_MAIL`: **false**: Enable this to send e-mail to watchers of a repository when
618619
something happens, like creating issues. Requires `Mailer` to be enabled.
619-
- `ENABLE_BASIC_AUTHENTICATION`: **true**: Disable this to disallow authenticaton using HTTP
620+
- `ENABLE_BASIC_AUTHENTICATION`: **true**: Disable this to disallow authentication using HTTP
620621
BASIC and the user's password. Please note if you disable this you will not be able to access the
621622
tokens API endpoints using a password. Further, this only disables BASIC authentication using the
622623
password - not tokens or OAuth Basic.
@@ -1276,7 +1277,7 @@ Default storage configuration for attachments, lfs, avatars, repo-avatars, repo-
12761277
- `MINIO_USE_SSL`: **false**: Minio enabled ssl only available when `STORAGE_TYPE` is `minio`
12771278
- `MINIO_INSECURE_SKIP_VERIFY`: **false**: Minio skip SSL verification available when STORAGE_TYPE is `minio`
12781279

1279-
The recommanded storage configuration for minio like below:
1280+
The recommended storage configuration for minio like below:
12801281

12811282
```ini
12821283
[storage]
@@ -1400,7 +1401,7 @@ Please note that using `self` is not recommended for most cases, as it could mak
14001401
Additionally, it requires you to mirror all the actions you need to your Gitea instance, which may not be worth it.
14011402
Therefore, please use `self` only if you understand what you are doing.
14021403

1403-
In earlier versions (<= 1.19), `DEFAULT_ACTIONS_URL` cound be set to any custom URLs like `https://gitea.com` or `http://your-git-server,https://gitea.com`, and the default value was `https://gitea.com`.
1404+
In earlier versions (<= 1.19), `DEFAULT_ACTIONS_URL` could be set to any custom URLs like `https://gitea.com` or `http://your-git-server,https://gitea.com`, and the default value was `https://gitea.com`.
14041405
However, later updates removed those options, and now the only options are `github` and `self`, with the default value being `github`.
14051406
However, if you want to use actions from other git server, you can use a complete URL in `uses` field, it's supported by Gitea (but not GitHub).
14061407
Like `uses: https://gitea.com/actions/checkout@v3` or `uses: http://your-git-server/actions/checkout@v3`.

docs/content/installation/upgrade-from-gitea.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ If you are using cloud services or filesystems with snapshot feature,
6565
a snapshot for the Gitea data volume and related object storage is more convenient.
6666

6767
After all of steps have been prepared, download the new version, stop the application, perform a backup and
68-
then start the new application. On each startup, Gitea verifies that the database is up to date and will automtically
68+
then start the new application. On each startup, Gitea verifies that the database is up to date and will automatically
6969
perform any necessary migrations. Depending on the size of the database, this can take some additional time on the
7070
first launch during which the application will be unavailable.
7171

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ require (
121121
mvdan.cc/xurls/v2 v2.5.0
122122
strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251
123123
xorm.io/builder v0.3.13
124-
xorm.io/xorm v1.3.3
124+
xorm.io/xorm v1.3.4-0.20231017094142-dbe499091a7e
125125
)
126126

127127
require (

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1648,5 +1648,5 @@ strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251/go.mod h1:
16481648
xorm.io/builder v0.3.11-0.20220531020008-1bd24a7dc978/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE=
16491649
xorm.io/builder v0.3.13 h1:a3jmiVVL19psGeXx8GIurTp7p0IIgqeDmwhcR6BAOAo=
16501650
xorm.io/builder v0.3.13/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE=
1651-
xorm.io/xorm v1.3.3 h1:L5/GOhvgMcwJYYRjzPf3lTTTf6JcaTd1Mb9A/Iqvccw=
1652-
xorm.io/xorm v1.3.3/go.mod h1:qFJGFoVYbbIdnz2vaL5OxSQ2raleMpyRRalnq3n9OJo=
1651+
xorm.io/xorm v1.3.4-0.20231017094142-dbe499091a7e h1:oL+ktEW+iSrCXU6IauJ9csZFATEmawkhsq/MAoHTdwo=
1652+
xorm.io/xorm v1.3.4-0.20231017094142-dbe499091a7e/go.mod h1:qFJGFoVYbbIdnz2vaL5OxSQ2raleMpyRRalnq3n9OJo=

models/actions/main_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2023 The Gitea Authors. All rights reserved.
2+
// SPDX-License-Identifier: MIT
3+
4+
package actions
5+
6+
import (
7+
"testing"
8+
9+
"code.gitea.io/gitea/models/unittest"
10+
)
11+
12+
func TestMain(m *testing.M) {
13+
unittest.MainTest(m, &unittest.TestOptions{
14+
FixtureFiles: []string{
15+
"action_runner_token.yml",
16+
},
17+
})
18+
}

0 commit comments

Comments
 (0)