From 707c69f399d311aaa11ca62a27293244e85cb043 Mon Sep 17 00:00:00 2001 From: delvh Date: Wed, 20 Sep 2023 22:28:17 +0200 Subject: [PATCH 01/12] Fix successful return value for `SyncAndGetUserSpecificDiff` (#27152) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A function should not return an error when it is successful. Otherwise, things like https://discord.com/channels/322538954119184384/322538954119184384/1153705341620600833 happen… --- services/gitdiff/gitdiff.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/gitdiff/gitdiff.go b/services/gitdiff/gitdiff.go index 4cc093e65debd..fd0f32717c4b6 100644 --- a/services/gitdiff/gitdiff.go +++ b/services/gitdiff/gitdiff.go @@ -1343,7 +1343,7 @@ outer: } } - return diff, err + return diff, nil } // CommentAsDiff returns c.Patch as *Diff From d7f73a1334ab7a97d4e055b7c58cdd9ac303f77a Mon Sep 17 00:00:00 2001 From: delvh Date: Wed, 20 Sep 2023 23:18:53 +0200 Subject: [PATCH 02/12] Start development on Gitea 1.22 (#27155) From 2001ffee3fa7e100c0829660a505fcb6044296d0 Mon Sep 17 00:00:00 2001 From: GiteaBot Date: Thu, 21 Sep 2023 00:22:27 +0000 Subject: [PATCH 03/12] [skip ci] Updated translations via Crowdin --- options/locale/locale_ja-JP.ini | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/options/locale/locale_ja-JP.ini b/options/locale/locale_ja-JP.ini index c78c6811b44b4..10e31697a76ce 100644 --- a/options/locale/locale_ja-JP.ini +++ b/options/locale/locale_ja-JP.ini @@ -2717,6 +2717,7 @@ dashboard.gc_lfs=LFSメタオブジェクトのガベージコレクション dashboard.stop_zombie_tasks=ゾンビタスクを停止 dashboard.stop_endless_tasks=終わらないタスクを停止 dashboard.cancel_abandoned_jobs=放置されたままのジョブをキャンセル +dashboard.start_schedule_tasks=スケジュールタスクを開始 users.user_manage_panel=ユーザーアカウント管理 users.new_account=ユーザーアカウントを作成 @@ -2725,6 +2726,9 @@ users.full_name=フルネーム users.activated=アクティベート済み users.admin=管理者 users.restricted=制限あり +users.reserved=予約済み +users.bot=Bot +users.remote=リモート users.2fa=2FA users.repos=リポジトリ users.created=作成日 @@ -2771,6 +2775,7 @@ users.list_status_filter.is_prohibit_login=ログインを禁止 users.list_status_filter.not_prohibit_login=ログインを許可 users.list_status_filter.is_2fa_enabled=2要素認証有効 users.list_status_filter.not_2fa_enabled=2要素認証無効 +users.details=ユーザーの詳細 emails.email_manage_panel=ユーザーメールアドレスの管理 emails.primary=プライマリー @@ -2806,6 +2811,7 @@ repos.size=サイズ packages.package_manage_panel=パッケージ管理 packages.total_size=合計サイズ: %s packages.unreferenced_size=非参照サイズ: %s +packages.cleanup=期限切れデータを掃除する packages.owner=オーナー packages.creator=作成者 packages.name=名前 @@ -2912,6 +2918,7 @@ auths.sspi_default_language=ユーザーのデフォルトの言語 auths.sspi_default_language_helper=SSPI認証処理によって自動的に作成されるユーザーのデフォルトの言語です。 言語を自動検出する方が良い場合は空のままにしてください。 auths.tips=ヒント auths.tips.oauth2.general=OAuth2認証 +auths.tips.oauth2.general.tip=新しいOAuth2認証を登録するときは、コールバック/リダイレクトURLは以下になります: auths.tip.oauth2_provider=OAuth2プロバイダー auths.tip.bitbucket=新しいOAuthコンシューマーを https://bitbucket.org/account/user/<あなたのユーザー名>/oauth-consumers/new から登録し、"アカウント" に "読み取り" 権限を追加してください。 auths.tip.nextcloud=新しいOAuthコンシューマーを、インスタンスのメニュー "Settings -> Security -> OAuth 2.0 client" から登録してください。 @@ -2952,6 +2959,7 @@ config.disable_router_log=ルーターのログが無効 config.run_user=実行ユーザー名 config.run_mode=実行モード config.git_version=Gitバージョン +config.app_data_path=Appデータパス config.repo_root_path=リポジトリのルートパス config.lfs_root_path=LFSルートパス config.log_file_root_path=ログの保存先パス From 14731a34ff4d854b8427fa3ca880f40bcd86e1e3 Mon Sep 17 00:00:00 2001 From: JakobDev Date: Thu, 21 Sep 2023 03:30:48 +0200 Subject: [PATCH 04/12] Add index to `issue_user.issue_id` (#27154) This fixes a performance bottleneck. It was discovered by Codeberg. Every where query on that table (which has grown big over time) uses this column, but there is no index on it. See this part of the log which was posted on Matrix: ``` 2023/09/10 00:52:01 ...rs/web/repo/issue.go:1446:ViewIssue() [W] [Slow SQL Query] UPDATE `issue_user` SET is_read=? WHERE uid=? AND issue_id=? [true x y] - 51.395434887s 2023/09/10 00:52:01 ...rs/web/repo/issue.go:1447:ViewIssue() [E] ReadBy: Error 1205 (HY000): Lock wait timeout exceeded; try restarting transaction 2023/09/10 00:52:01 ...eb/routing/logger.go:102:func1() [I] router: completed GET /Codeberg/Community/issues/1201 for [::ffff:xxx]:0, 500 Internal Server Error in 52384.2ms @ repo/issue.go:1256(repo.ViewIssue) ``` --- models/issues/issue_user.go | 2 +- models/migrations/migrations.go | 2 ++ models/migrations/v1_21/v277.go | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 models/migrations/v1_21/v277.go diff --git a/models/issues/issue_user.go b/models/issues/issue_user.go index d053b1d54350b..24bb74648d9ce 100644 --- a/models/issues/issue_user.go +++ b/models/issues/issue_user.go @@ -15,7 +15,7 @@ import ( type IssueUser struct { ID int64 `xorm:"pk autoincr"` UID int64 `xorm:"INDEX"` // User ID. - IssueID int64 + IssueID int64 `xorm:"INDEX"` IsRead bool IsMentioned bool } diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go index 3524077ea4b7c..38fff37bed066 100644 --- a/models/migrations/migrations.go +++ b/models/migrations/migrations.go @@ -534,6 +534,8 @@ var migrations = []Migration{ NewMigration("Add ScheduleID for ActionRun", v1_21.AddScheduleIDForActionRun), // v276 -> v277 NewMigration("Add RemoteAddress to mirrors", v1_21.AddRemoteAddressToMirrors), + // v277 -> v278 + NewMigration("Add Index to issue_user.issue_id", v1_21.AddIndexToIssueUserIssueID), } // GetCurrentDBVersion returns the current db version diff --git a/models/migrations/v1_21/v277.go b/models/migrations/v1_21/v277.go new file mode 100644 index 0000000000000..12529160b754b --- /dev/null +++ b/models/migrations/v1_21/v277.go @@ -0,0 +1,16 @@ +// Copyright 2023 The Gitea Authors. All rights reserved. +// SPDX-License-Identifier: MIT + +package v1_21 //nolint + +import ( + "xorm.io/xorm" +) + +func AddIndexToIssueUserIssueID(x *xorm.Engine) error { + type IssueUser struct { + IssueID int64 `xorm:"INDEX"` + } + + return x.Sync(new(IssueUser)) +} From e46274b5b478f821eb915348a28b114cd4b1eb0a Mon Sep 17 00:00:00 2001 From: Dionysios Kakouris <1369451+memphis88@users.noreply.github.com> Date: Thu, 21 Sep 2023 10:09:59 +0200 Subject: [PATCH 05/12] Fix organization field being null in POST /orgs/{orgid}/teams (#27150) Similarly to the fix in https://github.com/go-gitea/gitea/pull/24694, this addresses the team creation not returning the organization information in the response. This fix is connected to the [issue](https://gitea.com/gitea/terraform-provider-gitea/issues/27) discovered in the terraform provider. Moreover, the [documentation](https://docs.gitea.com/api/1.20/#tag/organization/operation/orgCreateTeam) suggests that the response body should include the `organization` field (currently being `null`). --- routers/api/v1/org/team.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/api/v1/org/team.go b/routers/api/v1/org/team.go index 519572ee51882..83cbfe68d0ff8 100644 --- a/routers/api/v1/org/team.go +++ b/routers/api/v1/org/team.go @@ -248,7 +248,7 @@ func CreateTeam(ctx *context.APIContext) { return } - apiTeam, err := convert.ToTeam(ctx, team) + apiTeam, err := convert.ToTeam(ctx, team, true) if err != nil { ctx.InternalServerError(err) return From 218e719ea86883bee75d02684d4bf07f95fa4f55 Mon Sep 17 00:00:00 2001 From: Nanguan Lin <70063547+lng2020@users.noreply.github.com> Date: Thu, 21 Sep 2023 17:03:13 +0800 Subject: [PATCH 06/12] Fix the variable regexp pattern on web page (#27161) same as (https://github.com/go-gitea/gitea/pull/26910) --- templates/shared/variables/variable_list.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/shared/variables/variable_list.tmpl b/templates/shared/variables/variable_list.tmpl index a9456321e4454..3a389ffaf823c 100644 --- a/templates/shared/variables/variable_list.tmpl +++ b/templates/shared/variables/variable_list.tmpl @@ -73,7 +73,7 @@ name="name" id="dialog-variable-name" value="{{.name}}" - pattern="^[a-zA-Z_][a-zA-Z0-9_]*$" + pattern="^(?!GITEA_|GITHUB_)[a-zA-Z_][a-zA-Z0-9_]*$" placeholder="{{.locale.Tr "secrets.creation.name_placeholder"}}" > From 2f8e1604f825ab862ba1b182dda47d9dee40aace Mon Sep 17 00:00:00 2001 From: Nanguan Lin <70063547+lng2020@users.noreply.github.com> Date: Thu, 21 Sep 2023 19:59:50 +0800 Subject: [PATCH 07/12] Fix review request number and add more tests (#27104) fix #27019 ## testfixture yml 1. add issue20(a pr issue) in repo 23, org 17 2. add user15 to team 9 3. add four reviews about issue20 ## test case add two tests that are described with code comments the code before pr #26784 failed the first test image current code failed the second test(as mentioned in #27019) image Any advice is appreciated. --------- Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com> Co-authored-by: Giteabot --- models/fixtures/issue.yml | 17 ++++++++++++ models/fixtures/pull_request.yml | 9 ++++++ models/fixtures/repository.yml | 2 +- models/fixtures/review.yml | 38 ++++++++++++++++++++++++++ models/fixtures/team.yml | 2 +- models/fixtures/team_user.yml | 6 ++++ models/issues/issue_search.go | 9 +++++- models/issues/issue_test.go | 2 +- modules/indexer/issues/indexer_test.go | 27 ++++++++++++++---- tests/integration/api_issue_test.go | 12 ++++---- tests/integration/api_nodeinfo_test.go | 2 +- tests/integration/issue_test.go | 12 ++++---- 12 files changed, 115 insertions(+), 23 deletions(-) diff --git a/models/fixtures/issue.yml b/models/fixtures/issue.yml index fa72f9b647da0..ccc1fe41fbd97 100644 --- a/models/fixtures/issue.yml +++ b/models/fixtures/issue.yml @@ -321,3 +321,20 @@ created_unix: 946684830 updated_unix: 978307200 is_locked: false + +- + id: 20 + repo_id: 23 + index: 1 + poster_id: 2 + original_author_id: 0 + name: issue for pr + content: content + milestone_id: 0 + priority: 0 + is_closed: false + is_pull: true + num_comments: 0 + created_unix: 978307210 + updated_unix: 978307210 + is_locked: false diff --git a/models/fixtures/pull_request.yml b/models/fixtures/pull_request.yml index e5589ac703d77..396bdba88cbc5 100644 --- a/models/fixtures/pull_request.yml +++ b/models/fixtures/pull_request.yml @@ -89,3 +89,12 @@ base_branch: main merge_base: cbff181af4c9c7fee3cf6c106699e07d9a3f54e6 has_merged: false + +- + id: 8 + type: 0 # gitea pull request + status: 2 # mergable + issue_id: 20 + index: 1 + head_repo_id: 23 + base_repo_id: 23 \ No newline at end of file diff --git a/models/fixtures/repository.yml b/models/fixtures/repository.yml index c63b7ebd48170..373c1caa6257a 100644 --- a/models/fixtures/repository.yml +++ b/models/fixtures/repository.yml @@ -679,7 +679,7 @@ num_forks: 0 num_issues: 0 num_closed_issues: 0 - num_pulls: 0 + num_pulls: 1 num_closed_pulls: 0 num_milestones: 0 num_closed_milestones: 0 diff --git a/models/fixtures/review.yml b/models/fixtures/review.yml index dda13dc468e47..f964c6ac06412 100644 --- a/models/fixtures/review.yml +++ b/models/fixtures/review.yml @@ -132,3 +132,41 @@ content: "singular review from org6 and final review for this pr" updated_unix: 946684831 created_unix: 946684831 + +- + id: 16 + type: 4 + reviewer_id: 20 + issue_id: 20 + content: "review request for user20" + updated_unix: 946684832 + created_unix: 946684832 + +- + id: 17 + type: 1 + reviewer_id: 20 + issue_id: 20 + content: "review approved by user20" + updated_unix: 946684833 + created_unix: 946684833 +- + id: 18 + type: 4 + reviewer_id: 0 + reviewer_team_id: 5 + issue_id: 20 + content: "review request for team5" + updated_unix: 946684834 + created_unix: 946684834 + +- + id: 19 + type: 4 + reviewer_id: 15 + reviewer_team_id: 0 + issue_id: 20 + content: "review request for user15" + updated_unix: 946684835 + created_unix: 946684835 + diff --git a/models/fixtures/team.yml b/models/fixtures/team.yml index 65326eedbf476..295e51e39ce94 100644 --- a/models/fixtures/team.yml +++ b/models/fixtures/team.yml @@ -93,7 +93,7 @@ name: review_team authorize: 1 # read num_repos: 1 - num_members: 2 + num_members: 3 includes_all_repositories: false can_create_org_repo: false diff --git a/models/fixtures/team_user.yml b/models/fixtures/team_user.yml index feace5f2a531d..a5f1e9fd92aaf 100644 --- a/models/fixtures/team_user.yml +++ b/models/fixtures/team_user.yml @@ -123,3 +123,9 @@ org_id: 36 team_id: 20 uid: 5 + +- + id: 22 + org_id: 17 + team_id: 9 + uid: 15 diff --git a/models/issues/issue_search.go b/models/issues/issue_search.go index 5d40b447042c3..5c05ead6879e7 100644 --- a/models/issues/issue_search.go +++ b/models/issues/issue_search.go @@ -362,14 +362,21 @@ func applyReviewRequestedCondition(sess *xorm.Session, reviewRequestedID int64) From("team_user"). Where(builder.Eq{"team_user.uid": reviewRequestedID}) + // if the review is approved or rejected, it should not be shown in the review requested list + maxReview := builder.Select("MAX(r.id)"). + From("review as r"). + Where(builder.In("r.type", []ReviewType{ReviewTypeApprove, ReviewTypeReject, ReviewTypeRequest})). + GroupBy("r.issue_id, r.reviewer_id, r.reviewer_team_id") + subQuery := builder.Select("review.issue_id"). From("review"). Where(builder.And( - builder.In("review.type", []ReviewType{ReviewTypeRequest, ReviewTypeReject, ReviewTypeApprove}), + builder.Eq{"review.type": ReviewTypeRequest}, builder.Or( builder.Eq{"review.reviewer_id": reviewRequestedID}, builder.In("review.reviewer_team_id", existInTeamQuery), ), + builder.In("review.id", maxReview), )) return sess.Where("issue.poster_id <> ?", reviewRequestedID). And(builder.In("issue.id", subQuery)) diff --git a/models/issues/issue_test.go b/models/issues/issue_test.go index b7fa7eff1c150..513ae241bc9cc 100644 --- a/models/issues/issue_test.go +++ b/models/issues/issue_test.go @@ -403,7 +403,7 @@ func TestCountIssues(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) count, err := issues_model.CountIssues(db.DefaultContext, &issues_model.IssuesOptions{}) assert.NoError(t, err) - assert.EqualValues(t, 19, count) + assert.EqualValues(t, 20, count) } func TestIssueLoadAttributes(t *testing.T) { diff --git a/modules/indexer/issues/indexer_test.go b/modules/indexer/issues/indexer_test.go index 0e36d21313737..7241f6313c891 100644 --- a/modules/indexer/issues/indexer_test.go +++ b/modules/indexer/issues/indexer_test.go @@ -180,6 +180,21 @@ func searchIssueByID(t *testing.T) { }, []int64{11, 6, 5, 3, 2, 1}, }, + { + // issue 20 request user 15 and team 5 which user 15 belongs to + // the review request number of issue 20 should be 1 + SearchOptions{ + ReviewRequestedID: int64Pointer(15), + }, + []int64{12, 20}, + }, + { + // user 20 approved the issue 20, so return nothing + SearchOptions{ + ReviewRequestedID: int64Pointer(20), + }, + []int64{}, + }, } for _, test := range tests { @@ -206,7 +221,7 @@ func searchIssueIsPull(t *testing.T) { SearchOptions{ IsPull: util.OptionalBoolTrue, }, - []int64{12, 11, 19, 9, 8, 3, 2}, + []int64{12, 11, 20, 19, 9, 8, 3, 2}, }, } for _, test := range tests { @@ -227,7 +242,7 @@ func searchIssueIsClosed(t *testing.T) { SearchOptions{ IsClosed: util.OptionalBoolFalse, }, - []int64{17, 16, 15, 14, 13, 12, 11, 6, 19, 18, 10, 7, 9, 8, 3, 2, 1}, + []int64{17, 16, 15, 14, 13, 12, 11, 20, 6, 19, 18, 10, 7, 9, 8, 3, 2, 1}, }, { SearchOptions{ @@ -293,7 +308,7 @@ func searchIssueByLabelID(t *testing.T) { SearchOptions{ ExcludedLabelIDs: []int64{1}, }, - []int64{17, 16, 15, 14, 13, 12, 11, 6, 5, 19, 18, 10, 7, 4, 9, 8, 3}, + []int64{17, 16, 15, 14, 13, 12, 11, 20, 6, 5, 19, 18, 10, 7, 4, 9, 8, 3}, }, } for _, test := range tests { @@ -317,7 +332,7 @@ func searchIssueByTime(t *testing.T) { SearchOptions{ UpdatedAfterUnix: int64Pointer(0), }, - []int64{17, 16, 15, 14, 13, 12, 11, 6, 5, 19, 18, 10, 7, 4, 9, 8, 3, 2, 1}, + []int64{17, 16, 15, 14, 13, 12, 11, 20, 6, 5, 19, 18, 10, 7, 4, 9, 8, 3, 2, 1}, }, } for _, test := range tests { @@ -338,7 +353,7 @@ func searchIssueWithOrder(t *testing.T) { SearchOptions{ SortBy: internal.SortByCreatedAsc, }, - []int64{1, 2, 3, 8, 9, 4, 7, 10, 18, 19, 5, 6, 11, 12, 13, 14, 15, 16, 17}, + []int64{1, 2, 3, 8, 9, 4, 7, 10, 18, 19, 5, 6, 20, 11, 12, 13, 14, 15, 16, 17}, }, } for _, test := range tests { @@ -393,7 +408,7 @@ func searchIssueWithPaginator(t *testing.T) { }, }, []int64{17, 16, 15, 14, 13}, - 19, + 20, }, } for _, test := range tests { diff --git a/tests/integration/api_issue_test.go b/tests/integration/api_issue_test.go index 808d288356f60..29f09fa09e747 100644 --- a/tests/integration/api_issue_test.go +++ b/tests/integration/api_issue_test.go @@ -219,7 +219,7 @@ func TestAPISearchIssues(t *testing.T) { token := getUserToken(t, "user2", auth_model.AccessTokenScopeReadIssue) // as this API was used in the frontend, it uses UI page size - expectedIssueCount := 17 // from the fixtures + expectedIssueCount := 18 // from the fixtures if expectedIssueCount > setting.UI.IssuePagingNum { expectedIssueCount = setting.UI.IssuePagingNum } @@ -243,7 +243,7 @@ func TestAPISearchIssues(t *testing.T) { req = NewRequest(t, "GET", link.String()) resp = MakeRequest(t, req, http.StatusOK) DecodeJSON(t, resp, &apiIssues) - assert.Len(t, apiIssues, 10) + assert.Len(t, apiIssues, 11) query.Del("since") query.Del("before") @@ -259,15 +259,15 @@ func TestAPISearchIssues(t *testing.T) { req = NewRequest(t, "GET", link.String()) resp = MakeRequest(t, req, http.StatusOK) DecodeJSON(t, resp, &apiIssues) - assert.EqualValues(t, "19", resp.Header().Get("X-Total-Count")) - assert.Len(t, apiIssues, 19) + assert.EqualValues(t, "20", resp.Header().Get("X-Total-Count")) + assert.Len(t, apiIssues, 20) query.Add("limit", "10") link.RawQuery = query.Encode() req = NewRequest(t, "GET", link.String()) resp = MakeRequest(t, req, http.StatusOK) DecodeJSON(t, resp, &apiIssues) - assert.EqualValues(t, "19", resp.Header().Get("X-Total-Count")) + assert.EqualValues(t, "20", resp.Header().Get("X-Total-Count")) assert.Len(t, apiIssues, 10) query = url.Values{"assigned": {"true"}, "state": {"all"}, "token": {token}} @@ -317,7 +317,7 @@ func TestAPISearchIssuesWithLabels(t *testing.T) { defer tests.PrepareTestEnv(t)() // as this API was used in the frontend, it uses UI page size - expectedIssueCount := 17 // from the fixtures + expectedIssueCount := 18 // from the fixtures if expectedIssueCount > setting.UI.IssuePagingNum { expectedIssueCount = setting.UI.IssuePagingNum } diff --git a/tests/integration/api_nodeinfo_test.go b/tests/integration/api_nodeinfo_test.go index a347ec5b3b1f9..4cbd25f5deab1 100644 --- a/tests/integration/api_nodeinfo_test.go +++ b/tests/integration/api_nodeinfo_test.go @@ -33,7 +33,7 @@ func TestNodeinfo(t *testing.T) { assert.True(t, nodeinfo.OpenRegistrations) assert.Equal(t, "gitea", nodeinfo.Software.Name) assert.Equal(t, 25, nodeinfo.Usage.Users.Total) - assert.Equal(t, 19, nodeinfo.Usage.LocalPosts) + assert.Equal(t, 20, nodeinfo.Usage.LocalPosts) assert.Equal(t, 2, nodeinfo.Usage.LocalComments) }) } diff --git a/tests/integration/issue_test.go b/tests/integration/issue_test.go index 4cae00f0bcb07..853e565b0fac8 100644 --- a/tests/integration/issue_test.go +++ b/tests/integration/issue_test.go @@ -356,7 +356,7 @@ func TestSearchIssues(t *testing.T) { session := loginUser(t, "user2") - expectedIssueCount := 17 // from the fixtures + expectedIssueCount := 18 // from the fixtures if expectedIssueCount > setting.UI.IssuePagingNum { expectedIssueCount = setting.UI.IssuePagingNum } @@ -377,7 +377,7 @@ func TestSearchIssues(t *testing.T) { req = NewRequest(t, "GET", link.String()) resp = session.MakeRequest(t, req, http.StatusOK) DecodeJSON(t, resp, &apiIssues) - assert.Len(t, apiIssues, 10) + assert.Len(t, apiIssues, 11) query.Del("since") query.Del("before") @@ -393,15 +393,15 @@ func TestSearchIssues(t *testing.T) { req = NewRequest(t, "GET", link.String()) resp = session.MakeRequest(t, req, http.StatusOK) DecodeJSON(t, resp, &apiIssues) - assert.EqualValues(t, "19", resp.Header().Get("X-Total-Count")) - assert.Len(t, apiIssues, 19) + assert.EqualValues(t, "20", resp.Header().Get("X-Total-Count")) + assert.Len(t, apiIssues, 20) query.Add("limit", "5") link.RawQuery = query.Encode() req = NewRequest(t, "GET", link.String()) resp = session.MakeRequest(t, req, http.StatusOK) DecodeJSON(t, resp, &apiIssues) - assert.EqualValues(t, "19", resp.Header().Get("X-Total-Count")) + assert.EqualValues(t, "20", resp.Header().Get("X-Total-Count")) assert.Len(t, apiIssues, 5) query = url.Values{"assigned": {"true"}, "state": {"all"}} @@ -450,7 +450,7 @@ func TestSearchIssues(t *testing.T) { func TestSearchIssuesWithLabels(t *testing.T) { defer tests.PrepareTestEnv(t)() - expectedIssueCount := 17 // from the fixtures + expectedIssueCount := 18 // from the fixtures if expectedIssueCount > setting.UI.IssuePagingNum { expectedIssueCount = setting.UI.IssuePagingNum } From c2cabe7b285684eb3197f99aa91bb184674e8461 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Thu, 21 Sep 2023 21:16:14 +0800 Subject: [PATCH 08/12] Fix repo sub menu (#27169) Fix #27166 --- web_src/css/base.css | 1 - web_src/css/repo.css | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web_src/css/base.css b/web_src/css/base.css index a3057013326ba..6b33ec4111ec3 100644 --- a/web_src/css/base.css +++ b/web_src/css/base.css @@ -420,7 +420,6 @@ a.silenced:hover { } a.label, -.repository-menu a, .ui.search .results a, .ui .menu a, .ui.cards a.card, diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 8ec9908f731c0..b7b14f740791c 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -2044,7 +2044,7 @@ border: none; display: flex; align-items: center; - padding: 0 0.5em; /* make the UI look better for narrow (mobile) view */ + padding: 0; overflow: hidden; } @@ -2056,7 +2056,8 @@ align-items: center; justify-content: center; gap: 0.25em; - padding: 0 0.25em; + padding: 0 0.5em; /* make the UI look better for narrow (mobile) view */ + text-decoration: none; } .repository .repository-summary .sub-menu .item.active { From 1f026bcb7eecad0b98d65089bb7fe5986b337d7d Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Thu, 21 Sep 2023 23:54:26 +0800 Subject: [PATCH 09/12] Fix dropdown icon position (#27175) According to https://fomantic-ui.com/modules/dropdown.html and our "devtest" page, many dropdown elements has incorrect "icon" position. This PR fixes all of them. Fix #27173 --- templates/admin/base/search.tmpl | 2 +- templates/admin/emails/list.tmpl | 2 +- templates/admin/repo/search.tmpl | 2 +- templates/admin/user/list.tmpl | 6 ++++-- templates/explore/repo_search.tmpl | 2 +- templates/explore/search.tmpl | 2 +- templates/projects/list.tmpl | 2 +- templates/repo/activity.tmpl | 6 ++---- templates/repo/commits.tmpl | 4 +--- templates/repo/issue/filters.tmpl | 14 +++++++------- templates/repo/issue/labels/label_list.tmpl | 8 ++++---- templates/repo/issue/list.tmpl | 8 ++++---- templates/repo/issue/milestones.tmpl | 2 +- templates/user/dashboard/milestones.tmpl | 2 +- templates/user/dashboard/navbar.tmpl | 2 +- .../notification/notification_subscriptions.tmpl | 4 ++-- 16 files changed, 33 insertions(+), 35 deletions(-) diff --git a/templates/admin/base/search.tmpl b/templates/admin/base/search.tmpl index 19977f05a9bcc..865cc8830f308 100644 --- a/templates/admin/base/search.tmpl +++ b/templates/admin/base/search.tmpl @@ -9,8 +9,8 @@