Skip to content

Commit b37e591

Browse files
Merge branch 'main' into pacman-packages
2 parents 5c2625a + 3f2d8f8 commit b37e591

File tree

9 files changed

+52
-13
lines changed

9 files changed

+52
-13
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,12 @@ jobs:
198198
test-mssql:
199199
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
200200
needs: files-changed
201-
runs-on: ubuntu-latest
201+
# specifying the version of ubuntu in use as mssql fails on newer kernels
202+
# pending resolution from vendor
203+
runs-on: ubuntu-20.04
202204
services:
203205
mssql:
204-
# some images before 2024-04 can't run on new kernels
205-
image: mcr.microsoft.com/mssql/server:2019-latest
206+
image: mcr.microsoft.com/mssql/server:2017-latest
206207
env:
207208
ACCEPT_EULA: Y
208209
MSSQL_PID: Standard

cmd/serv.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ func runServ(c *cli.Context) error {
143143
return nil
144144
}
145145

146+
defer func() {
147+
if err := recover(); err != nil {
148+
_ = fail(ctx, "Internal Server Error", "Panic: %v\n%s", err, log.Stack(2))
149+
}
150+
}()
151+
146152
keys := strings.Split(c.Args().First(), "-")
147153
if len(keys) != 2 || keys[0] != "key" {
148154
return fail(ctx, "Key ID format error", "Invalid key argument: %s", c.Args().First())
@@ -189,10 +195,7 @@ func runServ(c *cli.Context) error {
189195
}
190196

191197
verb := words[0]
192-
repoPath := words[1]
193-
if repoPath[0] == '/' {
194-
repoPath = repoPath[1:]
195-
}
198+
repoPath := strings.TrimPrefix(words[1], "/")
196199

197200
var lfsVerb string
198201
if verb == lfsAuthenticateVerb {

options/locale/locale_ja-JP.ini

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ filter.public=公開
159159
filter.private=プライベート
160160

161161
no_results_found=見つかりません。
162+
internal_error_skipped=内部エラーが発生しましたがスキップされました: %s
162163

163164
[search]
164165
search=検索…
@@ -177,6 +178,8 @@ code_search_by_git_grep=現在のコード検索は "git grep" によって行
177178
package_kind=パッケージを検索...
178179
project_kind=プロジェクトを検索...
179180
branch_kind=ブランチを検索...
181+
tag_kind=タグを検索...
182+
tag_tooltip=一致するタグを検索します。任意のシーケンスに一致させるには '%' を使用してください。
180183
commit_kind=コミットを検索...
181184
runner_kind=ランナーを検索...
182185
no_results=一致する結果が見つかりませんでした
@@ -1174,6 +1177,11 @@ migrate.gogs.description=notabug.org やその他の Gogs インスタンスか
11741177
migrate.onedev.description=code.onedev.io やその他の OneDev インスタンスからデータを移行します。
11751178
migrate.codebase.description=codebasehq.com からデータを移行します。
11761179
migrate.gitbucket.description=GitBucket インスタンスからデータを移行します。
1180+
migrate.codecommit.description=AWS CodeCommitからデータを移行します。
1181+
migrate.codecommit.aws_access_key_id=AWS アクセスキー ID
1182+
migrate.codecommit.aws_secret_access_key=AWSシークレットアクセスキー
1183+
migrate.codecommit.https_git_credentials_username=HTTPS Git 認証情報 ユーザー名
1184+
migrate.codecommit.https_git_credentials_password=HTTPS Git 認証情報 パスワード
11771185
migrate.migrating_git=Gitデータ移行中
11781186
migrate.migrating_topics=トピック移行中
11791187
migrate.migrating_milestones=マイルストーン移行中
@@ -1251,6 +1259,7 @@ ambiguous_runes_header=このファイルには曖昧(ambiguous)なUnicode文字
12511259
ambiguous_runes_description=このファイルには、他の文字と見間違える可能性があるUnicode文字が含まれています。 それが意図的なものと考えられる場合は、この警告を無視して構いません。 それらの文字を表示するにはエスケープボタンを使用します。
12521260
invisible_runes_line=`この行には不可視のUnicode文字があります`
12531261
ambiguous_runes_line=`この行には曖昧(ambiguous)なUnicode文字があります`
1262+
ambiguous_character=`%[1]c [U+%04[1]X] は %[2]c [U+%04[2]X] と混同するおそれがあります`
12541263

12551264
escape_control_characters=エスケープ
12561265
unescape_control_characters=エスケープ解除
@@ -1748,6 +1757,11 @@ issues.review.resolve_conversation=解決済みにする
17481757
issues.review.un_resolve_conversation=未解決にする
17491758
issues.review.resolved_by=がこの会話を解決済みにしました
17501759
issues.review.commented=コメント
1760+
issues.review.official=承認済み
1761+
issues.review.requested=レビュー待ち
1762+
issues.review.rejected=変更要請済み
1763+
issues.review.stale=承認後に更新されました
1764+
issues.review.unofficial=カウントされない承認
17511765
issues.assignee.error=予期しないエラーにより、一部の担当者を追加できませんでした。
17521766
issues.reference_issue.body=内容
17531767
issues.content_history.deleted=削除しました
@@ -1821,6 +1835,8 @@ pulls.is_empty=このブランチの変更は既にターゲットブランチ
18211835
pulls.required_status_check_failed=いくつかの必要なステータスチェックが成功していません。
18221836
pulls.required_status_check_missing=必要なチェックがいくつか抜けています。
18231837
pulls.required_status_check_administrator=管理者であるため、このプルリクエストをマージすることは可能です。
1838+
pulls.blocked_by_approvals=このプルリクエストはまだ必要な承認数を満たしていません。 公式の承認を %[1]d / %[2]d 得ています。
1839+
pulls.blocked_by_approvals_whitelisted=このプルリクエストはまだ必要な承認数を満たしていません。 許可リストのユーザーまたはチームからの承認を %[1]d / %[2]d 得ています。
18241840
pulls.blocked_by_rejection=このプルリクエストは公式レビューアにより変更要請されています。
18251841
pulls.blocked_by_official_review_requests=このプルリクエストには公式レビュー依頼があります。
18261842
pulls.blocked_by_outdated_branch=このプルリクエストは遅れのためブロックされています。

routers/api/v1/api.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,6 +1286,8 @@ func Routes() *web.Router {
12861286
m.Group("/{ref}", func() {
12871287
m.Get("/status", repo.GetCombinedCommitStatusByRef)
12881288
m.Get("/statuses", repo.GetCommitStatusesByRef)
1289+
}, context.ReferencesGitRepo())
1290+
m.Group("/{sha}", func() {
12891291
m.Get("/pull", repo.GetCommitPullRequest)
12901292
}, context.ReferencesGitRepo())
12911293
}, reqRepoReader(unit.TypeCode))

routers/api/v1/repo/commits.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,11 +325,11 @@ func DownloadCommitDiffOrPatch(ctx *context.APIContext) {
325325
}
326326
}
327327

328-
// GetCommitPullRequest returns the pull request of the commit
328+
// GetCommitPullRequest returns the merged pull request of the commit
329329
func GetCommitPullRequest(ctx *context.APIContext) {
330330
// swagger:operation GET /repos/{owner}/{repo}/commits/{sha}/pull repository repoGetCommitPullRequest
331331
// ---
332-
// summary: Get the pull request of the commit
332+
// summary: Get the merged pull request of the commit
333333
// produces:
334334
// - application/json
335335
// parameters:
@@ -354,7 +354,7 @@ func GetCommitPullRequest(ctx *context.APIContext) {
354354
// "404":
355355
// "$ref": "#/responses/notFound"
356356

357-
pr, err := issues_model.GetPullRequestByMergedCommit(ctx, ctx.Repo.Repository.ID, ctx.PathParam(":sha"))
357+
pr, err := issues_model.GetPullRequestByMergedCommit(ctx, ctx.Repo.Repository.ID, ctx.PathParam("sha"))
358358
if err != nil {
359359
if issues_model.IsErrPullRequestNotExist(err) {
360360
ctx.Error(http.StatusNotFound, "GetPullRequestByMergedCommit", err)

routers/web/repo/issue.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption opt
467467
ctx.Data["AssigneeID"] = assigneeID
468468
ctx.Data["PosterID"] = posterID
469469
ctx.Data["Keyword"] = keyword
470+
ctx.Data["IsShowClosed"] = isShowClosed
470471
switch {
471472
case isShowClosed.Value():
472473
ctx.Data["State"] = "closed"

templates/repo/issue/filter_actions.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<div class="ui secondary filter menu">
22
{{if not .Repository.IsArchived}}
33
<!-- Action Button -->
4-
{{if .IsShowClosed}}
4+
{{if and .IsShowClosed.Has .IsShowClosed.Value}}
55
<button class="ui primary basic button issue-action" data-action="open" data-url="{{$.RepoLink}}/issues/status">{{ctx.Locale.Tr "repo.issues.action_open"}}</button>
6-
{{else}}
6+
{{else if and .IsShowClosed.Has (not .IsShowClosed.Value)}}
77
<button class="ui red basic button issue-action" data-action="close" data-url="{{$.RepoLink}}/issues/status">{{ctx.Locale.Tr "repo.issues.action_close"}}</button>
88
{{end}}
99
{{if $.IsRepoAdmin}}

templates/swagger/v1_json.tmpl

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/integration/api_pull_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,3 +334,19 @@ func doAPIGetPullFiles(ctx APITestContext, pr *api.PullRequest, callback func(*t
334334
}
335335
}
336336
}
337+
338+
func TestAPICommitPullRequest(t *testing.T) {
339+
defer tests.PrepareTestEnv(t)()
340+
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1})
341+
owner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID})
342+
343+
ctx := NewAPITestContext(t, "user2", repo.Name, auth_model.AccessTokenScopeReadRepository)
344+
345+
mergedCommitSHA := "1a8823cd1a9549fde083f992f6b9b87a7ab74fb3"
346+
req := NewRequestf(t, "GET", "/api/v1/repos/%s/%s/commits/%s/pull", owner.Name, repo.Name, mergedCommitSHA).AddTokenAuth(ctx.Token)
347+
ctx.Session.MakeRequest(t, req, http.StatusOK)
348+
349+
invalidCommitSHA := "abcd1234abcd1234abcd1234abcd1234abcd1234"
350+
req = NewRequestf(t, "GET", "/api/v1/repos/%s/%s/commits/%s/pull", owner.Name, repo.Name, invalidCommitSHA).AddTokenAuth(ctx.Token)
351+
ctx.Session.MakeRequest(t, req, http.StatusNotFound)
352+
}

0 commit comments

Comments
 (0)