Compare commits

..

5 Commits

Author SHA1 Message Date
JakobDev
14731a34ff
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)
```
2023-09-21 01:30:48 +00:00
GiteaBot
2001ffee3f [skip ci] Updated translations via Crowdin 2023-09-21 00:22:27 +00:00
delvh
d7f73a1334
Start development on Gitea 1.22 (#27155) 2023-09-20 22:18:53 +01:00
delvh
707c69f399
Fix successful return value for SyncAndGetUserSpecificDiff (#27152)
A function should not return an error when it is successful.
Otherwise, things like https://discord.com/channels/322538954119184384/322538954119184384/1153705341620600833 happen…
2023-09-20 22:28:17 +02:00
Zettat123
9336286e35
Improve actions docs related to pull_request event (#27126)
Related to #27039

The `ref` property in Gitea Actions is different from GitHub Actions.
This PR improves the documentation to explain the difference.
2023-09-20 06:28:35 +00:00
7 changed files with 34 additions and 2 deletions

View File

@ -180,3 +180,6 @@ For events supported only by GitHub, see GitHub's [documentation](https://docs.g
| pull_request_review_comment | `created`, `edited` |
| release | `published`, `edited` |
| registry_package | `published` |
> For `pull_request` events, in [GitHub Actions](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request), the `ref` is `refs/pull/:prNumber/merge`, which is a reference to the merge commit preview. However, Gitea has no such reference.
> Therefore, the `ref` in Gitea Actions is `refs/pull/:prNumber/head`, which points to the head of pull request rather than the preview of the merge commit.

View File

@ -180,3 +180,6 @@ defaults:
| pull_request_review_comment | `created`, `edited` |
| release | `published`, `edited` |
| registry_package | `published` |
> 对于 `pull_request` 事件,在 [GitHub Actions](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request) 中 `ref``refs/pull/:prNumber/merge`,它指向这个拉取请求合并提交的一个预览。但是 Gitea 没有这种 reference。
> 因此Gitea Actions 中 `ref``refs/pull/:prNumber/head`,它指向这个拉取请求的头分支而不是合并提交的预览。

View File

@ -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
}

View File

@ -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

View File

@ -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))
}

View File

@ -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=ログの保存先パス

View File

@ -1343,7 +1343,7 @@ outer:
}
}
return diff, err
return diff, nil
}
// CommentAsDiff returns c.Patch as *Diff