Skip to content

Commit 6397195

Browse files
committed
Merge remote-tracking branch 'upstream/main'
* upstream/main: Update upgrade documentation to add a check for deprecated configurations (go-gitea#26451) Fall back to esbuild for css minify (go-gitea#26445) Update JS dependencies (go-gitea#26449) Call git.InitSimple for runRepoSyncReleases (go-gitea#26396) Target specific OS for devcontainer base image (go-gitea#26422) Lock go to 1.21 on CI (go-gitea#26433) Always show usernames in reaction tooltips (go-gitea#26444) Fix incorrect redirection in new issue using references (go-gitea#26440) Fix the display of orgs listed in user profile (go-gitea#26424) minio: add missing region on client initialization (go-gitea#26412) Fix wrong middleware sequence (go-gitea#26428)
2 parents 4115a88 + 7e382a5 commit 6397195

File tree

18 files changed

+601
-528
lines changed

18 files changed

+601
-528
lines changed

.devcontainer/devcontainer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Gitea DevContainer",
3-
"image": "mcr.microsoft.com/devcontainers/go:1.20",
3+
"image": "mcr.microsoft.com/devcontainers/go:1.20-bullseye",
44
"features": {
55
// installs nodejs into container
66
"ghcr.io/devcontainers/features/node:1": {

.github/workflows/cron-licenses.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v3
1414
- uses: actions/setup-go@v4
1515
with:
16-
go-version: ">=1.20"
16+
go-version: "~1.21"
1717
check-latest: true
1818
- run: make generate-license generate-gitignore
1919
timeout-minutes: 40

.github/workflows/pull-compliance.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- uses: actions/checkout@v3
2020
- uses: actions/setup-go@v4
2121
with:
22-
go-version: ">=1.20"
22+
go-version: "~1.21"
2323
check-latest: true
2424
- run: make deps-backend deps-tools
2525
- run: make lint-backend
@@ -59,7 +59,7 @@ jobs:
5959
- uses: actions/checkout@v3
6060
- uses: actions/setup-go@v4
6161
with:
62-
go-version: ">=1.20"
62+
go-version: "~1.21"
6363
check-latest: true
6464
- run: make deps-backend deps-tools
6565
- run: make lint-go-windows lint-go-vet
@@ -76,7 +76,7 @@ jobs:
7676
- uses: actions/checkout@v3
7777
- uses: actions/setup-go@v4
7878
with:
79-
go-version: ">=1.20"
79+
go-version: "~1.21"
8080
check-latest: true
8181
- run: make deps-backend deps-tools
8282
- run: make lint-go
@@ -91,7 +91,7 @@ jobs:
9191
- uses: actions/checkout@v3
9292
- uses: actions/setup-go@v4
9393
with:
94-
go-version: ">=1.20"
94+
go-version: "~1.21"
9595
check-latest: true
9696
- run: make deps-backend deps-tools
9797
- run: make --always-make checks-backend # ensure the "go-licenses" make target runs
@@ -119,7 +119,7 @@ jobs:
119119
- uses: actions/checkout@v3
120120
- uses: actions/setup-go@v4
121121
with:
122-
go-version: ">=1.20"
122+
go-version: "~1.21"
123123
check-latest: true
124124
# no frontend build here as backend should be able to build
125125
# even without any frontend files

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- uses: actions/checkout@v3
4242
- uses: actions/setup-go@v4
4343
with:
44-
go-version: ">=1.20"
44+
go-version: "~1.21"
4545
check-latest: true
4646
- name: Add hosts to /etc/hosts
4747
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 pgsql ldap minio" | sudo tee -a /etc/hosts'
@@ -66,7 +66,7 @@ jobs:
6666
- uses: actions/checkout@v3
6767
- uses: actions/setup-go@v4
6868
with:
69-
go-version: ">=1.20"
69+
go-version: "~1.21"
7070
check-latest: true
7171
- run: make deps-backend
7272
- run: make backend
@@ -131,7 +131,7 @@ jobs:
131131
- uses: actions/checkout@v3
132132
- uses: actions/setup-go@v4
133133
with:
134-
go-version: ">=1.20"
134+
go-version: "~1.21"
135135
check-latest: true
136136
- name: Add hosts to /etc/hosts
137137
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql elasticsearch meilisearch smtpimap" | sudo tee -a /etc/hosts'
@@ -181,7 +181,7 @@ jobs:
181181
- uses: actions/checkout@v3
182182
- uses: actions/setup-go@v4
183183
with:
184-
go-version: ">=1.20"
184+
go-version: "~1.21"
185185
check-latest: true
186186
- name: Add hosts to /etc/hosts
187187
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql elasticsearch smtpimap" | sudo tee -a /etc/hosts'
@@ -213,7 +213,7 @@ jobs:
213213
- uses: actions/checkout@v3
214214
- uses: actions/setup-go@v4
215215
with:
216-
go-version: ">=1.20"
216+
go-version: "~1.21"
217217
check-latest: true
218218
- name: Add hosts to /etc/hosts
219219
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql8" | sudo tee -a /etc/hosts'
@@ -244,7 +244,7 @@ jobs:
244244
- uses: actions/checkout@v3
245245
- uses: actions/setup-go@v4
246246
with:
247-
go-version: ">=1.20"
247+
go-version: "~1.21"
248248
check-latest: true
249249
- name: Add hosts to /etc/hosts
250250
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mssql" | sudo tee -a /etc/hosts'

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- uses: actions/checkout@v3
2020
- uses: actions/setup-go@v4
2121
with:
22-
go-version: ">=1.20"
22+
go-version: "~1.21"
2323
check-latest: true
2424
- uses: actions/setup-node@v3
2525
with:

.github/workflows/release-nightly.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- run: git fetch --unshallow --quiet --tags --force
1515
- uses: actions/setup-go@v4
1616
with:
17-
go-version: ">=1.20"
17+
go-version: "~1.21"
1818
check-latest: true
1919
- uses: actions/setup-node@v3
2020
with:

cmd/admin.go

+4
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,10 @@ func runRepoSyncReleases(_ *cli.Context) error {
355355
return err
356356
}
357357

358+
if err := git.InitSimple(ctx); err != nil {
359+
return err
360+
}
361+
358362
log.Trace("Synchronizing repository releases (this may take a while)")
359363
for page := 1; ; page++ {
360364
repos, count, err := repo_model.SearchRepositoryByName(ctx, &repo_model.SearchRepoOptions{

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

+13-4
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,20 @@ menu:
1717

1818
# Upgrade from an old Gitea
1919

20-
To update Gitea, download a newer version, stop the old one, perform a backup, and run the new one.
21-
Every time a Gitea instance starts up, it checks whether a database migration should be run.
22-
If a database migration is required, Gitea will take some time to complete the upgrade and then serve.
20+
Follow below steps to ensure a smooth upgrade to a new Gitea version.
2321

2422
## Check the Changelog for breaking changes
2523

2624
To make Gitea better, some breaking changes are unavoidable, especially for big milestone releases.
27-
Before upgrade, please read the [Changelog on Gitea blog](https://blog.gitea.io/)
25+
Before upgrading, please read the [Changelog on Gitea blog](https://blog.gitea.com/)
2826
and check whether the breaking changes affect your Gitea instance.
2927

28+
## Verify there are no deprecated configuration options
29+
30+
New versions of Gitea often come with changed configuration syntax or options which are usually displayed for
31+
at least one release cycle inside at the top of the Site Administration panel. If these warnings are not
32+
resolved, Gitea may refuse to start in the following version.
33+
3034
## Backup for downgrade
3135

3236
Gitea keeps compatibility for patch versions whose first two fields are the same (`a.b.x` -> `a.b.y`),
@@ -60,6 +64,11 @@ Backup steps:
6064
If you are using cloud services or filesystems with snapshot feature,
6165
a snapshot for the Gitea data volume and related object storage is more convenient.
6266

67+
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
69+
perform any necessary migrations. Depending on the size of the database, this can take some additional time on the
70+
first launch during which the application will be unavailable.
71+
6372
## Upgrade with Docker
6473

6574
* `docker pull` the latest Gitea release.

docs/content/installation/upgrade-from-gitea.zh-cn.md

+12-4
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,20 @@ menu:
1515

1616
# 从旧版 Gitea 升级
1717

18-
想要升级 Gitea,只需要下载新版,停止运行旧版,进行数据备份,然后运行新版就好。
19-
每次 Gitea 实例启动时,它都会检查是否要进行数据库迁移。
20-
如果需要进行数据库迁移,Gitea 会花一些时间完成升级然后继续服务。
18+
在升级之前,您需要做如下的准备工作。
2119

2220
## 为重大变更检查更新日志
2321

2422
为了让 Gitea 变得更好,进行重大变更是不可避免的,尤其是一些里程碑更新的发布。
25-
在更新前,请 [在 Gitea 博客上阅读更新日志](https://blog.gitea.io/)
23+
在更新前,请 [在 Gitea 博客上阅读更新日志](https://blog.gitea.com/)
2624
并检查重大变更是否会影响你的 Gitea 实例。
2725

26+
## 在控制面板中检查过期的配置项
27+
28+
一些配置项可能会在后续版本中过期,你需要在控制面板中检查他们。如果不解决过期的配置项,
29+
Gitea也许会在升级后无法重启。你可以访问 https://docs.gitea.com 获得要升级的版本
30+
对应的文档来修改你的配置文件。
31+
2832
## 降级前的备份
2933

3034
Gitea 会保留首二位版本号相同的版本的兼容性 (`a.b.x` -> `a.b.y`),
@@ -56,6 +60,10 @@ Gitea 会保留首二位版本号相同的版本的兼容性 (`a.b.x` -> `a.b.y`
5660
如果你在使用云服务或拥有快照功能的文件系统,
5761
最好对 Gitea 的数据盘及相关资料存储进行一次快照。
5862

63+
在所有上述步骤准备妥当之后,要升级 Gitea,只需要下载新版,停止运行旧版,进行数据备份,然后运行新版就好。
64+
每次 Gitea 实例启动时,它都会检查是否要进行数据库迁移。
65+
如果需要进行数据库迁移,Gitea 会花一些时间完成升级然后继续服务。
66+
5967
## 从 Docker 升级
6068

6169
* `docker pull` 拉取 Gitea 的最新发布版。

models/issues/reaction.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ func (list ReactionList) GetFirstUsers() string {
377377
if buffer.Len() > 0 {
378378
buffer.WriteString(", ")
379379
}
380-
buffer.WriteString(reaction.User.DisplayName())
380+
buffer.WriteString(reaction.User.Name)
381381
if rem--; rem == 0 {
382382
break
383383
}

models/issues/reaction_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func TestIssueReactionCount(t *testing.T) {
109109
reactions := reactionsList.GroupByType()
110110
assert.Len(t, reactions["heart"], 4)
111111
assert.Equal(t, 2, reactions["heart"].GetMoreUserCount())
112-
assert.Equal(t, user1.DisplayName()+", "+user2.DisplayName(), reactions["heart"].GetFirstUsers())
112+
assert.Equal(t, user1.Name+", "+user2.Name, reactions["heart"].GetFirstUsers())
113113
assert.True(t, reactions["heart"].HasUser(1))
114114
assert.False(t, reactions["heart"].HasUser(5))
115115
assert.False(t, reactions["heart"].HasUser(0))

modules/storage/minio.go

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ func NewMinioStorage(ctx context.Context, cfg *setting.Storage) (ObjectStorage,
8484
Creds: credentials.NewStaticV4(config.AccessKeyID, config.SecretAccessKey, ""),
8585
Secure: config.UseSSL,
8686
Transport: &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: config.InsecureSkipVerify}},
87+
Region: config.Location,
8788
})
8889
if err != nil {
8990
return nil, convertMinioErr(err)

0 commit comments

Comments
 (0)