Skip to content

Commit 40caf99

Browse files
authored
Merge branch 'main' into squash-merge-msg
2 parents b09ada6 + e96ef97 commit 40caf99

File tree

12 files changed

+359
-308
lines changed

12 files changed

+359
-308
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ AIR_PACKAGE ?= github.com/air-verse/air@v1
2929
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/v3/cmd/editorconfig-checker@v3
3030
GOFUMPT_PACKAGE ?= mvdan.cc/[email protected]
3131
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/v2/cmd/[email protected]
32-
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/[email protected].12
32+
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/[email protected].15
3333
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/[email protected]
3434
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/[email protected]
3535
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest

assets/go-licenses.json

Lines changed: 27 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contrib/backport/backport.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"strconv"
1717
"strings"
1818

19-
"github.com/google/go-github/v71/github"
19+
"github.com/google/go-github/v74/github"
2020
"github.com/urfave/cli/v3"
2121
"gopkg.in/yaml.v3"
2222
)

go.mod

Lines changed: 91 additions & 84 deletions
Large diffs are not rendered by default.

go.sum

Lines changed: 190 additions & 182 deletions
Large diffs are not rendered by default.

modules/indexer/issues/meilisearch/meilisearch.go

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
indexer_internal "code.gitea.io/gitea/modules/indexer/internal"
1515
inner_meilisearch "code.gitea.io/gitea/modules/indexer/internal/meilisearch"
1616
"code.gitea.io/gitea/modules/indexer/issues/internal"
17+
"code.gitea.io/gitea/modules/json"
1718

1819
"github.com/meilisearch/meilisearch-go"
1920
)
@@ -106,7 +107,8 @@ func (b *Indexer) Index(_ context.Context, issues ...*internal.IndexerData) erro
106107
return nil
107108
}
108109
for _, issue := range issues {
109-
_, err := b.inner.Client.Index(b.inner.VersionedIndexName()).AddDocuments(issue)
110+
// use default primary key which should be "id"
111+
_, err := b.inner.Client.Index(b.inner.VersionedIndexName()).AddDocuments(issue, nil)
110112
if err != nil {
111113
return err
112114
}
@@ -299,18 +301,13 @@ func doubleQuoteKeyword(k string) string {
299301
func convertHits(searchRes *meilisearch.SearchResponse) ([]internal.Match, error) {
300302
hits := make([]internal.Match, 0, len(searchRes.Hits))
301303
for _, hit := range searchRes.Hits {
302-
hit, ok := hit.(map[string]any)
303-
if !ok {
304-
return nil, ErrMalformedResponse
305-
}
306-
307-
issueID, ok := hit["id"].(float64)
308-
if !ok {
304+
var issueID int64
305+
if err := json.Unmarshal(hit["id"], &issueID); err != nil {
309306
return nil, ErrMalformedResponse
310307
}
311308

312309
hits = append(hits, internal.Match{
313-
ID: int64(issueID),
310+
ID: issueID,
314311
})
315312
}
316313
return hits, nil

modules/indexer/issues/meilisearch/meilisearch_test.go

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212

1313
"code.gitea.io/gitea/modules/indexer/issues/internal"
1414
"code.gitea.io/gitea/modules/indexer/issues/internal/tests"
15+
"code.gitea.io/gitea/modules/json"
1516

1617
"github.com/meilisearch/meilisearch-go"
1718
"github.com/stretchr/testify/assert"
@@ -45,30 +46,42 @@ func TestMeilisearchIndexer(t *testing.T) {
4546
}
4647

4748
func TestConvertHits(t *testing.T) {
49+
convert := func(d any) []byte {
50+
b, _ := json.Marshal(d)
51+
return b
52+
}
53+
4854
_, err := convertHits(&meilisearch.SearchResponse{
49-
Hits: []any{"aa", "bb", "cc", "dd"},
55+
Hits: []meilisearch.Hit{
56+
{
57+
"aa": convert(1),
58+
"bb": convert(2),
59+
"cc": convert(3),
60+
"dd": convert(4),
61+
},
62+
},
5063
})
5164
assert.ErrorIs(t, err, ErrMalformedResponse)
5265

5366
validResponse := &meilisearch.SearchResponse{
54-
Hits: []any{
55-
map[string]any{
56-
"id": float64(11),
57-
"title": "a title",
58-
"content": "issue body with no match",
59-
"comments": []any{"hey whats up?", "I'm currently bowling", "nice"},
67+
Hits: []meilisearch.Hit{
68+
{
69+
"id": convert(float64(11)),
70+
"title": convert("a title"),
71+
"content": convert("issue body with no match"),
72+
"comments": convert([]any{"hey whats up?", "I'm currently bowling", "nice"}),
6073
},
61-
map[string]any{
62-
"id": float64(22),
63-
"title": "Bowling as title",
64-
"content": "",
65-
"comments": []any{},
74+
{
75+
"id": convert(float64(22)),
76+
"title": convert("Bowling as title"),
77+
"content": convert(""),
78+
"comments": convert([]any{}),
6679
},
67-
map[string]any{
68-
"id": float64(33),
69-
"title": "Bowl-ing as fuzzy match",
70-
"content": "",
71-
"comments": []any{},
80+
{
81+
"id": convert(float64(33)),
82+
"title": convert("Bowl-ing as fuzzy match"),
83+
"content": convert(""),
84+
"comments": convert([]any{}),
7285
},
7386
},
7487
}

options/locale/locale_zh-CN.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ error404=您正尝试访问的页面 <strong>不存在</strong> 或 <strong>您
120120
error503=服务器无法完成您的请求,请稍后重试。
121121
go_back=返回
122122
invalid_data=无效数据: %v
123+
nothing_has_been_changed=没有任何更改。
123124

124125
never=从不
125126
unknown=未知
@@ -2844,6 +2845,11 @@ settings.location=所在地区
28442845
settings.permission=权限
28452846
settings.repoadminchangeteam=仓库管理员可以添加或移除团队的访问权限
28462847
settings.visibility=可见性
2848+
settings.change_visibility=更改可见性
2849+
settings.change_visibility_notices_1=如果组织被转换为私有,仓库的所有点赞将被删除且无法恢复。
2850+
settings.change_visibility_notices_2=如果可见性更改为私有,非成员将无法访问该组织的仓库。
2851+
settings.change_visibility_success=组织 %s 的可见性已成功更改。
2852+
settings.visibility_desc=更改谁可以查看组织及其仓库。
28472853
settings.visibility.public=公开
28482854
settings.visibility.limited=受限 (仅对认证用户可见)
28492855
settings.visibility.limited_shortname=受限
@@ -3420,6 +3426,7 @@ config.picture_service=图片服务
34203426
config.disable_gravatar=禁用 Gravatar 头像
34213427
config.enable_federated_avatar=启用 Federated 头像
34223428
config.open_with_editor_app_help=用于克隆菜单的编辑器。如果为空将使用默认值。展开可以查看默认值。
3429+
config.git_guide_remote_name=指南中 git 命令使用的仓库远程名称
34233430

34243431
config.git_config=Git 配置
34253432
config.git_disable_diff_highlight=禁用差异对比语法高亮

services/migrations/error.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package migrations
77
import (
88
"errors"
99

10-
"github.com/google/go-github/v71/github"
10+
"github.com/google/go-github/v74/github"
1111
)
1212

1313
// ErrRepoNotCreated returns the error that repository not created

services/migrations/github.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"code.gitea.io/gitea/modules/proxy"
2121
"code.gitea.io/gitea/modules/structs"
2222

23-
"github.com/google/go-github/v71/github"
23+
"github.com/google/go-github/v74/github"
2424
"golang.org/x/oauth2"
2525
)
2626

0 commit comments

Comments
 (0)