Skip to content

Commit c21702f

Browse files
authored
Merge branch 'main' into nix-dev-env-golang
2 parents 36c8305 + cfc6e21 commit c21702f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1246
-963
lines changed

.eslintrc.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ module.exports = {
403403
'github/a11y-svg-has-accessible-name': [0],
404404
'github/array-foreach': [0],
405405
'github/async-currenttarget': [2],
406-
'github/async-preventdefault': [2],
406+
'github/async-preventdefault': [0], // https://github.com/github/eslint-plugin-github/issues/599
407407
'github/authenticity-token': [0],
408408
'github/get-attribute': [0],
409409
'github/js-class-name': [0],

models/fixtures/access.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,9 @@
171171
user_id: 40
172172
repo_id: 61
173173
mode: 4
174+
175+
-
176+
id: 30
177+
user_id: 40
178+
repo_id: 1
179+
mode: 2

modules/web/handler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func wrapHandlerProvider[T http.Handler](hp func(next http.Handler) T, funcInfo
121121
return func(next http.Handler) http.Handler {
122122
h := hp(next) // this handle could be dynamically generated, so we can't use it for debug info
123123
return http.HandlerFunc(func(resp http.ResponseWriter, req *http.Request) {
124-
routing.UpdateFuncInfo(req.Context(), funcInfo)
124+
defer routing.RecordFuncInfo(req.Context(), funcInfo)()
125125
h.ServeHTTP(resp, req)
126126
})
127127
}
@@ -157,7 +157,7 @@ func toHandlerProvider(handler any) func(next http.Handler) http.Handler {
157157
return // it's doing pre-check, just return
158158
}
159159

160-
routing.UpdateFuncInfo(req.Context(), funcInfo)
160+
defer routing.RecordFuncInfo(req.Context(), funcInfo)()
161161
ret := fn.Call(argsIn)
162162

163163
// handle the return value (no-op at the moment)

modules/web/routing/context.go

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@ type contextKeyType struct{}
1212

1313
var contextKey contextKeyType
1414

15-
// UpdateFuncInfo updates a context's func info
16-
func UpdateFuncInfo(ctx context.Context, funcInfo *FuncInfo) {
17-
record, ok := ctx.Value(contextKey).(*requestRecord)
18-
if !ok {
19-
return
15+
// RecordFuncInfo records a func info into context
16+
func RecordFuncInfo(ctx context.Context, funcInfo *FuncInfo) (end func()) {
17+
// TODO: reqCtx := reqctx.FromContext(ctx), add trace support
18+
end = func() {}
19+
20+
// save the func info into the context record
21+
if record, ok := ctx.Value(contextKey).(*requestRecord); ok {
22+
record.lock.Lock()
23+
record.funcInfo = funcInfo
24+
record.lock.Unlock()
2025
}
21-
22-
record.lock.Lock()
23-
record.funcInfo = funcInfo
24-
record.lock.Unlock()
26+
return end
2527
}
2628

2729
// MarkLongPolling marks the request is a long-polling request, and the logger may output different message for it

options/locale/locale_cs-CZ.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2155,7 +2155,6 @@ settings.advanced_settings=Pokročilá nastavení
21552155
settings.wiki_desc=Povolit Wiki repozitáře
21562156
settings.use_internal_wiki=Používat vestavěnou Wiki
21572157
settings.default_wiki_branch_name=Výchozí název větve Wiki
2158-
settings.default_wiki_everyone_access=Výchozí přístupová práva pro přihlášené uživatele:
21592158
settings.failed_to_change_default_wiki_branch=Změna výchozí větve wiki se nezdařila.
21602159
settings.use_external_wiki=Používat externí Wiki
21612160
settings.external_wiki_url=URL externí Wiki

options/locale/locale_de-DE.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2151,7 +2151,6 @@ settings.advanced_settings=Erweiterte Einstellungen
21512151
settings.wiki_desc=Repository-Wiki aktivieren
21522152
settings.use_internal_wiki=Eingebautes Wiki verwenden
21532153
settings.default_wiki_branch_name=Standardbezeichnung für Wiki-Branch
2154-
settings.default_wiki_everyone_access=Standard-Zugriffsberechtigung für angemeldete Benutzer:
21552154
settings.failed_to_change_default_wiki_branch=Das Ändern des Standard-Wiki-Branches ist fehlgeschlagen.
21562155
settings.use_external_wiki=Externes Wiki verwenden
21572156
settings.external_wiki_url=Externe Wiki-URL

options/locale/locale_en-US.ini

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,16 +1685,16 @@ issues.timetracker_timer_manually_add = Add Time
16851685
16861686
issues.time_estimate_set = Set estimated time
16871687
issues.time_estimate_display = Estimate: %s
1688-
issues.change_time_estimate_at = changed time estimate to <b>%s</b> %s
1688+
issues.change_time_estimate_at = changed time estimate to <b>%[1]s</b> %[2]s
16891689
issues.remove_time_estimate_at = removed time estimate %s
16901690
issues.time_estimate_invalid = Time estimate format is invalid
16911691
issues.start_tracking_history = started working %s
16921692
issues.tracker_auto_close = Timer will be stopped automatically when this issue gets closed
16931693
issues.tracking_already_started = `You have already started time tracking on <a href="%s">another issue</a>!`
1694-
issues.stop_tracking_history = worked for <b>%s</b> %s
1694+
issues.stop_tracking_history = worked for <b>%[1]s</b> %[2]s
16951695
issues.cancel_tracking_history = `canceled time tracking %s`
16961696
issues.del_time = Delete this time log
1697-
issues.add_time_history = added spent time <b>%s</b> %s
1697+
issues.add_time_history = added spent time <b>%[1]s</b> %[2]s
16981698
issues.del_time_history= `deleted spent time %s`
16991699
issues.add_time_manually = Manually Add Time
17001700
issues.add_time_hours = Hours
@@ -2714,6 +2714,8 @@ branch.create_branch_operation = Create branch
27142714
branch.new_branch = Create new branch
27152715
branch.new_branch_from = Create new branch from "%s"
27162716
branch.renamed = Branch %s was renamed to %s.
2717+
branch.rename_default_or_protected_branch_error = Only admins can rename default or protected branches.
2718+
branch.rename_protected_branch_failed = This branch is protected by glob-based protection rules.
27172719
27182720
tag.create_tag = Create tag %s
27192721
tag.create_tag_operation = Create tag

options/locale/locale_fr-FR.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2156,7 +2156,6 @@ settings.advanced_settings=Paramètres avancés
21562156
settings.wiki_desc=Activer le wiki du dépôt
21572157
settings.use_internal_wiki=Utiliser le wiki interne
21582158
settings.default_wiki_branch_name=Nom de la branche du Wiki par défaut
2159-
settings.default_wiki_everyone_access=Autorisation d’accès par défaut pour les utilisateurs connectés :
21602159
settings.failed_to_change_default_wiki_branch=Impossible de modifier la branche du wiki par défaut.
21612160
settings.use_external_wiki=Utiliser un wiki externe
21622161
settings.external_wiki_url=URL Wiki externe

options/locale/locale_ga-IE.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,7 @@ blame.ignore_revs=Ag déanamh neamhairde de leasuithe i <a href="%s">.git-blame-
11151115
blame.ignore_revs.failed=Theip ar neamhaird a dhéanamh ar leasuithe i <a href="%s">.git-blame-ignore-revs</a>.
11161116
user_search_tooltip=Taispeáint uasmhéid de 30 úsáideoir
11171117
1118+
tree_path_not_found=Níl cosán %[1]s ann i %[2]s
11181119
11191120
transfer.accept=Glac le hAistriú
11201121
transfer.accept_desc=Aistriú chuig “%s”
@@ -2156,7 +2157,6 @@ settings.advanced_settings=Ardsocruithe
21562157
settings.wiki_desc=Cumasaigh Stór Vicí
21572158
settings.use_internal_wiki=Úsáid Vicí Insuite
21582159
settings.default_wiki_branch_name=Ainm Brainse Réamhshocraithe Vicí
2159-
settings.default_wiki_everyone_access=Cead Rochtana Réamhshocraithe d'úsáideoirí sínithe isteach:
21602160
settings.failed_to_change_default_wiki_branch=Theip ar an brainse réamhshocraithe vicí a athrú.
21612161
settings.use_external_wiki=Úsáid Vicí Seachtrach
21622162
settings.external_wiki_url=URL Vicí Seachtrach

options/locale/locale_ja-JP.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2145,7 +2145,6 @@ settings.advanced_settings=拡張設定
21452145
settings.wiki_desc=Wikiを有効にする
21462146
settings.use_internal_wiki=ビルトインのWikiを使用する
21472147
settings.default_wiki_branch_name=デフォルトのWikiブランチ名
2148-
settings.default_wiki_everyone_access=サインインユーザーのデフォルトのアクセス権限:
21492148
settings.failed_to_change_default_wiki_branch=デフォルトのWikiブランチを変更できませんでした。
21502149
settings.use_external_wiki=外部のWikiを使用する
21512150
settings.external_wiki_url=外部WikiのURL

0 commit comments

Comments
 (0)