Skip to content

Commit 0cd3dad

Browse files
committed
Merge branch 'main' into lunny/commit_status_webhook
2 parents 598d58c + 29a8c8d commit 0cd3dad

File tree

214 files changed

+4746
-3148
lines changed

Some content is hidden

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

214 files changed

+4746
-3148
lines changed

.github/workflows/files-changed.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ jobs:
4848
- "Makefile"
4949
- ".golangci.yml"
5050
- ".editorconfig"
51+
- "options/locale/locale_en-US.ini"
5152
5253
frontend:
5354
- "**/*.js"

.github/workflows/pull-db-tests.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ jobs:
4949
- run: make backend
5050
env:
5151
TAGS: bindata
52-
- run: make test-pgsql-migration test-pgsql
52+
- name: run migration tests
53+
run: make test-pgsql-migration
54+
- name: run tests
55+
run: make test-pgsql
5356
timeout-minutes: 50
5457
env:
5558
TAGS: bindata gogit
@@ -72,7 +75,10 @@ jobs:
7275
- run: make backend
7376
env:
7477
TAGS: bindata gogit sqlite sqlite_unlock_notify
75-
- run: make test-sqlite-migration test-sqlite
78+
- name: run migration tests
79+
run: make test-sqlite-migration
80+
- name: run tests
81+
run: make test-sqlite
7682
timeout-minutes: 50
7783
env:
7884
TAGS: bindata gogit sqlite sqlite_unlock_notify
@@ -175,8 +181,10 @@ jobs:
175181
- run: make backend
176182
env:
177183
TAGS: bindata
184+
- name: run migration tests
185+
run: make test-mysql-migration
178186
- name: run tests
179-
run: make test-mysql-migration integration-test-coverage
187+
run: make integration-test-coverage
180188
env:
181189
TAGS: bindata
182190
RACE_ENABLED: true
@@ -208,7 +216,9 @@ jobs:
208216
- run: make backend
209217
env:
210218
TAGS: bindata
211-
- run: make test-mssql-migration test-mssql
219+
- run: make test-mssql-migration
220+
- name: run tests
221+
run: make test-mssql
212222
timeout-minutes: 50
213223
env:
214224
TAGS: bindata

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ We assume in good faith that the information you provide is legally binding.
464464
We adopted a release schedule to streamline the process of working on, finishing, and issuing releases. \
465465
The overall goal is to make a major release every three or four months, which breaks down into two or three months of general development followed by one month of testing and polishing known as the release freeze. \
466466
All the feature pull requests should be
467-
merged before feature freeze. And, during the frozen period, a corresponding
467+
merged before feature freeze. All feature pull requests haven't been merged before this feature freeze will be moved to next milestone, please notice our feature freeze announcement on discord. And, during the frozen period, a corresponding
468468
release branch is open for fixes backported from main branch. Release candidates
469469
are made during this period for user testing to
470470
obtain a final version that is maintained in this branch.

Makefile

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ LINUX_ARCHS ?= linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64
115115

116116
GO_PACKAGES ?= $(filter-out code.gitea.io/gitea/tests/integration/migration-test code.gitea.io/gitea/tests code.gitea.io/gitea/tests/integration code.gitea.io/gitea/tests/e2e,$(shell $(GO) list ./... | grep -v /vendor/))
117117
GO_TEST_PACKAGES ?= $(filter-out $(shell $(GO) list code.gitea.io/gitea/models/migrations/...) code.gitea.io/gitea/tests/integration/migration-test code.gitea.io/gitea/tests code.gitea.io/gitea/tests/integration code.gitea.io/gitea/tests/e2e,$(shell $(GO) list ./... | grep -v /vendor/))
118+
MIGRATE_TEST_PACKAGES ?= $(shell $(GO) list code.gitea.io/gitea/models/migrations/...)
118119

119120
FOMANTIC_WORK_DIR := web_src/fomantic
120121

@@ -147,6 +148,7 @@ GO_DIRS := build cmd models modules routers services tests
147148
WEB_DIRS := web_src/js web_src/css
148149

149150
SPELLCHECK_FILES := $(GO_DIRS) $(WEB_DIRS) docs/content templates options/locale/locale_en-US.ini .github
151+
EDITORCONFIG_FILES := templates .github/workflows options/locale/locale_en-US.ini
150152

151153
GO_SOURCES := $(wildcard *.go)
152154
GO_SOURCES += $(shell find $(GO_DIRS) -type f -name "*.go" ! -path modules/options/bindata.go ! -path modules/public/bindata.go ! -path modules/templates/bindata.go)
@@ -426,7 +428,7 @@ lint-go-vet:
426428

427429
.PHONY: lint-editorconfig
428430
lint-editorconfig:
429-
$(GO) run $(EDITORCONFIG_CHECKER_PACKAGE) templates .github/workflows
431+
@$(GO) run $(EDITORCONFIG_CHECKER_PACKAGE) $(EDITORCONFIG_FILES)
430432

431433
.PHONY: lint-actions
432434
lint-actions:
@@ -709,40 +711,31 @@ migrations.sqlite.test: $(GO_SOURCES) generate-ini-sqlite
709711

710712
.PHONY: migrations.individual.mysql.test
711713
migrations.individual.mysql.test: $(GO_SOURCES)
712-
for pkg in $(shell $(GO) list code.gitea.io/gitea/models/migrations/...); do \
713-
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg; \
714-
done
714+
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GO) test $(GOTESTFLAGS) -tags='$(TEST_TAGS)' -p 1 $(MIGRATE_TEST_PACKAGES)
715715

716716
.PHONY: migrations.individual.sqlite.test\#%
717717
migrations.individual.sqlite.test\#%: $(GO_SOURCES) generate-ini-sqlite
718718
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$*
719719

720720
.PHONY: migrations.individual.pgsql.test
721721
migrations.individual.pgsql.test: $(GO_SOURCES)
722-
for pkg in $(shell $(GO) list code.gitea.io/gitea/models/migrations/...); do \
723-
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg; \
724-
done
722+
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GO) test $(GOTESTFLAGS) -tags='$(TEST_TAGS)' -p 1 $(MIGRATE_TEST_PACKAGES)
725723

726724
.PHONY: migrations.individual.pgsql.test\#%
727725
migrations.individual.pgsql.test\#%: $(GO_SOURCES) generate-ini-pgsql
728726
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$*
729727

730-
731728
.PHONY: migrations.individual.mssql.test
732729
migrations.individual.mssql.test: $(GO_SOURCES) generate-ini-mssql
733-
for pkg in $(shell $(GO) list code.gitea.io/gitea/models/migrations/...); do \
734-
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mssql.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg -test.failfast; \
735-
done
730+
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mssql.ini $(GO) test $(GOTESTFLAGS) -tags='$(TEST_TAGS)' -p 1 $(MIGRATE_TEST_PACKAGES)
736731

737732
.PHONY: migrations.individual.mssql.test\#%
738733
migrations.individual.mssql.test\#%: $(GO_SOURCES) generate-ini-mssql
739734
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mssql.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$*
740735

741736
.PHONY: migrations.individual.sqlite.test
742737
migrations.individual.sqlite.test: $(GO_SOURCES) generate-ini-sqlite
743-
for pkg in $(shell $(GO) list code.gitea.io/gitea/models/migrations/...); do \
744-
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg; \
745-
done
738+
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GO) test $(GOTESTFLAGS) -tags='$(TEST_TAGS)' -p 1 $(MIGRATE_TEST_PACKAGES)
746739

747740
.PHONY: migrations.individual.sqlite.test\#%
748741
migrations.individual.sqlite.test\#%: $(GO_SOURCES) generate-ini-sqlite
@@ -908,6 +901,7 @@ fomantic:
908901
cd $(FOMANTIC_WORK_DIR) && npm install --no-save
909902
cp -f $(FOMANTIC_WORK_DIR)/theme.config.less $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/theme.config
910903
cp -rf $(FOMANTIC_WORK_DIR)/_site $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/
904+
$(SED_INPLACE) -e 's/ overrideBrowserslist\r/ overrideBrowserslist: ["defaults"]\r/g' $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/tasks/config/tasks.js
911905
cd $(FOMANTIC_WORK_DIR) && npx gulp -f node_modules/fomantic-ui/gulpfile.js build
912906
# fomantic uses "touchstart" as click event for some browsers, it's not ideal, so we force fomantic to always use "click" as click event
913907
$(SED_INPLACE) -e 's/clickEvent[ \t]*=/clickEvent = "click", unstableClickEvent =/g' $(FOMANTIC_WORK_DIR)/build/semantic.js

cmd/admin_regenerate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
package cmd
55

66
import (
7-
asymkey_model "code.gitea.io/gitea/models/asymkey"
87
"code.gitea.io/gitea/modules/graceful"
8+
asymkey_service "code.gitea.io/gitea/services/asymkey"
99
repo_service "code.gitea.io/gitea/services/repository"
1010

1111
"github.com/urfave/cli/v2"
@@ -42,5 +42,5 @@ func runRegenerateKeys(_ *cli.Context) error {
4242
if err := initDB(ctx); err != nil {
4343
return err
4444
}
45-
return asymkey_model.RewriteAllPublicKeys(ctx)
45+
return asymkey_service.RewriteAllPublicKeys(ctx)
4646
}

docs/content/administration/mail-templates.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ Please check [Gitea's logs](administration/logging-config.md) for error messages
224224
{{if not (eq .Body "")}}
225225
<h3>Message content</h3>
226226
<hr>
227-
{{.Body | SanitizeHTML}}
227+
{{.Body}}
228228
{{end}}
229229
</p>
230230
<hr>

docs/content/administration/mail-templates.zh-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ _主题_ 和 _邮件正文_ 由 [Golang的模板引擎](https://go.dev/pkg/text/
207207
{{if not (eq .Body "")}}
208208
<h3>消息内容:</h3>
209209
<hr>
210-
{{.Body | SanitizeHTML}}
210+
{{.Body}}
211211
{{end}}
212212
</p>
213213
<hr>

docs/content/contributing/guidelines-frontend.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ We recommend [Google HTML/CSS Style Guide](https://google.github.io/styleguide/h
4747
9. Avoid unnecessary `!important` in CSS, add comments to explain why it's necessary if it can't be avoided.
4848
10. Avoid mixing different events in one event listener, prefer to use individual event listeners for every event.
4949
11. Custom event names are recommended to use `ce-` prefix.
50-
12. Gitea's tailwind-style CSS classes use `gt-` prefix (`gt-relative`), while Gitea's own private framework-level CSS classes use `g-` prefix (`g-modal-confirm`).
50+
12. Prefer using Tailwind CSS which is available via `tw-` prefix, e.g. `tw-relative`. Gitea's helper CSS classes use `gt-` prefix (`gt-df`), while Gitea's own private framework-level CSS classes use `g-` prefix (`g-modal-confirm`).
5151
13. Avoid inline scripts & styles as much as possible, it's recommended to put JS code into JS files and use CSS classes. If inline scripts & styles are unavoidable, explain the reason why it can't be avoided.
5252

5353
### Accessibility / ARIA

docs/content/contributing/guidelines-frontend.zh-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ HTML 页面由[Go HTML Template](https://pkg.go.dev/html/template)渲染。
4747
9. 避免在 CSS 中使用不必要的`!important`,如果无法避免,添加注释解释为什么需要它。
4848
10. 避免在一个事件监听器中混合不同的事件,优先为每个事件使用独立的事件监听器。
4949
11. 推荐使用自定义事件名称前缀`ce-`
50-
12. Gitea 的 tailwind-style CSS 类使用`gt-`前缀(`gt-relative`),Gitea 自身的私有框架级 CSS 类使用`g-`前缀(`g-modal-confirm`)。
50+
12. 建议使用 Tailwind CSS,它可以通过 `tw-` 前缀获得,例如 `tw-relative`. Gitea 自身的助手类 CSS 使用 `gt-` 前缀(`gt-df`),Gitea 自身的私有框架级 CSS 类使用 `g-` 前缀(`g-modal-confirm`)。
5151
13. 尽量避免内联脚本和样式,建议将JS代码放入JS文件中并使用CSS类。如果内联脚本和样式不可避免,请解释无法避免的原因。
5252

5353
### 可访问性 / ARIA

go.mod

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ require (
4949
github.com/go-ldap/ldap/v3 v3.4.6
5050
github.com/go-sql-driver/mysql v1.7.1
5151
github.com/go-swagger/go-swagger v0.30.5
52-
github.com/go-testfixtures/testfixtures/v3 v3.9.0
52+
github.com/go-testfixtures/testfixtures/v3 v3.10.0
5353
github.com/go-webauthn/webauthn v0.10.0
5454
github.com/gobwas/glob v0.2.3
5555
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f
5656
github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85
5757
github.com/golang-jwt/jwt/v5 v5.2.0
5858
github.com/google/go-github/v57 v57.0.0
5959
github.com/google/pprof v0.0.0-20240117000934-35fc243c5815
60-
github.com/google/uuid v1.5.0
60+
github.com/google/uuid v1.6.0
6161
github.com/gorilla/feeds v1.1.2
6262
github.com/gorilla/sessions v1.2.2
6363
github.com/hashicorp/go-version v1.6.0
@@ -73,7 +73,7 @@ require (
7373
github.com/lib/pq v1.10.9
7474
github.com/markbates/goth v1.78.0
7575
github.com/mattn/go-isatty v0.0.20
76-
github.com/mattn/go-sqlite3 v1.14.19
76+
github.com/mattn/go-sqlite3 v1.14.22
7777
github.com/meilisearch/meilisearch-go v0.26.1
7878
github.com/mholt/archiver/v3 v3.5.1
7979
github.com/microcosm-cc/bluemonday v1.0.26
@@ -113,7 +113,7 @@ require (
113113
golang.org/x/text v0.14.0
114114
golang.org/x/tools v0.17.0
115115
google.golang.org/grpc v1.60.1
116-
google.golang.org/protobuf v1.32.0
116+
google.golang.org/protobuf v1.33.0
117117
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
118118
gopkg.in/ini.v1 v1.67.0
119119
gopkg.in/yaml.v3 v3.0.1
@@ -129,7 +129,7 @@ require (
129129
dario.cat/mergo v1.0.0 // indirect
130130
git.sr.ht/~mariusor/go-xsd-duration v0.0.0-20220703122237-02e73435a078 // indirect
131131
github.com/ClickHouse/ch-go v0.61.1 // indirect
132-
github.com/ClickHouse/clickhouse-go/v2 v2.17.1 // indirect
132+
github.com/ClickHouse/clickhouse-go/v2 v2.18.0 // indirect
133133
github.com/DataDog/zstd v1.5.5 // indirect
134134
github.com/Masterminds/goutils v1.1.1 // indirect
135135
github.com/Masterminds/semver/v3 v3.2.1 // indirect
@@ -241,7 +241,7 @@ require (
241241
github.com/oklog/ulid v1.3.1 // indirect
242242
github.com/olekukonko/tablewriter v0.0.5 // indirect
243243
github.com/onsi/ginkgo v1.16.5 // indirect
244-
github.com/paulmach/orb v0.11.0 // indirect
244+
github.com/paulmach/orb v0.11.1 // indirect
245245
github.com/pelletier/go-toml/v2 v2.1.1 // indirect
246246
github.com/pierrec/lz4/v4 v4.1.21 // indirect
247247
github.com/pjbgf/sha1cd v0.3.0 // indirect

0 commit comments

Comments
 (0)