From e51f96829f78d2dbf3633b036c9d9a49afd28fe4 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 8 Oct 2023 00:54:02 +0200 Subject: [PATCH 01/45] Downgrade `go-co-op/gocron` to v1.31.1 (#27511) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 5bde447cb2..38afc33b36 100644 --- a/go.mod +++ b/go.mod @@ -41,7 +41,7 @@ require ( github.com/go-ap/jsonld v0.0.0-20221030091449-f2a191312c73 github.com/go-chi/chi/v5 v5.0.10 github.com/go-chi/cors v1.2.1 - github.com/go-co-op/gocron v1.35.0 + github.com/go-co-op/gocron v1.31.1 github.com/go-enry/go-enry/v2 v2.8.6 github.com/go-fed/httpsig v1.1.1-0.20201223112313-55836744818e github.com/go-git/go-billy/v5 v5.5.0 diff --git a/go.sum b/go.sum index 584b6c53e1..ae3bb5541b 100644 --- a/go.sum +++ b/go.sum @@ -345,8 +345,8 @@ github.com/go-chi/chi/v5 v5.0.10 h1:rLz5avzKpjqxrYwXNfmjkrYYXOyLJd37pz53UFHC6vk= github.com/go-chi/chi/v5 v5.0.10/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4= github.com/go-chi/cors v1.2.1/go.mod h1:sSbTewc+6wYHBBCW7ytsFSn836hqM7JxpglAy2Vzc58= -github.com/go-co-op/gocron v1.35.0 h1:niC91OHiSEimXgPPay02AI1gLGL4JGBgDzmWtgZ8n5A= -github.com/go-co-op/gocron v1.35.0/go.mod h1:NLi+bkm4rRSy1F8U7iacZOz0xPseMoIOnvabGoSe/no= +github.com/go-co-op/gocron v1.31.1 h1:LZAuBlU0t3SPGUMJGhrJ6VuCc3CsrYzkzicygvVWlfA= +github.com/go-co-op/gocron v1.31.1/go.mod h1:39f6KNSGVOU1LO/ZOoZfcSxwlsJDQOKSu8erN0SH48Y= github.com/go-enry/go-enry/v2 v2.8.6 h1:T6ljs5+qNiUTDqpfK5GUD5EvLNdDbf804u8iC30vw7U= github.com/go-enry/go-enry/v2 v2.8.6/go.mod h1:9yrj4ES1YrbNb1Wb7/PWYr2bpaCXUGRt0uafN0ISyG8= github.com/go-enry/go-oniguruma v1.2.1 h1:k8aAMuJfMrqm/56SG2lV9Cfti6tC4x8673aHCcBk+eo= From 3b139fa3a37b2ab42d82370d6835b2f7d7822b1d Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 8 Oct 2023 01:26:27 +0200 Subject: [PATCH 02/45] Improve feed icons and feed merge text color (#27498) 1. Improve various feed icons 2. Fix merge message color image image Fixes: https://github.com/go-gitea/gitea/issues/27495 Continues: https://github.com/go-gitea/gitea/pull/27356 --- modules/templates/util_misc.go | 24 ++++++++++++++---------- templates/user/dashboard/feeds.tmpl | 6 +++--- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/modules/templates/util_misc.go b/modules/templates/util_misc.go index fe02e4b0c3..6c1b4ab240 100644 --- a/modules/templates/util_misc.go +++ b/modules/templates/util_misc.go @@ -74,27 +74,31 @@ func ActionIcon(opType activities_model.ActionType) string { switch opType { case activities_model.ActionCreateRepo, activities_model.ActionTransferRepo, activities_model.ActionRenameRepo: return "repo" - case activities_model.ActionCommitRepo, activities_model.ActionPushTag, activities_model.ActionDeleteTag, activities_model.ActionDeleteBranch: + case activities_model.ActionCommitRepo: return "git-commit" - case activities_model.ActionCreateIssue: - return "issue-opened" - case activities_model.ActionCreatePullRequest: - return "git-pull-request" - case activities_model.ActionCommentIssue, activities_model.ActionCommentPull: - return "comment-discussion" + case activities_model.ActionDeleteBranch: + return "git-branch" case activities_model.ActionMergePullRequest, activities_model.ActionAutoMergePullRequest: return "git-merge" - case activities_model.ActionCloseIssue, activities_model.ActionClosePullRequest: + case activities_model.ActionCreatePullRequest: + return "git-pull-request" + case activities_model.ActionClosePullRequest: + return "git-pull-request-closed" + case activities_model.ActionCreateIssue: + return "issue-opened" + case activities_model.ActionCloseIssue: return "issue-closed" case activities_model.ActionReopenIssue, activities_model.ActionReopenPullRequest: return "issue-reopened" + case activities_model.ActionCommentIssue, activities_model.ActionCommentPull: + return "comment-discussion" case activities_model.ActionMirrorSyncPush, activities_model.ActionMirrorSyncCreate, activities_model.ActionMirrorSyncDelete: return "mirror" case activities_model.ActionApprovePullRequest: return "check" case activities_model.ActionRejectPullRequest: - return "diff" - case activities_model.ActionPublishRelease: + return "file-diff" + case activities_model.ActionPublishRelease, activities_model.ActionPushTag, activities_model.ActionDeleteTag: return "tag" case activities_model.ActionPullReviewDismissed: return "x" diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index 08b3377aab..c986dcfb44 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -109,12 +109,12 @@
{{RenderMarkdownToHtml ctx $comment}}
{{end}} {{else if .GetOpType.InActions "merge_pull_request"}} -
{{index .GetIssueInfos 1}}
+
{{index .GetIssueInfos 1}}
{{else if .GetOpType.InActions "close_issue" "reopen_issue" "close_pull_request" "reopen_pull_request"}} {{(.GetIssueTitle ctx) | RenderEmoji $.Context | RenderCodeBlock}} {{else if .GetOpType.InActions "pull_review_dismissed"}} -
{{ctx.Locale.Tr "action.review_dismissed_reason"}}
-
{{index .GetIssueInfos 2 | RenderEmoji $.Context}}
+
{{ctx.Locale.Tr "action.review_dismissed_reason"}}
+
{{index .GetIssueInfos 2 | RenderEmoji $.Context}}
{{end}}
From 0bccf078c912eb94223d74af554701e29a5117eb Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 8 Oct 2023 02:16:20 +0200 Subject: [PATCH 03/45] Update JS and PY dependencies (#27501) - Update all JS and PY dependencies - Enable eslint `prefer-object-has-own` and autofix issue - Fix styling on citation buttons - Tested citation, mermaid, monaco, swagger, katex Citation button issue was that these buttons were not filled: Screenshot 2023-10-07 at 14 05 08 Co-authored-by: techknowlogick --- .eslintrc.yaml | 2 +- package-lock.json | 695 +++++++++++++------------- package.json | 28 +- poetry.lock | 180 +++---- templates/repo/cite/cite_buttons.tmpl | 6 +- web_src/js/features/emoji.js | 2 +- 6 files changed, 457 insertions(+), 456 deletions(-) diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 689a4f919c..f9d2d30e9e 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -476,7 +476,7 @@ rules: prefer-exponentiation-operator: [2] prefer-named-capture-group: [0] prefer-numeric-literals: [2] - prefer-object-has-own: [0] + prefer-object-has-own: [2] prefer-object-spread: [2] prefer-promise-reject-errors: [2, {allowEmptyReject: false}] prefer-regex-literals: [2] diff --git a/package-lock.json b/package-lock.json index e5fec6aa96..0de9dd5ea4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,9 +5,9 @@ "packages": { "": { "dependencies": { - "@citation-js/core": "0.6.9", - "@citation-js/plugin-bibtex": "0.6.9", - "@citation-js/plugin-csl": "0.6.9", + "@citation-js/core": "0.7.1", + "@citation-js/plugin-bibtex": "0.7.1", + "@citation-js/plugin-csl": "0.7.1", "@citation-js/plugin-software-formats": "0.6.1", "@claviska/jquery-minicolors": "2.3.6", "@github/markdown-toolbar-element": "2.2.1", @@ -18,7 +18,7 @@ "@webcomponents/custom-elements": "1.6.0", "add-asset-webpack-plugin": "2.0.1", "ansi_up": "6.0.2", - "asciinema-player": "3.6.1", + "asciinema-player": "3.6.2", "clippie": "4.0.6", "css-loader": "6.8.1", "dropzone": "6.0.0-beta.2", @@ -27,18 +27,18 @@ "escape-goat": "4.0.0", "fast-glob": "3.3.1", "jquery": "3.7.1", - "katex": "0.16.8", + "katex": "0.16.9", "license-checker-webpack-plugin": "0.2.1", "lightningcss-loader": "2.1.0", - "mermaid": "10.4.0", + "mermaid": "10.5.0", "mini-css-extract-plugin": "2.7.6", "minimatch": "9.0.3", - "monaco-editor": "0.43.0", + "monaco-editor": "0.44.0", "monaco-editor-webpack-plugin": "7.1.0", "pdfobject": "2.2.12", "pretty-ms": "8.0.0", "sortablejs": "1.15.0", - "swagger-ui-dist": "5.7.2", + "swagger-ui-dist": "5.9.0", "throttle-debounce": "5.0.0", "tinycolor2": "1.6.0", "tippy.js": "6.3.7", @@ -47,7 +47,7 @@ "uint8-to-base64": "0.2.0", "vue": "3.3.4", "vue-bar-graph": "2.0.0", - "vue-loader": "17.2.2", + "vue-loader": "17.3.0", "vue3-calendar-heatmap": "2.0.5", "webpack": "5.88.2", "webpack-cli": "5.1.4", @@ -57,8 +57,8 @@ "@eslint-community/eslint-plugin-eslint-comments": "4.1.0", "@playwright/test": "1.38.1", "@stoplight/spectral-cli": "6.11.0", - "@vitejs/plugin-vue": "4.3.4", - "eslint": "8.49.0", + "@vitejs/plugin-vue": "4.4.0", + "eslint": "8.51.0", "eslint-plugin-array-func": "4.0.0", "eslint-plugin-import": "2.28.1", "eslint-plugin-jquery": "1.5.1", @@ -69,8 +69,8 @@ "eslint-plugin-unicorn": "48.0.1", "eslint-plugin-vitest-globals": "1.4.0", "eslint-plugin-vue": "9.17.0", - "eslint-plugin-vue-scoped-css": "2.5.0", - "eslint-plugin-wc": "2.0.3", + "eslint-plugin-vue-scoped-css": "2.5.1", + "eslint-plugin-wc": "2.0.4", "jsdom": "22.1.0", "markdownlint-cli": "0.37.0", "postcss-html": "1.5.0", @@ -81,7 +81,7 @@ "svgo": "3.0.2", "updates": "15.0.2", "vite-string-plugin": "1.1.2", - "vitest": "0.34.5" + "vitest": "0.34.6" }, "engines": { "node": ">= 18.0.0" @@ -290,9 +290,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.22.16", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.16.tgz", - "integrity": "sha512-+gPfKv8UWeKKeJTUxe59+OobVcrYHETCsORl61EmSkmgymguYk/X5bp7GuUIXaFsc6y++v8ZxPsLSSuujqDphA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", "bin": { "parser": "bin/babel-parser.js" }, @@ -301,9 +301,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.15.tgz", - "integrity": "sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA==", + "version": "7.23.1", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.1.tgz", + "integrity": "sha512-hC2v6p8ZSI/W0HUzh3V8C5g+NwSKzKPtJwSpTjwl0o297GP9+ZLQSkdvHz46CM3LqyoXxq+5G9komY+eSqSO0g==", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -317,9 +317,9 @@ "integrity": "sha512-s3jaWicZd0pkP0jf5ysyHUI/RE7MHos6qlToFcGWXVp+ykHOy77OUMrfbgJ9it2C5bow7OIQwYYaHjk9XlBQ2A==" }, "node_modules/@citation-js/core": { - "version": "0.6.9", - "resolved": "https://registry.npmjs.org/@citation-js/core/-/core-0.6.9.tgz", - "integrity": "sha512-ElG4cvedkaRm/a40yhWXOUPUzAImwqI7ZmIyL55GIR4EmfQ5PkaSEcFhA3dekMa66l52ddn4lQaNVO+/yECq9A==", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/@citation-js/core/-/core-0.7.1.tgz", + "integrity": "sha512-vt7O/KbWNj6v0/fTKRJfjLE0VU4bV13LR69bG4V4lvWEq8TqXSNR4TVEINJuAwBLCofTk6LRyF82oGpb9AgaPQ==", "dependencies": { "@citation-js/date": "^0.5.0", "@citation-js/name": "^0.4.2", @@ -327,7 +327,7 @@ "sync-fetch": "^0.4.1" }, "engines": { - "node": ">=14.0.0" + "node": ">=16.0.0" } }, "node_modules/@citation-js/date": { @@ -347,19 +347,19 @@ } }, "node_modules/@citation-js/plugin-bibtex": { - "version": "0.6.9", - "resolved": "https://registry.npmjs.org/@citation-js/plugin-bibtex/-/plugin-bibtex-0.6.9.tgz", - "integrity": "sha512-35xHut8rbDAN2ffYt+BPn+DChxXhbVnN86fu2DHDQNWlCqCrUJhQTMRMlD0L1uuyHTDrkTvgLPtcs14WC+xKzA==", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/@citation-js/plugin-bibtex/-/plugin-bibtex-0.7.1.tgz", + "integrity": "sha512-dj/GzpceS/QNbU8+rVzJfXeli7XSTYVTltGv5w2RHM+CCOdtG3tiFP1Ohu3yWi+8VPMjQJG9u2W789grIqc/ng==", "dependencies": { "@citation-js/date": "^0.5.0", "@citation-js/name": "^0.4.2", "moo": "^0.5.1" }, "engines": { - "node": ">=14.0.0" + "node": ">=16.0.0" }, "peerDependencies": { - "@citation-js/core": "^0.6.0" + "@citation-js/core": "^0.7.0" } }, "node_modules/@citation-js/plugin-cff": { @@ -375,18 +375,18 @@ } }, "node_modules/@citation-js/plugin-csl": { - "version": "0.6.9", - "resolved": "https://registry.npmjs.org/@citation-js/plugin-csl/-/plugin-csl-0.6.9.tgz", - "integrity": "sha512-W8AYDK5o6qgkdBWgXPXmpzbTUxyfoADDbiGf1BqMdeD0IH3kSmgvXcsyeh8NMxiaM6B5VDg0k0pHaaxbTm5POA==", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/@citation-js/plugin-csl/-/plugin-csl-0.7.1.tgz", + "integrity": "sha512-B5Yv1o04Ds8/PF3FYlfL7bL3LFpVUhCEOAEqLFN5qgk785dnU0gMhDYbpJuCbQ8P6lIQpoU7O5x+EcJvWQhqCA==", "dependencies": { "@citation-js/date": "^0.5.0", "citeproc": "^2.4.6" }, "engines": { - "node": ">=14.0.0" + "node": ">=16.0.0" }, "peerDependencies": { - "@citation-js/core": "^0.6.0" + "@citation-js/core": "^0.7.0" } }, "node_modules/@citation-js/plugin-github": { @@ -460,9 +460,9 @@ } }, "node_modules/@csstools/css-parser-algorithms": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-2.3.1.tgz", - "integrity": "sha512-xrvsmVUtefWMWQsGgFffqWSK03pZ1vfDki4IVIIUxxDKnGBzqNgv0A7SB1oXtVNEkcVO8xi1ZrTL29HhSu5kGA==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-2.3.2.tgz", + "integrity": "sha512-sLYGdAdEY2x7TSw9FtmdaTrh2wFtRJO5VMbBrA8tEqEod7GEggFmxTSK9XqExib3yMuYNcvcTdCZIP6ukdjAIA==", "dev": true, "funding": [ { @@ -478,13 +478,13 @@ "node": "^14 || ^16 || >=18" }, "peerDependencies": { - "@csstools/css-tokenizer": "^2.2.0" + "@csstools/css-tokenizer": "^2.2.1" } }, "node_modules/@csstools/css-tokenizer": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-2.2.0.tgz", - "integrity": "sha512-wErmsWCbsmig8sQKkM6pFhr/oPha1bHfvxsUY5CYSQxwyhA9Ulrs8EqCgClhg4Tgg2XapVstGqSVcz0xOYizZA==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-2.2.1.tgz", + "integrity": "sha512-Zmsf2f/CaEPWEVgw29odOj+WEVoiJy9s9NOv5GgNY9mZ1CZ7394By6wONrONrTsnNDv6F9hR02nvFihrGVGHBg==", "dev": true, "funding": [ { @@ -501,9 +501,9 @@ } }, "node_modules/@csstools/media-query-list-parser": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-2.1.4.tgz", - "integrity": "sha512-V/OUXYX91tAC1CDsiY+HotIcJR+vPtzrX8pCplCpT++i8ThZZsq5F5dzZh/bDM3WUOjrvC1ljed1oSJxMfjqhw==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-2.1.5.tgz", + "integrity": "sha512-IxVBdYzR8pYe89JiyXQuYk4aVVoCPhMJkz6ElRwlVysjwURTsTk/bmY/z4FfeRE+CRBMlykPwXEVUg8lThv7AQ==", "dev": true, "funding": [ { @@ -519,8 +519,8 @@ "node": "^14 || ^16 || >=18" }, "peerDependencies": { - "@csstools/css-parser-algorithms": "^2.3.1", - "@csstools/css-tokenizer": "^2.2.0" + "@csstools/css-parser-algorithms": "^2.3.2", + "@csstools/css-tokenizer": "^2.2.1" } }, "node_modules/@csstools/selector-specificity": { @@ -554,9 +554,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.3.tgz", - "integrity": "sha512-Lemgw4io4VZl9GHJmjiBGzQ7ONXRfRPHcUEerndjwiSkbxzrpq0Uggku5MxxrXdwJ+pTj1qyw4jwTu7hkPsgIA==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", + "integrity": "sha512-uBIbiYMeSsy2U0XQoOGVVcpIktjLMEKa7ryz2RLr7L/vTnANNEsPVAh4xOv7ondGz6ac1zVb0F8Jx20rQikffQ==", "cpu": [ "arm" ], @@ -569,9 +569,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.3.tgz", - "integrity": "sha512-w+Akc0vv5leog550kjJV9Ru+MXMR2VuMrui3C61mnysim0gkFCPOUTAfzTP0qX+HpN9Syu3YA3p1hf3EPqObRw==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.4.tgz", + "integrity": "sha512-mRsi2vJsk4Bx/AFsNBqOH2fqedxn5L/moT58xgg51DjX1la64Z3Npicut2VbhvDFO26qjWtPMsVxCd80YTFVeg==", "cpu": [ "arm64" ], @@ -584,9 +584,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.3.tgz", - "integrity": "sha512-FKQJKkK5MXcBHoNZMDNUAg1+WcZlV/cuXrWCoGF/TvdRiYS4znA0m5Il5idUwfxrE20bG/vU1Cr5e1AD6IEIjQ==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.4.tgz", + "integrity": "sha512-4iPufZ1TMOD3oBlGFqHXBpa3KFT46aLl6Vy7gwed0ZSYgHaZ/mihbYb4t7Z9etjkC9Al3ZYIoOaHrU60gcMy7g==", "cpu": [ "x64" ], @@ -599,9 +599,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.3.tgz", - "integrity": "sha512-kw7e3FXU+VsJSSSl2nMKvACYlwtvZB8RUIeVShIEY6PVnuZ3c9+L9lWB2nWeeKWNNYDdtL19foCQ0ZyUL7nqGw==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.4.tgz", + "integrity": "sha512-Lviw8EzxsVQKpbS+rSt6/6zjn9ashUZ7Tbuvc2YENgRl0yZTktGlachZ9KMJUsVjZEGFVu336kl5lBgDN6PmpA==", "cpu": [ "arm64" ], @@ -614,9 +614,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.3.tgz", - "integrity": "sha512-tPfZiwF9rO0jW6Jh9ipi58N5ZLoSjdxXeSrAYypy4psA2Yl1dAMhM71KxVfmjZhJmxRjSnb29YlRXXhh3GqzYw==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.4.tgz", + "integrity": "sha512-YHbSFlLgDwglFn0lAO3Zsdrife9jcQXQhgRp77YiTDja23FrC2uwnhXMNkAucthsf+Psr7sTwYEryxz6FPAVqw==", "cpu": [ "x64" ], @@ -629,9 +629,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.3.tgz", - "integrity": "sha512-ERDyjOgYeKe0Vrlr1iLrqTByB026YLPzTytDTz1DRCYM+JI92Dw2dbpRHYmdqn6VBnQ9Bor6J8ZlNwdZdxjlSg==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.4.tgz", + "integrity": "sha512-vz59ijyrTG22Hshaj620e5yhs2dU1WJy723ofc+KUgxVCM6zxQESmWdMuVmUzxtGqtj5heHyB44PjV/HKsEmuQ==", "cpu": [ "arm64" ], @@ -644,9 +644,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.3.tgz", - "integrity": "sha512-nXesBZ2Ad1qL+Rm3crN7NmEVJ5uvfLFPLJev3x1j3feCQXfAhoYrojC681RhpdOph8NsvKBBwpYZHR7W0ifTTA==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.4.tgz", + "integrity": "sha512-3sRbQ6W5kAiVQRBWREGJNd1YE7OgzS0AmOGjDmX/qZZecq8NFlQsQH0IfXjjmD0XtUYqr64e0EKNFjMUlPL3Cw==", "cpu": [ "x64" ], @@ -659,9 +659,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.3.tgz", - "integrity": "sha512-zr48Cg/8zkzZCzDHNxXO/89bf9e+r4HtzNUPoz4GmgAkF1gFAFmfgOdCbR8zMbzFDGb1FqBBhdXUpcTQRYS1cQ==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.4.tgz", + "integrity": "sha512-z/4ArqOo9EImzTi4b6Vq+pthLnepFzJ92BnofU1jgNlcVb+UqynVFdoXMCFreTK7FdhqAzH0vmdwW5373Hm9pg==", "cpu": [ "arm" ], @@ -674,9 +674,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.3.tgz", - "integrity": "sha512-qXvYKmXj8GcJgWq3aGvxL/JG1ZM3UR272SdPU4QSTzD0eymrM7leiZH77pvY3UetCy0k1xuXZ+VPvoJNdtrsWQ==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.4.tgz", + "integrity": "sha512-ZWmWORaPbsPwmyu7eIEATFlaqm0QGt+joRE9sKcnVUG3oBbr/KYdNE2TnkzdQwX6EDRdg/x8Q4EZQTXoClUqqA==", "cpu": [ "arm64" ], @@ -689,9 +689,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.3.tgz", - "integrity": "sha512-7XlCKCA0nWcbvYpusARWkFjRQNWNGlt45S+Q18UeS///K6Aw8bB2FKYe9mhVWy/XLShvCweOLZPrnMswIaDXQA==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.4.tgz", + "integrity": "sha512-EGc4vYM7i1GRUIMqRZNCTzJh25MHePYsnQfKDexD8uPTCm9mK56NIL04LUfX2aaJ+C9vyEp2fJ7jbqFEYgO9lQ==", "cpu": [ "ia32" ], @@ -704,9 +704,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.3.tgz", - "integrity": "sha512-qGTgjweER5xqweiWtUIDl9OKz338EQqCwbS9c2Bh5jgEH19xQ1yhgGPNesugmDFq+UUSDtWgZ264st26b3de8A==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.4.tgz", + "integrity": "sha512-WVhIKO26kmm8lPmNrUikxSpXcgd6HDog0cx12BUfA2PkmURHSgx9G6vA19lrlQOMw+UjMZ+l3PpbtzffCxFDRg==", "cpu": [ "loong64" ], @@ -719,9 +719,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.3.tgz", - "integrity": "sha512-gy1bFskwEyxVMFRNYSvBauDIWNggD6pyxUksc0MV9UOBD138dKTzr8XnM2R4mBsHwVzeuIH8X5JhmNs2Pzrx+A==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.4.tgz", + "integrity": "sha512-keYY+Hlj5w86hNp5JJPuZNbvW4jql7c1eXdBUHIJGTeN/+0QFutU3GrS+c27L+NTmzi73yhtojHk+lr2+502Mw==", "cpu": [ "mips64el" ], @@ -734,9 +734,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.3.tgz", - "integrity": "sha512-UrYLFu62x1MmmIe85rpR3qou92wB9lEXluwMB/STDzPF9k8mi/9UvNsG07Tt9AqwPQXluMQ6bZbTzYt01+Ue5g==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.4.tgz", + "integrity": "sha512-tQ92n0WMXyEsCH4m32S21fND8VxNiVazUbU4IUGVXQpWiaAxOBvtOtbEt3cXIV3GEBydYsY8pyeRMJx9kn3rvw==", "cpu": [ "ppc64" ], @@ -749,9 +749,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.3.tgz", - "integrity": "sha512-9E73TfyMCbE+1AwFOg3glnzZ5fBAFK4aawssvuMgCRqCYzE0ylVxxzjEfut8xjmKkR320BEoMui4o/t9KA96gA==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.4.tgz", + "integrity": "sha512-tRRBey6fG9tqGH6V75xH3lFPpj9E8BH+N+zjSUCnFOX93kEzqS0WdyJHkta/mmJHn7MBaa++9P4ARiU4ykjhig==", "cpu": [ "riscv64" ], @@ -764,9 +764,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.3.tgz", - "integrity": "sha512-LlmsbuBdm1/D66TJ3HW6URY8wO6IlYHf+ChOUz8SUAjVTuaisfuwCOAgcxo3Zsu3BZGxmI7yt//yGOxV+lHcEA==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.4.tgz", + "integrity": "sha512-152aLpQqKZYhThiJ+uAM4PcuLCAOxDsCekIbnGzPKVBRUDlgaaAfaUl5NYkB1hgY6WN4sPkejxKlANgVcGl9Qg==", "cpu": [ "s390x" ], @@ -779,9 +779,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.3.tgz", - "integrity": "sha512-ogV0+GwEmvwg/8ZbsyfkYGaLACBQWDvO0Kkh8LKBGKj9Ru8VM39zssrnu9Sxn1wbapA2qNS6BiLdwJZGouyCwQ==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.4.tgz", + "integrity": "sha512-Mi4aNA3rz1BNFtB7aGadMD0MavmzuuXNTaYL6/uiYIs08U7YMPETpgNn5oue3ICr+inKwItOwSsJDYkrE9ekVg==", "cpu": [ "x64" ], @@ -794,9 +794,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.3.tgz", - "integrity": "sha512-o1jLNe4uzQv2DKXMlmEzf66Wd8MoIhLNO2nlQBHLtWyh2MitDG7sMpfCO3NTcoTMuqHjfufgUQDFRI5C+xsXQw==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.4.tgz", + "integrity": "sha512-9+Wxx1i5N/CYo505CTT7T+ix4lVzEdz0uCoYGxM5JDVlP2YdDC1Bdz+Khv6IbqmisT0Si928eAxbmGkcbiuM/A==", "cpu": [ "x64" ], @@ -809,9 +809,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.3.tgz", - "integrity": "sha512-AZJCnr5CZgZOdhouLcfRdnk9Zv6HbaBxjcyhq0StNcvAdVZJSKIdOiPB9az2zc06ywl0ePYJz60CjdKsQacp5Q==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.4.tgz", + "integrity": "sha512-MFsHleM5/rWRW9EivFssop+OulYVUoVcqkyOkjiynKBCGBj9Lihl7kh9IzrreDyXa4sNkquei5/DTP4uCk25xw==", "cpu": [ "x64" ], @@ -824,9 +824,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.3.tgz", - "integrity": "sha512-Acsujgeqg9InR4glTRvLKGZ+1HMtDm94ehTIHKhJjFpgVzZG9/pIcWW/HA/DoMfEyXmANLDuDZ2sNrWcjq1lxw==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.4.tgz", + "integrity": "sha512-6Xq8SpK46yLvrGxjp6HftkDwPP49puU4OF0hEL4dTxqCbfx09LyrbUj/D7tmIRMj5D5FCUPksBbxyQhp8tmHzw==", "cpu": [ "x64" ], @@ -839,9 +839,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.3.tgz", - "integrity": "sha512-FSrAfjVVy7TifFgYgliiJOyYynhQmqgPj15pzLyJk8BUsnlWNwP/IAy6GAiB1LqtoivowRgidZsfpoYLZH586A==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.4.tgz", + "integrity": "sha512-PkIl7Jq4mP6ke7QKwyg4fD4Xvn8PXisagV/+HntWoDEdmerB2LTukRZg728Yd1Fj+LuEX75t/hKXE2Ppk8Hh1w==", "cpu": [ "arm64" ], @@ -854,9 +854,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.3.tgz", - "integrity": "sha512-xTScXYi12xLOWZ/sc5RBmMN99BcXp/eEf7scUC0oeiRoiT5Vvo9AycuqCp+xdpDyAU+LkrCqEpUS9fCSZF8J3Q==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.4.tgz", + "integrity": "sha512-ga676Hnvw7/ycdKB53qPusvsKdwrWzEyJ+AtItHGoARszIqvjffTwaaW3b2L6l90i7MO9i+dlAW415INuRhSGg==", "cpu": [ "ia32" ], @@ -869,9 +869,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.3.tgz", - "integrity": "sha512-FbUN+0ZRXsypPyWE2IwIkVjDkDnJoMJARWOcFZn4KPPli+QnKqF0z1anvfaYe3ev5HFCpRDLLBDHyOALLppWHw==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.4.tgz", + "integrity": "sha512-HP0GDNla1T3ZL8Ko/SHAS2GgtjOg+VmWnnYLhuTksr++EnduYB0f3Y2LzHsUwb2iQ13JGoY6G3R8h6Du/WG6uA==", "cpu": [ "x64" ], @@ -915,9 +915,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.8.1.tgz", - "integrity": "sha512-PWiOzLIUAjN/w5K17PoF4n6sKBw0gqLHPhywmYHP4t1VFQQVYeb1yWsJwnMVEMl3tUHME7X/SJPZLmtG7XBDxQ==", + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.9.1.tgz", + "integrity": "sha512-Y27x+MBLjXa+0JWDhykM3+JE+il3kHKAEqabfEWq3SDhZjLYb6/BHL/JKFnH3fe207JaXkyDo685Oc2Glt6ifA==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" @@ -991,18 +991,18 @@ } }, "node_modules/@eslint/js": { - "version": "8.49.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.49.0.tgz", - "integrity": "sha512-1S8uAY/MTJqVx0SC4epBq+N2yhuwtNwLbJYNZyhL2pO1ZVKn5HFXav5T41Ryzy9K9V7ZId2JB2oy/W4aCd9/2w==", + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.51.0.tgz", + "integrity": "sha512-HxjQ8Qn+4SI3/AFv6sOrDB+g6PpUTDwSJiQqOrnneEk8L71161srI9gjzzZvYVbzHiVg/BvcH95+cK/zfIt4pg==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/@github/combobox-nav": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@github/combobox-nav/-/combobox-nav-2.2.0.tgz", - "integrity": "sha512-28kJUfzzPDYNyYsFCP/be8aXvEpjcEuciVENZlopcaUynS/4Pt9ll88Kl9l1D1Vy6a9+k+Km/YGJQ1e+gzG7SQ==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@github/combobox-nav/-/combobox-nav-2.3.0.tgz", + "integrity": "sha512-5CX03DbsLZ41dX5hKHyQKtg133U6lruX4TD9G0Zs4W8BpWy7lN8DJ6TYaeZN/V7x8K34coaqNYk/Y5ic7stfkg==" }, "node_modules/@github/markdown-toolbar-element": { "version": "2.2.1", @@ -1767,9 +1767,9 @@ } }, "node_modules/@stoplight/spectral-rulesets": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/@stoplight/spectral-rulesets/-/spectral-rulesets-1.17.0.tgz", - "integrity": "sha512-fRWunqvtP9k0vRonwqXQ663Xt1UfmOZRdaO+S02zA3mlKdA5a1vBQjVV9QYK70TXWmqUfmabc1G35FHNT+7iRw==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/@stoplight/spectral-rulesets/-/spectral-rulesets-1.18.0.tgz", + "integrity": "sha512-7LiCteW5pofMuBtf1BO+Ig5pT1XV9oqGrUjqWwSqD6jcy8ejE45pOQpef4h4um9tj3Y+tewfdbthLjhu8sdoeA==", "dev": true, "dependencies": { "@asyncapi/specs": "^4.1.0", @@ -1903,9 +1903,9 @@ } }, "node_modules/@types/d3-scale": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-4.0.4.tgz", - "integrity": "sha512-eq1ZeTj0yr72L8MQk6N6heP603ubnywSDRfNpi5enouR112HzGLS6RIvExCzZTraFF4HdzNpJMwA/zGiMoHUUw==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-4.0.5.tgz", + "integrity": "sha512-w/C++3W394MHzcLKO2kdsIn5KKNTOqeQVzyPSGPLzQbkPw/jpeaGtSRlakcKevGgGsjJxGsbqS0fPrVFDbHrDA==", "dependencies": { "@types/d3-time": "*" } @@ -1916,40 +1916,40 @@ "integrity": "sha512-dsoJGEIShosKVRBZB0Vo3C8nqSDqVGujJU6tPznsBJxNJNwMF8utmS83nvCBKQYPpjCzaaHcrf66iTRpZosLPw==" }, "node_modules/@types/d3-time": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.0.tgz", - "integrity": "sha512-sZLCdHvBUcNby1cB6Fd3ZBrABbjz3v1Vm90nysCQ6Vt7vd6e/h9Lt7SiJUoEX0l4Dzc7P5llKyhqSi1ycSf1Hg==" + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.1.tgz", + "integrity": "sha512-5j/AnefKAhCw4HpITmLDTPlf4vhi8o/dES+zbegfPb7LaGfNyqkLxBR6E+4yvTAgnJLmhe80EXFMzUs38fw4oA==" }, "node_modules/@types/debug": { - "version": "4.1.8", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.8.tgz", - "integrity": "sha512-/vPO1EPOs306Cvhwv7KfVfYvOJqA/S/AXjaHQiJboCZzcNDb+TIJFN9/2C9DZ//ijSKWioNyUxD792QmDJ+HKQ==", + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.9.tgz", + "integrity": "sha512-8Hz50m2eoS56ldRlepxSBa6PWEVCtzUo/92HgLc2qTMnotJNIm7xP+UZhyWoYsyOdd5dxZ+NZLb24rsKyFs2ow==", "dependencies": { "@types/ms": "*" } }, "node_modules/@types/es-aggregate-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@types/es-aggregate-error/-/es-aggregate-error-1.0.2.tgz", - "integrity": "sha512-erqUpFXksaeR2kejKnhnjZjbFxUpGZx4Z7ydNL9ie8tEhXPiZTsLeUDJ6aR1F8j5wWUAtOAQWUqkc7givBJbBA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@types/es-aggregate-error/-/es-aggregate-error-1.0.3.tgz", + "integrity": "sha512-GmY61WWXQemfJp+qmMu6RsrNev0eoEWeWtg46w9pdXje23jRJrf7yETbAkl7F+CfQJSKW7w3//sTYtQTt+R5Lg==", "dev": true, "dependencies": { "@types/node": "*" } }, "node_modules/@types/eslint": { - "version": "8.44.2", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.2.tgz", - "integrity": "sha512-sdPRb9K6iL5XZOmBubg8yiFp5yS/JdUDQsq5e6h95km91MCYMuvp7mh1fjPEYUhvHepKpZOjnEaMBR4PxjWDzg==", + "version": "8.44.3", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.3.tgz", + "integrity": "sha512-iM/WfkwAhwmPff3wZuPLYiHX18HI24jU8k1ZSH7P8FHwxTjZ2P6CoX2wnF43oprR+YXJM6UUxATkNvyv/JHd+g==", "dependencies": { "@types/estree": "*", "@types/json-schema": "*" } }, "node_modules/@types/eslint-scope": { - "version": "3.7.4", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.4.tgz", - "integrity": "sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==", + "version": "3.7.5", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.5.tgz", + "integrity": "sha512-JNvhIEyxVW6EoMIFIvj93ZOywYFatlpu9deeH6eSx6PE3WHYvHaQtmHmQeNw7aA81bYGBPPQqdtBm6b1SsQMmA==", "dependencies": { "@types/eslint": "*", "@types/estree": "*" @@ -1972,44 +1972,44 @@ "dev": true }, "node_modules/@types/marked": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/@types/marked/-/marked-4.3.1.tgz", - "integrity": "sha512-vSSbKZFbNktrQ15v7o1EaH78EbWV+sPQbPjHG+Cp8CaNcPFUEfjZ0Iml/V0bFDwsTlYe8o6XC5Hfdp91cqPV2g==" + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@types/marked/-/marked-4.3.2.tgz", + "integrity": "sha512-a79Yc3TOk6dGdituy8hmTTJXjOkZ7zsFYV10L337ttq/rec8lRMDBpV7fL3uLx6TgbFCa5DU/h8FmIBQPSbU0w==" }, "node_modules/@types/mdast": { - "version": "3.0.12", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.12.tgz", - "integrity": "sha512-DT+iNIRNX884cx0/Q1ja7NyUPpZuv0KPyL5rGNxm1WC1OtHstl7n4Jb7nk+xacNShQMbczJjt8uFzznpp6kYBg==", + "version": "3.0.13", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.13.tgz", + "integrity": "sha512-HjiGiWedR0DVFkeNljpa6Lv4/IZU1+30VY5d747K7lBudFc3R0Ibr6yJ9lN3BE28VnZyDfLF/VB1Ql1ZIbKrmg==", "dependencies": { "@types/unist": "^2" } }, "node_modules/@types/minimist": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", - "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.3.tgz", + "integrity": "sha512-ZYFzrvyWUNhaPomn80dsMNgMeXxNWZBdkuG/hWlUvXvbdUH8ZERNBGXnU87McuGcWDsyzX2aChCv/SVN348k3A==", "dev": true }, "node_modules/@types/ms": { - "version": "0.7.31", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", - "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==" + "version": "0.7.32", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.32.tgz", + "integrity": "sha512-xPSg0jm4mqgEkNhowKgZFBNtwoEwF6gJ4Dhww+GFpm3IgtNseHQZ5IqdNwnquZEoANxyDAKDRAdVo4Z72VvD/g==" }, "node_modules/@types/node": { - "version": "20.6.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.6.3.tgz", - "integrity": "sha512-HksnYH4Ljr4VQgEy2lTStbCKv/P590tmPe5HqOnv9Gprffgv5WXAY+Y5Gqniu0GGqeTCUdBnzC3QSrzPkBkAMA==" + "version": "20.8.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.3.tgz", + "integrity": "sha512-jxiZQFpb+NlH5kjW49vXxvxTjeeqlbsnTAdBTKpzEdPs9itay7MscYXz3Fo9VYFEsfQ6LJFitHad3faerLAjCw==" }, "node_modules/@types/normalize-package-data": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", - "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.2.tgz", + "integrity": "sha512-lqa4UEhhv/2sjjIQgjX8B+RBjj47eo0mzGasklVJ78UKGQY1r0VpB9XHDaZZO9qzEFDdy4MrXLuEaSmPrPSe/A==", "dev": true }, "node_modules/@types/sarif": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@types/sarif/-/sarif-2.1.4.tgz", - "integrity": "sha512-4xKHMdg3foh3Va1fxTzY1qt8QVqmaJpGWsVvtjQrJBn+/bkig2pWFKJ4FPI2yLI4PAj0SUKiPO4Vd7ggYIMZjQ==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@types/sarif/-/sarif-2.1.5.tgz", + "integrity": "sha512-onJXseJAteCVczKQbO/Tx8zrvhZwZkAd+T7GGYXZvJJ7pzy7We5NJXcNk2oZoUbcnTP/AjkAH7XtPCkpfRBOnQ==", "dev": true }, "node_modules/@types/tern": { @@ -2032,9 +2032,9 @@ "dev": true }, "node_modules/@vitejs/plugin-vue": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-4.3.4.tgz", - "integrity": "sha512-ciXNIHKPriERBisHFBvnTbfKa6r9SAesOYXeGDzgegcvy9Q4xdScSHAmKbNT0M3O0S9LKhIf5/G+UYG4NnnzYw==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-4.4.0.tgz", + "integrity": "sha512-xdguqb+VUwiRpSg+nsc2HtbAUSGak25DXYvpQQi4RVU1Xq1uworyoH/md9Rfd8zMmPR/pSghr309QNcftUVseg==", "dev": true, "engines": { "node": "^14.18.0 || >=16.0.0" @@ -2045,26 +2045,26 @@ } }, "node_modules/@vitest/expect": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.34.5.tgz", - "integrity": "sha512-/3RBIV9XEH+nRpRMqDJBufKIOQaYUH2X6bt0rKSCW0MfKhXFLYsR5ivHifeajRSTsln0FwJbitxLKHSQz/Xwkw==", + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.34.6.tgz", + "integrity": "sha512-QUzKpUQRc1qC7qdGo7rMK3AkETI7w18gTCUrsNnyjjJKYiuUB9+TQK3QnR1unhCnWRC0AbKv2omLGQDF/mIjOw==", "dev": true, "dependencies": { - "@vitest/spy": "0.34.5", - "@vitest/utils": "0.34.5", - "chai": "^4.3.7" + "@vitest/spy": "0.34.6", + "@vitest/utils": "0.34.6", + "chai": "^4.3.10" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/runner": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.34.5.tgz", - "integrity": "sha512-RDEE3ViVvl7jFSCbnBRyYuu23XxmvRTSZWW6W4M7eC5dOsK75d5LIf6uhE5Fqf809DQ1+9ICZZNxhIolWHU4og==", + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.34.6.tgz", + "integrity": "sha512-1CUQgtJSLF47NnhN+F9X2ycxUP0kLHQ/JWvNHbeBfwW8CzEGgeskzNnHDyv1ieKTltuR6sdIHV+nmR6kPxQqzQ==", "dev": true, "dependencies": { - "@vitest/utils": "0.34.5", + "@vitest/utils": "0.34.6", "p-limit": "^4.0.0", "pathe": "^1.1.1" }, @@ -2100,9 +2100,9 @@ } }, "node_modules/@vitest/snapshot": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.34.5.tgz", - "integrity": "sha512-+ikwSbhu6z2yOdtKmk/aeoDZ9QPm2g/ZO5rXT58RR9Vmu/kB2MamyDSx77dctqdZfP3Diqv4mbc/yw2kPT8rmA==", + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.34.6.tgz", + "integrity": "sha512-B3OZqYn6k4VaN011D+ve+AA4whM4QkcwcrwaKwAbyyvS/NB1hCWjFIBQxAQQSQir9/RtyAAGuq+4RJmbn2dH4w==", "dev": true, "dependencies": { "magic-string": "^0.30.1", @@ -2114,9 +2114,9 @@ } }, "node_modules/@vitest/snapshot/node_modules/magic-string": { - "version": "0.30.3", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.3.tgz", - "integrity": "sha512-B7xGbll2fG/VjP+SWg4sX3JynwIU0mjoTc6MPpKNuIvftk6u6vqhDnk1R80b8C2GBR6ywqy+1DcKBrevBg+bmw==", + "version": "0.30.4", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.4.tgz", + "integrity": "sha512-Q/TKtsC5BPm0kGqgBIF9oXAs/xEf2vRKiIB4wCRQTJOQIByZ1d+NnUOotvJOvNpi5RNIgVOMC3pOuaP1ZTDlVg==", "dev": true, "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" @@ -2126,9 +2126,9 @@ } }, "node_modules/@vitest/spy": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.34.5.tgz", - "integrity": "sha512-epsicsfhvBjRjCMOC/3k00mP/TBGQy8/P0DxOFiWyLt55gnZ99dqCfCiAsKO17BWVjn4eZRIjKvcqNmSz8gvmg==", + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.34.6.tgz", + "integrity": "sha512-xaCvneSaeBw/cz8ySmF7ZwGvL0lBjfvqc1LpQ/vcdHEvpLn3Ff1vAvjw+CoGn0802l++5L/pxb7whwcWAw+DUQ==", "dev": true, "dependencies": { "tinyspy": "^2.1.1" @@ -2138,9 +2138,9 @@ } }, "node_modules/@vitest/utils": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.34.5.tgz", - "integrity": "sha512-ur6CmmYQoeHMwmGb0v+qwkwN3yopZuZyf4xt1DBBSGBed8Hf9Gmbm/5dEWqgpLPdRx6Av6jcWXrjcKfkTzg/pw==", + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.34.6.tgz", + "integrity": "sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A==", "dev": true, "dependencies": { "diff-sequences": "^29.4.3", @@ -2189,9 +2189,9 @@ } }, "node_modules/@vue/compiler-sfc/node_modules/magic-string": { - "version": "0.30.3", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.3.tgz", - "integrity": "sha512-B7xGbll2fG/VjP+SWg4sX3JynwIU0mjoTc6MPpKNuIvftk6u6vqhDnk1R80b8C2GBR6ywqy+1DcKBrevBg+bmw==", + "version": "0.30.4", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.4.tgz", + "integrity": "sha512-Q/TKtsC5BPm0kGqgBIF9oXAs/xEf2vRKiIB4wCRQTJOQIByZ1d+NnUOotvJOvNpi5RNIgVOMC3pOuaP1ZTDlVg==", "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" }, @@ -2229,9 +2229,9 @@ } }, "node_modules/@vue/reactivity-transform/node_modules/magic-string": { - "version": "0.30.3", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.3.tgz", - "integrity": "sha512-B7xGbll2fG/VjP+SWg4sX3JynwIU0mjoTc6MPpKNuIvftk6u6vqhDnk1R80b8C2GBR6ywqy+1DcKBrevBg+bmw==", + "version": "0.30.4", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.4.tgz", + "integrity": "sha512-Q/TKtsC5BPm0kGqgBIF9oXAs/xEf2vRKiIB4wCRQTJOQIByZ1d+NnUOotvJOvNpi5RNIgVOMC3pOuaP1ZTDlVg==", "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" }, @@ -2787,9 +2787,9 @@ } }, "node_modules/asciinema-player": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/asciinema-player/-/asciinema-player-3.6.1.tgz", - "integrity": "sha512-FfTABH/N6pjG74A6cCfsrirTSM4UAOLMzcFXb0zS34T5czvg3CyUy2TAqa3WEs5owUFHcuN1Y2y8o0n2yjeMvQ==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/asciinema-player/-/asciinema-player-3.6.2.tgz", + "integrity": "sha512-698O3/Vm2+V6uFlc6oYma67IZByQsiNpduhEGhuqrxBmKpIYpgouLNNJ3R8DrRPTNNMISHfnLgvAp1x8ChgrTw==", "dependencies": { "@babel/runtime": "^7.21.0", "solid-js": "^1.3.0" @@ -2922,9 +2922,9 @@ } }, "node_modules/browserslist": { - "version": "4.21.11", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.11.tgz", - "integrity": "sha512-xn1UXOKUz7DjdGlg9RrUr0GGiWzI97UQJnugHtH0OLDfJB7jMgoIkYvRIEO1l9EeEERVqeqLYOcFBW9ldjypbQ==", + "version": "4.22.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz", + "integrity": "sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==", "funding": [ { "type": "opencollective", @@ -2940,8 +2940,8 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001538", - "electron-to-chromium": "^1.4.526", + "caniuse-lite": "^1.0.30001541", + "electron-to-chromium": "^1.4.535", "node-releases": "^2.0.13", "update-browserslist-db": "^1.0.13" }, @@ -3072,9 +3072,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001538", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001538.tgz", - "integrity": "sha512-HWJnhnID+0YMtGlzcp3T9drmBJUVDchPJ08tpUGFLs9CYlwWPH2uLgpHn8fND5pCgXVtnGS3H4QR9XLMHVNkHw==", + "version": "1.0.30001546", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001546.tgz", + "integrity": "sha512-zvtSJwuQFpewSyRrI3AsftF6rM0X80mZkChIt1spBGEvRglCrjTniXvinc8JKRoqTwXAgvqTImaN9igfSMtUBw==", "funding": [ { "type": "opencollective", @@ -3091,18 +3091,18 @@ ] }, "node_modules/chai": { - "version": "4.3.8", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.8.tgz", - "integrity": "sha512-vX4YvVVtxlfSZ2VecZgFUTU5qPCYsobVI2O9FmwEXBhDigYGQA6jRXCycIs1yJnnWbZ6/+a2zNIF5DfVCcJBFQ==", + "version": "4.3.10", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.10.tgz", + "integrity": "sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g==", "dev": true, "dependencies": { "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^4.1.2", - "get-func-name": "^2.0.0", - "loupe": "^2.3.1", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", "pathval": "^1.1.1", - "type-detect": "^4.0.5" + "type-detect": "^4.0.8" }, "engines": { "node": ">=4" @@ -3133,10 +3133,13 @@ } }, "node_modules/check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", "dev": true, + "dependencies": { + "get-func-name": "^2.0.2" + }, "engines": { "node": "*" } @@ -3150,9 +3153,9 @@ } }, "node_modules/ci-info": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", - "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", "dev": true, "funding": [ { @@ -4346,9 +4349,9 @@ } }, "node_modules/dompurify": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.0.5.tgz", - "integrity": "sha512-F9e6wPGtY+8KNMRAVfxeCOHU0/NPWMSENNq4pQctuXRqqdEPW7q3CrLbR5Nse044WwacyjHGOMlvNsBe1y6z9A==" + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.0.6.tgz", + "integrity": "sha512-ilkD8YEnnGh1zJ240uJsW7AzE+2qpbOUYjacomn3AvJ6J4JhKGSZ2nh4wUIXPZrEPppaCLx5jFe8T89Rk8tQ7w==" }, "node_modules/domutils": { "version": "3.1.0", @@ -4391,9 +4394,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.527", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.527.tgz", - "integrity": "sha512-EafxEiEDzk2aLrdbtVczylHflHdHkNrpGNHIgDyA63sUQLQVS2ayj2hPw3RsVB42qkwURH+T2OxV7kGPUuYszA==" + "version": "1.4.544", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.544.tgz", + "integrity": "sha512-54z7squS1FyFRSUqq/knOFSptjjogLZXbKcYk3B0qkE1KZzvqASwRZnY2KzZQJqIYLVD38XZeoiMRflYSwyO4w==" }, "node_modules/elkjs": { "version": "0.8.2", @@ -4587,9 +4590,9 @@ } }, "node_modules/esbuild": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.3.tgz", - "integrity": "sha512-UlJ1qUUA2jL2nNib1JTSkifQTcYTroFqRjwCFW4QYEKEsixXD5Tik9xML7zh2gTxkYTBKGHNH9y7txMwVyPbjw==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.4.tgz", + "integrity": "sha512-x7jL0tbRRpv4QUyuDMjONtWFciygUxWaUM1kMX2zWxI0X2YWOt7MSA0g4UdeSiHM8fcYVzpQhKYOycZwxTdZkA==", "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" @@ -4598,28 +4601,28 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/android-arm": "0.19.3", - "@esbuild/android-arm64": "0.19.3", - "@esbuild/android-x64": "0.19.3", - "@esbuild/darwin-arm64": "0.19.3", - "@esbuild/darwin-x64": "0.19.3", - "@esbuild/freebsd-arm64": "0.19.3", - "@esbuild/freebsd-x64": "0.19.3", - "@esbuild/linux-arm": "0.19.3", - "@esbuild/linux-arm64": "0.19.3", - "@esbuild/linux-ia32": "0.19.3", - "@esbuild/linux-loong64": "0.19.3", - "@esbuild/linux-mips64el": "0.19.3", - "@esbuild/linux-ppc64": "0.19.3", - "@esbuild/linux-riscv64": "0.19.3", - "@esbuild/linux-s390x": "0.19.3", - "@esbuild/linux-x64": "0.19.3", - "@esbuild/netbsd-x64": "0.19.3", - "@esbuild/openbsd-x64": "0.19.3", - "@esbuild/sunos-x64": "0.19.3", - "@esbuild/win32-arm64": "0.19.3", - "@esbuild/win32-ia32": "0.19.3", - "@esbuild/win32-x64": "0.19.3" + "@esbuild/android-arm": "0.19.4", + "@esbuild/android-arm64": "0.19.4", + "@esbuild/android-x64": "0.19.4", + "@esbuild/darwin-arm64": "0.19.4", + "@esbuild/darwin-x64": "0.19.4", + "@esbuild/freebsd-arm64": "0.19.4", + "@esbuild/freebsd-x64": "0.19.4", + "@esbuild/linux-arm": "0.19.4", + "@esbuild/linux-arm64": "0.19.4", + "@esbuild/linux-ia32": "0.19.4", + "@esbuild/linux-loong64": "0.19.4", + "@esbuild/linux-mips64el": "0.19.4", + "@esbuild/linux-ppc64": "0.19.4", + "@esbuild/linux-riscv64": "0.19.4", + "@esbuild/linux-s390x": "0.19.4", + "@esbuild/linux-x64": "0.19.4", + "@esbuild/netbsd-x64": "0.19.4", + "@esbuild/openbsd-x64": "0.19.4", + "@esbuild/sunos-x64": "0.19.4", + "@esbuild/win32-arm64": "0.19.4", + "@esbuild/win32-ia32": "0.19.4", + "@esbuild/win32-x64": "0.19.4" } }, "node_modules/esbuild-loader": { @@ -4671,15 +4674,15 @@ } }, "node_modules/eslint": { - "version": "8.49.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.49.0.tgz", - "integrity": "sha512-jw03ENfm6VJI0jA9U+8H5zfl5b+FvuU3YYvZRdZHOlU2ggJkxrlkJH4HcDrZpj6YwD8kuYqvQM8LyesoazrSOQ==", + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.51.0.tgz", + "integrity": "sha512-2WuxRZBrlwnXi+/vFSJyjMqrNjtJqiasMzehF0shoLaW7DzS3/9Yvrmq5JiT66+pNjiX4UBnLDiKHcWAr/OInA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "8.49.0", + "@eslint/js": "8.51.0", "@humanwhocodes/config-array": "^0.11.11", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -4992,14 +4995,14 @@ } }, "node_modules/eslint-plugin-vue-scoped-css": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-vue-scoped-css/-/eslint-plugin-vue-scoped-css-2.5.0.tgz", - "integrity": "sha512-vR+raYNE1aQ69lS1lZGiKoz8rXFI3MWf2fxrfns/XCQ0XT5sIguhDtQS+9JmUQJClenLDEe2CQx7P+eeSdF4cA==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue-scoped-css/-/eslint-plugin-vue-scoped-css-2.5.1.tgz", + "integrity": "sha512-ynbeCHd0dzkUBoL1q10GNpGh/BZD0Frw8Z8txPFyuhiHN2m5ZT6gvfe2GtdEs0Rq3+NE+5yexfz0PDX/bgKuJw==", "dev": true, "dependencies": { "eslint-utils": "^3.0.0", "lodash": "^4.17.21", - "postcss": "^8.4.6", + "postcss": "^8.4.31", "postcss-safe-parser": "^6.0.0", "postcss-scss": "^4.0.3", "postcss-selector-parser": "^6.0.9", @@ -5017,9 +5020,9 @@ } }, "node_modules/eslint-plugin-wc": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-wc/-/eslint-plugin-wc-2.0.3.tgz", - "integrity": "sha512-O3i71FodYMArf8DBs+OuDQ8SH8SMiNaJ4GIcXRDsGURPdvBrVDNS9+GQ0xwmzhqUWV0df5xq8irpceA6YBdJmg==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-wc/-/eslint-plugin-wc-2.0.4.tgz", + "integrity": "sha512-ORu7MBv0hXIvq894EJad70m+AvHGbmrDdKT6lcgtCVVhEbuIAyxg0ilfqqqHOmsh8PfcUBeEae3y7CElKvm1KQ==", "dev": true, "dependencies": { "is-valid-element-name": "^1.0.0", @@ -5363,12 +5366,12 @@ } }, "node_modules/flat-cache": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.0.tgz", - "integrity": "sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.1.tgz", + "integrity": "sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q==", "dev": true, "dependencies": { - "flatted": "^3.2.7", + "flatted": "^3.2.9", "keyv": "^4.5.3", "rimraf": "^3.0.2" }, @@ -5457,7 +5460,8 @@ "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true }, "node_modules/function.prototype.name": { "version": "1.1.6", @@ -5496,9 +5500,9 @@ } }, "node_modules/get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", "dev": true, "engines": { "node": "*" @@ -5678,9 +5682,9 @@ } }, "node_modules/globals": { - "version": "13.22.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.22.0.tgz", - "integrity": "sha512-H1Ddc/PbZHTDVJSnj8kWptIRSD6AM3pK+mKytuIVF4uoBV7rshFlhhvA58ceJ5wp3Er58w6zj7bykMpYXt3ETw==", + "version": "13.23.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", + "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -5777,12 +5781,9 @@ } }, "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dependencies": { - "function-bind": "^1.1.1" - }, + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", + "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", "engines": { "node": ">= 0.4.0" } @@ -6494,9 +6495,9 @@ } }, "node_modules/jackspeak": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.3.tgz", - "integrity": "sha512-R2bUw+kVZFS/h1AZqBKrSgDmdmjApzgY0AlCPumopFiAlbUxE2gf+SCuBzQ0cP5hHmUmFYF5yw55T97Th5Kstg==", + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", + "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", "dev": true, "dependencies": { "@isaacs/cliui": "^8.0.2" @@ -6725,9 +6726,9 @@ "integrity": "sha512-b+z6yF1d4EOyDgylzQo5IminlUmzSeqR1hs/bzjBNjuGras4FXq/6TrzjxfN0j+TmI0ltJzTNlqXUMCniciwKQ==" }, "node_modules/katex": { - "version": "0.16.8", - "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.8.tgz", - "integrity": "sha512-ftuDnJbcbOckGY11OO+zg3OofESlbR5DRl2cmN8HeWeeFIV7wTXvAOx8kEjZjobhA+9wh2fbKeO6cdcA9Mnovg==", + "version": "0.16.9", + "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.9.tgz", + "integrity": "sha512-fsSYjWS0EEOwvy81j3vRA8TEAhQhKiqO+FQaKWp0m39qwOzHVBgAUBIXWj1pB+O2W3fIpNa6Y9KSKCVbfPhyAQ==", "funding": [ "https://opencollective.com/katex", "https://github.com/sponsors/katex" @@ -7311,19 +7312,19 @@ } }, "node_modules/markdownlint-cli/node_modules/glob": { - "version": "10.3.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.5.tgz", - "integrity": "sha512-bYUpUD7XDEHI4Q2O5a7PXGvyw4deKR70kHiDxzQbe925wbZknhOzUt2xBgTkYL6RBcVeXYuD9iNYeqoWbBZQnA==", + "version": "10.3.10", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", + "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", "dev": true, "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^2.0.3", + "jackspeak": "^2.3.5", "minimatch": "^9.0.1", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", "path-scurry": "^1.10.1" }, "bin": { - "glob": "dist/cjs/src/bin.js" + "glob": "dist/esm/bin.mjs" }, "engines": { "node": ">=16 || 14 >=14.17" @@ -7529,9 +7530,9 @@ } }, "node_modules/mermaid": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-10.4.0.tgz", - "integrity": "sha512-4QCQLp79lvz7UZxow5HUX7uWTPJOaQBVExduo91tliXC7v78i6kssZOPHxLL+Xs30KU72cpPn3g3imw/xm/gaw==", + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-10.5.0.tgz", + "integrity": "sha512-9l0o1uUod78D3/FVYPGSsgV+Z0tSnzLBDiC9rVzvelPxuO80HbN1oDr9ofpPETQy9XpypPQa26fr09VzEPfvWA==", "dependencies": { "@braintree/sanitize-url": "^6.0.1", "@types/d3-scale": "^4.0.3", @@ -8072,9 +8073,9 @@ } }, "node_modules/minipass": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.3.tgz", - "integrity": "sha512-LhbbwCfz3vsb12j/WkWQPZfKTsgqIe1Nf/ti1pKjYESGLHIVjWU96G9/ljLH4F9mWNVhlQOm0VySdAWzf05dpg==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", + "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", "dev": true, "engines": { "node": ">=16 || 14 >=14.17" @@ -8093,9 +8094,9 @@ } }, "node_modules/monaco-editor": { - "version": "0.43.0", - "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.43.0.tgz", - "integrity": "sha512-cnoqwQi/9fml2Szamv1XbSJieGJ1Dc8tENVMD26Kcfl7xGQWp7OBKMjlwKVGYFJ3/AXJjSOGvcqK7Ry/j9BM1Q==" + "version": "0.44.0", + "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.44.0.tgz", + "integrity": "sha512-5SmjNStN6bSuSE5WPT2ZV+iYn1/yI9sd4Igtk23ChvqB7kDk9lZbB9F5frsuvpB+2njdIeGGFf2G4gbE6rCC9Q==" }, "node_modules/monaco-editor-webpack-plugin": { "version": "7.1.0", @@ -8744,9 +8745,9 @@ } }, "node_modules/postcss": { - "version": "8.4.30", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.30.tgz", - "integrity": "sha512-7ZEao1g4kd68l97aWG/etQKPKq07us0ieSZ2TnFDk11i0ZfDW2AwKHYU8qv4MZKqN2fdBfg+7q0ES06UA73C1g==", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "funding": [ { "type": "opencollective", @@ -8869,9 +8870,9 @@ } }, "node_modules/postcss-scss": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/postcss-scss/-/postcss-scss-4.0.8.tgz", - "integrity": "sha512-Cr0X8Eu7xMhE96PJck6ses/uVVXDtE5ghUTKNUYgm8ozgP2TkgV3LWs3WgLV1xaSSLq8ZFiXaUrj0LVgG1fGEA==", + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/postcss-scss/-/postcss-scss-4.0.9.tgz", + "integrity": "sha512-AjKOeiwAitL/MXxQW2DliT28EKukvvbEWx3LBmJIRN8KfBGZbRTxNYW0kSqi1COiTZ57nZ9NW06S6ux//N1c9A==", "dev": true, "funding": [ { @@ -9846,9 +9847,9 @@ } }, "node_modules/spdx-license-ids": { - "version": "3.0.15", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.15.tgz", - "integrity": "sha512-lpT8hSQp9jAKp9mhtBU4Xjon8LPGBvLIuBiSVhMEtmLecTh2mO0tlqrAMp47tBXzMr13NJMQ2lf7RpQGLJ3HsQ==" + "version": "3.0.16", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.16.tgz", + "integrity": "sha512-eWN+LnM3GR6gPu35WxNgbGl8rmY1AEmoMDvL/QD6zYmPWgywxWqJWNdLGT+ke8dKNWrcYgYjPpG5gbTfghP8rw==" }, "node_modules/spdx-ranges": { "version": "2.1.1", @@ -10263,9 +10264,9 @@ } }, "node_modules/swagger-ui-dist": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.7.2.tgz", - "integrity": "sha512-mVZc9QVQ6pTCV5crli3+Ng+DoMPwdtMHK8QLk2oX8Mtamp4D/hV+uYdC3lV0JZrDgpNEcjs0RrWTqMwwosuLPQ==" + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.9.0.tgz", + "integrity": "sha512-NUHSYoe5XRTk/Are8jPJ6phzBh3l9l33nEyXosM17QInoV95/jng8+PuSGtbD407QoPf93MH3Bkh773OgesJpA==" }, "node_modules/symbol-tree": { "version": "3.2.4", @@ -10310,9 +10311,9 @@ } }, "node_modules/terser": { - "version": "5.20.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.20.0.tgz", - "integrity": "sha512-e56ETryaQDyebBwJIWYB2TT6f2EZ0fL0sW/JRXNMN26zZdKi2u/E/5my5lG6jNxym6qsrVXfFRmOdV42zlAgLQ==", + "version": "5.21.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.21.0.tgz", + "integrity": "sha512-WtnFKrxu9kaoXuiZFSGrcAvvBqAdmKx0SFNmVNYdJamMu9yyN3I/QF0FbH4QcqJQ+y1CJnzxGIKH0cSj+FGYRw==", "dependencies": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.8.2", @@ -10444,9 +10445,9 @@ } }, "node_modules/tinyspy": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.1.1.tgz", - "integrity": "sha512-XPJL2uSzcOyBMky6OFrusqWlzfFrXtE0hPuMgW8A2HmaqrPo4ZQHRN/V0QXN3FSjKxpsbRrFc5LI7KOwBsT1/w==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.0.tgz", + "integrity": "sha512-d2eda04AN/cPOR89F7Xv5bK/jrQEhmcLFe6HFldoeO9AJtps+fqEnh486vnT/8y4bw38pSyxDcTCAq+Ks2aJTg==", "dev": true, "engines": { "node": ">=14.0.0" @@ -10677,9 +10678,9 @@ "dev": true }, "node_modules/ufo": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.3.0.tgz", - "integrity": "sha512-bRn3CsoojyNStCZe0BG0Mt4Nr/4KF+rhFlnNXybgqt5pXHNFRlqinSoQaTrGyzE4X8aHplSb+TorH+COin9Yxw==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.3.1.tgz", + "integrity": "sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==", "dev": true }, "node_modules/uint8-to-base64": { @@ -10851,9 +10852,9 @@ } }, "node_modules/vite": { - "version": "4.4.9", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.9.tgz", - "integrity": "sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==", + "version": "4.4.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.11.tgz", + "integrity": "sha512-ksNZJlkcU9b0lBwAGZGGaZHCMqHsc8OpgtoYhsQ4/I2v5cnpmmmqe5pM4nv/4Hn6G/2GhTdj0DhZh2e+Er1q5A==", "dev": true, "dependencies": { "esbuild": "^0.18.10", @@ -10906,9 +10907,9 @@ } }, "node_modules/vite-node": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.34.5.tgz", - "integrity": "sha512-RNZ+DwbCvDoI5CbCSQSyRyzDTfFvFauvMs6Yq4ObJROKlIKuat1KgSX/Ako5rlDMfVCyMcpMRMTkJBxd6z8YRA==", + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.34.6.tgz", + "integrity": "sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA==", "dev": true, "dependencies": { "cac": "^6.7.14", @@ -11327,9 +11328,9 @@ } }, "node_modules/vite/node_modules/rollup": { - "version": "3.29.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.2.tgz", - "integrity": "sha512-CJouHoZ27v6siztc21eEQGo0kIcE5D1gVPA571ez0mMYb25LGYGKnVNXpEj5MGlepmDWGXNjDB5q7uNiPHC11A==", + "version": "3.29.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz", + "integrity": "sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -11343,23 +11344,23 @@ } }, "node_modules/vitest": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.34.5.tgz", - "integrity": "sha512-CPI68mmnr2DThSB3frSuE5RLm9wo5wU4fbDrDwWQQB1CWgq9jQVoQwnQSzYAjdoBOPoH2UtXpOgHVge/uScfZg==", + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.34.6.tgz", + "integrity": "sha512-+5CALsOvbNKnS+ZHMXtuUC7nL8/7F1F2DnHGjSsszX8zCjWSSviphCb/NuS9Nzf4Q03KyyDRBAXhF/8lffME4Q==", "dev": true, "dependencies": { "@types/chai": "^4.3.5", "@types/chai-subset": "^1.3.3", "@types/node": "*", - "@vitest/expect": "0.34.5", - "@vitest/runner": "0.34.5", - "@vitest/snapshot": "0.34.5", - "@vitest/spy": "0.34.5", - "@vitest/utils": "0.34.5", + "@vitest/expect": "0.34.6", + "@vitest/runner": "0.34.6", + "@vitest/snapshot": "0.34.6", + "@vitest/spy": "0.34.6", + "@vitest/utils": "0.34.6", "acorn": "^8.9.0", "acorn-walk": "^8.2.0", "cac": "^6.7.14", - "chai": "^4.3.7", + "chai": "^4.3.10", "debug": "^4.3.4", "local-pkg": "^0.4.3", "magic-string": "^0.30.1", @@ -11370,7 +11371,7 @@ "tinybench": "^2.5.0", "tinypool": "^0.7.0", "vite": "^3.1.0 || ^4.0.0 || ^5.0.0-0", - "vite-node": "0.34.5", + "vite-node": "0.34.6", "why-is-node-running": "^2.2.2" }, "bin": { @@ -11420,9 +11421,9 @@ } }, "node_modules/vitest/node_modules/magic-string": { - "version": "0.30.3", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.3.tgz", - "integrity": "sha512-B7xGbll2fG/VjP+SWg4sX3JynwIU0mjoTc6MPpKNuIvftk6u6vqhDnk1R80b8C2GBR6ywqy+1DcKBrevBg+bmw==", + "version": "0.30.4", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.4.tgz", + "integrity": "sha512-Q/TKtsC5BPm0kGqgBIF9oXAs/xEf2vRKiIB4wCRQTJOQIByZ1d+NnUOotvJOvNpi5RNIgVOMC3pOuaP1ZTDlVg==", "dev": true, "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" @@ -11477,9 +11478,9 @@ } }, "node_modules/vue-loader": { - "version": "17.2.2", - "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-17.2.2.tgz", - "integrity": "sha512-aqNvKJvnz2A/6VWeJZodAo8XLoAlVwBv+2Z6dama+LHsAF+P/xijQ+OfWrxIs0wcGSJduvdzvTuATzXbNKkpiw==", + "version": "17.3.0", + "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-17.3.0.tgz", + "integrity": "sha512-VUURABiN0TIUz0yvJJ/V/rZjGUh10JZtD+IDI5bXFslzFi9mV6ebKkPzoqiSi8e0vh8Ip7JHJx+I0AzAG0KsCA==", "dependencies": { "chalk": "^4.1.0", "hash-sum": "^2.0.0", @@ -11667,9 +11668,9 @@ } }, "node_modules/webpack/node_modules/@types/estree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", - "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.2.tgz", + "integrity": "sha512-VeiPZ9MMwXjO32/Xu7+OwflfmeoRwkE/qzndw42gGtgJwZopBnzy2gD//NN1+go1mADzkDcqf/KnFRSjTJ8xJA==" }, "node_modules/webpack/node_modules/ajv": { "version": "6.12.6", diff --git a/package.json b/package.json index fb0ee33998..2672067b35 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,9 @@ "node": ">= 18.0.0" }, "dependencies": { - "@citation-js/core": "0.6.9", - "@citation-js/plugin-bibtex": "0.6.9", - "@citation-js/plugin-csl": "0.6.9", + "@citation-js/core": "0.7.1", + "@citation-js/plugin-bibtex": "0.7.1", + "@citation-js/plugin-csl": "0.7.1", "@citation-js/plugin-software-formats": "0.6.1", "@claviska/jquery-minicolors": "2.3.6", "@github/markdown-toolbar-element": "2.2.1", @@ -17,7 +17,7 @@ "@webcomponents/custom-elements": "1.6.0", "add-asset-webpack-plugin": "2.0.1", "ansi_up": "6.0.2", - "asciinema-player": "3.6.1", + "asciinema-player": "3.6.2", "clippie": "4.0.6", "css-loader": "6.8.1", "dropzone": "6.0.0-beta.2", @@ -26,18 +26,18 @@ "escape-goat": "4.0.0", "fast-glob": "3.3.1", "jquery": "3.7.1", - "katex": "0.16.8", + "katex": "0.16.9", "license-checker-webpack-plugin": "0.2.1", "lightningcss-loader": "2.1.0", - "mermaid": "10.4.0", + "mermaid": "10.5.0", "mini-css-extract-plugin": "2.7.6", "minimatch": "9.0.3", - "monaco-editor": "0.43.0", + "monaco-editor": "0.44.0", "monaco-editor-webpack-plugin": "7.1.0", "pdfobject": "2.2.12", "pretty-ms": "8.0.0", "sortablejs": "1.15.0", - "swagger-ui-dist": "5.7.2", + "swagger-ui-dist": "5.9.0", "throttle-debounce": "5.0.0", "tinycolor2": "1.6.0", "tippy.js": "6.3.7", @@ -46,7 +46,7 @@ "uint8-to-base64": "0.2.0", "vue": "3.3.4", "vue-bar-graph": "2.0.0", - "vue-loader": "17.2.2", + "vue-loader": "17.3.0", "vue3-calendar-heatmap": "2.0.5", "webpack": "5.88.2", "webpack-cli": "5.1.4", @@ -56,8 +56,8 @@ "@eslint-community/eslint-plugin-eslint-comments": "4.1.0", "@playwright/test": "1.38.1", "@stoplight/spectral-cli": "6.11.0", - "@vitejs/plugin-vue": "4.3.4", - "eslint": "8.49.0", + "@vitejs/plugin-vue": "4.4.0", + "eslint": "8.51.0", "eslint-plugin-array-func": "4.0.0", "eslint-plugin-import": "2.28.1", "eslint-plugin-jquery": "1.5.1", @@ -68,8 +68,8 @@ "eslint-plugin-unicorn": "48.0.1", "eslint-plugin-vitest-globals": "1.4.0", "eslint-plugin-vue": "9.17.0", - "eslint-plugin-vue-scoped-css": "2.5.0", - "eslint-plugin-wc": "2.0.3", + "eslint-plugin-vue-scoped-css": "2.5.1", + "eslint-plugin-wc": "2.0.4", "jsdom": "22.1.0", "markdownlint-cli": "0.37.0", "postcss-html": "1.5.0", @@ -80,7 +80,7 @@ "svgo": "3.0.2", "updates": "15.0.2", "vite-string-plugin": "1.1.2", - "vitest": "0.34.5" + "vitest": "0.34.6" }, "browserslist": [ "defaults", diff --git a/poetry.lock b/poetry.lock index 2b15fa5ad6..b6e0432058 100644 --- a/poetry.lock +++ b/poetry.lock @@ -188,99 +188,99 @@ files = [ [[package]] name = "regex" -version = "2023.8.8" +version = "2023.10.3" description = "Alternative regular expression module, to replace re." optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" files = [ - {file = "regex-2023.8.8-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:88900f521c645f784260a8d346e12a1590f79e96403971241e64c3a265c8ecdb"}, - {file = "regex-2023.8.8-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:3611576aff55918af2697410ff0293d6071b7e00f4b09e005d614686ac4cd57c"}, - {file = "regex-2023.8.8-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b8a0ccc8f2698f120e9e5742f4b38dc944c38744d4bdfc427616f3a163dd9de5"}, - {file = "regex-2023.8.8-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c662a4cbdd6280ee56f841f14620787215a171c4e2d1744c9528bed8f5816c96"}, - {file = "regex-2023.8.8-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cf0633e4a1b667bfe0bb10b5e53fe0d5f34a6243ea2530eb342491f1adf4f739"}, - {file = "regex-2023.8.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:551ad543fa19e94943c5b2cebc54c73353ffff08228ee5f3376bd27b3d5b9800"}, - {file = "regex-2023.8.8-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:54de2619f5ea58474f2ac211ceea6b615af2d7e4306220d4f3fe690c91988a61"}, - {file = "regex-2023.8.8-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:5ec4b3f0aebbbe2fc0134ee30a791af522a92ad9f164858805a77442d7d18570"}, - {file = "regex-2023.8.8-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:3ae646c35cb9f820491760ac62c25b6d6b496757fda2d51be429e0e7b67ae0ab"}, - {file = "regex-2023.8.8-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:ca339088839582d01654e6f83a637a4b8194d0960477b9769d2ff2cfa0fa36d2"}, - {file = "regex-2023.8.8-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:d9b6627408021452dcd0d2cdf8da0534e19d93d070bfa8b6b4176f99711e7f90"}, - {file = "regex-2023.8.8-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:bd3366aceedf274f765a3a4bc95d6cd97b130d1dda524d8f25225d14123c01db"}, - {file = "regex-2023.8.8-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:7aed90a72fc3654fba9bc4b7f851571dcc368120432ad68b226bd593f3f6c0b7"}, - {file = "regex-2023.8.8-cp310-cp310-win32.whl", hash = "sha256:80b80b889cb767cc47f31d2b2f3dec2db8126fbcd0cff31b3925b4dc6609dcdb"}, - {file = "regex-2023.8.8-cp310-cp310-win_amd64.whl", hash = "sha256:b82edc98d107cbc7357da7a5a695901b47d6eb0420e587256ba3ad24b80b7d0b"}, - {file = "regex-2023.8.8-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:1e7d84d64c84ad97bf06f3c8cb5e48941f135ace28f450d86af6b6512f1c9a71"}, - {file = "regex-2023.8.8-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:ce0f9fbe7d295f9922c0424a3637b88c6c472b75eafeaff6f910494a1fa719ef"}, - {file = "regex-2023.8.8-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:06c57e14ac723b04458df5956cfb7e2d9caa6e9d353c0b4c7d5d54fcb1325c46"}, - {file = "regex-2023.8.8-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e7a9aaa5a1267125eef22cef3b63484c3241aaec6f48949b366d26c7250e0357"}, - {file = "regex-2023.8.8-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9b7408511fca48a82a119d78a77c2f5eb1b22fe88b0d2450ed0756d194fe7a9a"}, - {file = "regex-2023.8.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:14dc6f2d88192a67d708341f3085df6a4f5a0c7b03dec08d763ca2cd86e9f559"}, - {file = "regex-2023.8.8-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:48c640b99213643d141550326f34f0502fedb1798adb3c9eb79650b1ecb2f177"}, - {file = "regex-2023.8.8-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:0085da0f6c6393428bf0d9c08d8b1874d805bb55e17cb1dfa5ddb7cfb11140bf"}, - {file = "regex-2023.8.8-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:964b16dcc10c79a4a2be9f1273fcc2684a9eedb3906439720598029a797b46e6"}, - {file = "regex-2023.8.8-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:7ce606c14bb195b0e5108544b540e2c5faed6843367e4ab3deb5c6aa5e681208"}, - {file = "regex-2023.8.8-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:40f029d73b10fac448c73d6eb33d57b34607f40116e9f6e9f0d32e9229b147d7"}, - {file = "regex-2023.8.8-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3b8e6ea6be6d64104d8e9afc34c151926f8182f84e7ac290a93925c0db004bfd"}, - {file = "regex-2023.8.8-cp311-cp311-win32.whl", hash = "sha256:942f8b1f3b223638b02df7df79140646c03938d488fbfb771824f3d05fc083a8"}, - {file = "regex-2023.8.8-cp311-cp311-win_amd64.whl", hash = "sha256:51d8ea2a3a1a8fe4f67de21b8b93757005213e8ac3917567872f2865185fa7fb"}, - {file = "regex-2023.8.8-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:e951d1a8e9963ea51efd7f150450803e3b95db5939f994ad3d5edac2b6f6e2b4"}, - {file = "regex-2023.8.8-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:704f63b774218207b8ccc6c47fcef5340741e5d839d11d606f70af93ee78e4d4"}, - {file = "regex-2023.8.8-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:22283c769a7b01c8ac355d5be0715bf6929b6267619505e289f792b01304d898"}, - {file = "regex-2023.8.8-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:91129ff1bb0619bc1f4ad19485718cc623a2dc433dff95baadbf89405c7f6b57"}, - {file = "regex-2023.8.8-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:de35342190deb7b866ad6ba5cbcccb2d22c0487ee0cbb251efef0843d705f0d4"}, - {file = "regex-2023.8.8-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b993b6f524d1e274a5062488a43e3f9f8764ee9745ccd8e8193df743dbe5ee61"}, - {file = "regex-2023.8.8-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:3026cbcf11d79095a32d9a13bbc572a458727bd5b1ca332df4a79faecd45281c"}, - {file = "regex-2023.8.8-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:293352710172239bf579c90a9864d0df57340b6fd21272345222fb6371bf82b3"}, - {file = "regex-2023.8.8-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:d909b5a3fff619dc7e48b6b1bedc2f30ec43033ba7af32f936c10839e81b9217"}, - {file = "regex-2023.8.8-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:3d370ff652323c5307d9c8e4c62efd1956fb08051b0e9210212bc51168b4ff56"}, - {file = "regex-2023.8.8-cp36-cp36m-musllinux_1_1_s390x.whl", hash = "sha256:b076da1ed19dc37788f6a934c60adf97bd02c7eea461b73730513921a85d4235"}, - {file = "regex-2023.8.8-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:e9941a4ada58f6218694f382e43fdd256e97615db9da135e77359da257a7168b"}, - {file = "regex-2023.8.8-cp36-cp36m-win32.whl", hash = "sha256:a8c65c17aed7e15a0c824cdc63a6b104dfc530f6fa8cb6ac51c437af52b481c7"}, - {file = "regex-2023.8.8-cp36-cp36m-win_amd64.whl", hash = "sha256:aadf28046e77a72f30dcc1ab185639e8de7f4104b8cb5c6dfa5d8ed860e57236"}, - {file = "regex-2023.8.8-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:423adfa872b4908843ac3e7a30f957f5d5282944b81ca0a3b8a7ccbbfaa06103"}, - {file = "regex-2023.8.8-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4ae594c66f4a7e1ea67232a0846649a7c94c188d6c071ac0210c3e86a5f92109"}, - {file = "regex-2023.8.8-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e51c80c168074faa793685656c38eb7a06cbad7774c8cbc3ea05552d615393d8"}, - {file = "regex-2023.8.8-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:09b7f4c66aa9d1522b06e31a54f15581c37286237208df1345108fcf4e050c18"}, - {file = "regex-2023.8.8-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2e73e5243af12d9cd6a9d6a45a43570dbe2e5b1cdfc862f5ae2b031e44dd95a8"}, - {file = "regex-2023.8.8-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:941460db8fe3bd613db52f05259c9336f5a47ccae7d7def44cc277184030a116"}, - {file = "regex-2023.8.8-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f0ccf3e01afeb412a1a9993049cb160d0352dba635bbca7762b2dc722aa5742a"}, - {file = "regex-2023.8.8-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:2e9216e0d2cdce7dbc9be48cb3eacb962740a09b011a116fd7af8c832ab116ca"}, - {file = "regex-2023.8.8-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:5cd9cd7170459b9223c5e592ac036e0704bee765706445c353d96f2890e816c8"}, - {file = "regex-2023.8.8-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:4873ef92e03a4309b3ccd8281454801b291b689f6ad45ef8c3658b6fa761d7ac"}, - {file = "regex-2023.8.8-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:239c3c2a339d3b3ddd51c2daef10874410917cd2b998f043c13e2084cb191684"}, - {file = "regex-2023.8.8-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:1005c60ed7037be0d9dea1f9c53cc42f836188227366370867222bda4c3c6bd7"}, - {file = "regex-2023.8.8-cp37-cp37m-win32.whl", hash = "sha256:e6bd1e9b95bc5614a7a9c9c44fde9539cba1c823b43a9f7bc11266446dd568e3"}, - {file = "regex-2023.8.8-cp37-cp37m-win_amd64.whl", hash = "sha256:9a96edd79661e93327cfeac4edec72a4046e14550a1d22aa0dd2e3ca52aec921"}, - {file = "regex-2023.8.8-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:f2181c20ef18747d5f4a7ea513e09ea03bdd50884a11ce46066bb90fe4213675"}, - {file = "regex-2023.8.8-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:a2ad5add903eb7cdde2b7c64aaca405f3957ab34f16594d2b78d53b8b1a6a7d6"}, - {file = "regex-2023.8.8-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9233ac249b354c54146e392e8a451e465dd2d967fc773690811d3a8c240ac601"}, - {file = "regex-2023.8.8-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:920974009fb37b20d32afcdf0227a2e707eb83fe418713f7a8b7de038b870d0b"}, - {file = "regex-2023.8.8-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cd2b6c5dfe0929b6c23dde9624483380b170b6e34ed79054ad131b20203a1a63"}, - {file = "regex-2023.8.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:96979d753b1dc3b2169003e1854dc67bfc86edf93c01e84757927f810b8c3c93"}, - {file = "regex-2023.8.8-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2ae54a338191e1356253e7883d9d19f8679b6143703086245fb14d1f20196be9"}, - {file = "regex-2023.8.8-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:2162ae2eb8b079622176a81b65d486ba50b888271302190870b8cc488587d280"}, - {file = "regex-2023.8.8-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:c884d1a59e69e03b93cf0dfee8794c63d7de0ee8f7ffb76e5f75be8131b6400a"}, - {file = "regex-2023.8.8-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:cf9273e96f3ee2ac89ffcb17627a78f78e7516b08f94dc435844ae72576a276e"}, - {file = "regex-2023.8.8-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:83215147121e15d5f3a45d99abeed9cf1fe16869d5c233b08c56cdf75f43a504"}, - {file = "regex-2023.8.8-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:3f7454aa427b8ab9101f3787eb178057c5250478e39b99540cfc2b889c7d0586"}, - {file = "regex-2023.8.8-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:f0640913d2c1044d97e30d7c41728195fc37e54d190c5385eacb52115127b882"}, - {file = "regex-2023.8.8-cp38-cp38-win32.whl", hash = "sha256:0c59122ceccb905a941fb23b087b8eafc5290bf983ebcb14d2301febcbe199c7"}, - {file = "regex-2023.8.8-cp38-cp38-win_amd64.whl", hash = "sha256:c12f6f67495ea05c3d542d119d270007090bad5b843f642d418eb601ec0fa7be"}, - {file = "regex-2023.8.8-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:82cd0a69cd28f6cc3789cc6adeb1027f79526b1ab50b1f6062bbc3a0ccb2dbc3"}, - {file = "regex-2023.8.8-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:bb34d1605f96a245fc39790a117ac1bac8de84ab7691637b26ab2c5efb8f228c"}, - {file = "regex-2023.8.8-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:987b9ac04d0b38ef4f89fbc035e84a7efad9cdd5f1e29024f9289182c8d99e09"}, - {file = "regex-2023.8.8-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9dd6082f4e2aec9b6a0927202c85bc1b09dcab113f97265127c1dc20e2e32495"}, - {file = "regex-2023.8.8-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7eb95fe8222932c10d4436e7a6f7c99991e3fdd9f36c949eff16a69246dee2dc"}, - {file = "regex-2023.8.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7098c524ba9f20717a56a8d551d2ed491ea89cbf37e540759ed3b776a4f8d6eb"}, - {file = "regex-2023.8.8-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4b694430b3f00eb02c594ff5a16db30e054c1b9589a043fe9174584c6efa8033"}, - {file = "regex-2023.8.8-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:b2aeab3895d778155054abea5238d0eb9a72e9242bd4b43f42fd911ef9a13470"}, - {file = "regex-2023.8.8-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:988631b9d78b546e284478c2ec15c8a85960e262e247b35ca5eaf7ee22f6050a"}, - {file = "regex-2023.8.8-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:67ecd894e56a0c6108ec5ab1d8fa8418ec0cff45844a855966b875d1039a2e34"}, - {file = "regex-2023.8.8-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:14898830f0a0eb67cae2bbbc787c1a7d6e34ecc06fbd39d3af5fe29a4468e2c9"}, - {file = "regex-2023.8.8-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:f2200e00b62568cfd920127782c61bc1c546062a879cdc741cfcc6976668dfcf"}, - {file = "regex-2023.8.8-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9691a549c19c22d26a4f3b948071e93517bdf86e41b81d8c6ac8a964bb71e5a6"}, - {file = "regex-2023.8.8-cp39-cp39-win32.whl", hash = "sha256:6ab2ed84bf0137927846b37e882745a827458689eb969028af8032b1b3dac78e"}, - {file = "regex-2023.8.8-cp39-cp39-win_amd64.whl", hash = "sha256:5543c055d8ec7801901e1193a51570643d6a6ab8751b1f7dd9af71af467538bb"}, - {file = "regex-2023.8.8.tar.gz", hash = "sha256:fcbdc5f2b0f1cd0f6a56cdb46fe41d2cce1e644e3b68832f3eeebc5fb0f7712e"}, + {file = "regex-2023.10.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:4c34d4f73ea738223a094d8e0ffd6d2c1a1b4c175da34d6b0de3d8d69bee6bcc"}, + {file = "regex-2023.10.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a8f4e49fc3ce020f65411432183e6775f24e02dff617281094ba6ab079ef0915"}, + {file = "regex-2023.10.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4cd1bccf99d3ef1ab6ba835308ad85be040e6a11b0977ef7ea8c8005f01a3c29"}, + {file = "regex-2023.10.3-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:81dce2ddc9f6e8f543d94b05d56e70d03a0774d32f6cca53e978dc01e4fc75b8"}, + {file = "regex-2023.10.3-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9c6b4d23c04831e3ab61717a707a5d763b300213db49ca680edf8bf13ab5d91b"}, + {file = "regex-2023.10.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c15ad0aee158a15e17e0495e1e18741573d04eb6da06d8b84af726cfc1ed02ee"}, + {file = "regex-2023.10.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6239d4e2e0b52c8bd38c51b760cd870069f0bdf99700a62cd509d7a031749a55"}, + {file = "regex-2023.10.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:4a8bf76e3182797c6b1afa5b822d1d5802ff30284abe4599e1247be4fd6b03be"}, + {file = "regex-2023.10.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:d9c727bbcf0065cbb20f39d2b4f932f8fa1631c3e01fcedc979bd4f51fe051c5"}, + {file = "regex-2023.10.3-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:3ccf2716add72f80714b9a63899b67fa711b654be3fcdd34fa391d2d274ce767"}, + {file = "regex-2023.10.3-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:107ac60d1bfdc3edb53be75e2a52aff7481b92817cfdddd9b4519ccf0e54a6ff"}, + {file = "regex-2023.10.3-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:00ba3c9818e33f1fa974693fb55d24cdc8ebafcb2e4207680669d8f8d7cca79a"}, + {file = "regex-2023.10.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:f0a47efb1dbef13af9c9a54a94a0b814902e547b7f21acb29434504d18f36e3a"}, + {file = "regex-2023.10.3-cp310-cp310-win32.whl", hash = "sha256:36362386b813fa6c9146da6149a001b7bd063dabc4d49522a1f7aa65b725c7ec"}, + {file = "regex-2023.10.3-cp310-cp310-win_amd64.whl", hash = "sha256:c65a3b5330b54103e7d21cac3f6bf3900d46f6d50138d73343d9e5b2900b2353"}, + {file = "regex-2023.10.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:90a79bce019c442604662d17bf69df99090e24cdc6ad95b18b6725c2988a490e"}, + {file = "regex-2023.10.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c7964c2183c3e6cce3f497e3a9f49d182e969f2dc3aeeadfa18945ff7bdd7051"}, + {file = "regex-2023.10.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4ef80829117a8061f974b2fda8ec799717242353bff55f8a29411794d635d964"}, + {file = "regex-2023.10.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5addc9d0209a9afca5fc070f93b726bf7003bd63a427f65ef797a931782e7edc"}, + {file = "regex-2023.10.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c148bec483cc4b421562b4bcedb8e28a3b84fcc8f0aa4418e10898f3c2c0eb9b"}, + {file = "regex-2023.10.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d1f21af4c1539051049796a0f50aa342f9a27cde57318f2fc41ed50b0dbc4ac"}, + {file = "regex-2023.10.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0b9ac09853b2a3e0d0082104036579809679e7715671cfbf89d83c1cb2a30f58"}, + {file = "regex-2023.10.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:ebedc192abbc7fd13c5ee800e83a6df252bec691eb2c4bedc9f8b2e2903f5e2a"}, + {file = "regex-2023.10.3-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:d8a993c0a0ffd5f2d3bda23d0cd75e7086736f8f8268de8a82fbc4bd0ac6791e"}, + {file = "regex-2023.10.3-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:be6b7b8d42d3090b6c80793524fa66c57ad7ee3fe9722b258aec6d0672543fd0"}, + {file = "regex-2023.10.3-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:4023e2efc35a30e66e938de5aef42b520c20e7eda7bb5fb12c35e5d09a4c43f6"}, + {file = "regex-2023.10.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:0d47840dc05e0ba04fe2e26f15126de7c755496d5a8aae4a08bda4dd8d646c54"}, + {file = "regex-2023.10.3-cp311-cp311-win32.whl", hash = "sha256:9145f092b5d1977ec8c0ab46e7b3381b2fd069957b9862a43bd383e5c01d18c2"}, + {file = "regex-2023.10.3-cp311-cp311-win_amd64.whl", hash = "sha256:b6104f9a46bd8743e4f738afef69b153c4b8b592d35ae46db07fc28ae3d5fb7c"}, + {file = "regex-2023.10.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:bff507ae210371d4b1fe316d03433ac099f184d570a1a611e541923f78f05037"}, + {file = "regex-2023.10.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:be5e22bbb67924dea15039c3282fa4cc6cdfbe0cbbd1c0515f9223186fc2ec5f"}, + {file = "regex-2023.10.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4a992f702c9be9c72fa46f01ca6e18d131906a7180950958f766c2aa294d4b41"}, + {file = "regex-2023.10.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7434a61b158be563c1362d9071358f8ab91b8d928728cd2882af060481244c9e"}, + {file = "regex-2023.10.3-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c2169b2dcabf4e608416f7f9468737583ce5f0a6e8677c4efbf795ce81109d7c"}, + {file = "regex-2023.10.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a9e908ef5889cda4de038892b9accc36d33d72fb3e12c747e2799a0e806ec841"}, + {file = "regex-2023.10.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:12bd4bc2c632742c7ce20db48e0d99afdc05e03f0b4c1af90542e05b809a03d9"}, + {file = "regex-2023.10.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:bc72c231f5449d86d6c7d9cc7cd819b6eb30134bb770b8cfdc0765e48ef9c420"}, + {file = "regex-2023.10.3-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:bce8814b076f0ce5766dc87d5a056b0e9437b8e0cd351b9a6c4e1134a7dfbda9"}, + {file = "regex-2023.10.3-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:ba7cd6dc4d585ea544c1412019921570ebd8a597fabf475acc4528210d7c4a6f"}, + {file = "regex-2023.10.3-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:b0c7d2f698e83f15228ba41c135501cfe7d5740181d5903e250e47f617eb4292"}, + {file = "regex-2023.10.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:5a8f91c64f390ecee09ff793319f30a0f32492e99f5dc1c72bc361f23ccd0a9a"}, + {file = "regex-2023.10.3-cp312-cp312-win32.whl", hash = "sha256:ad08a69728ff3c79866d729b095872afe1e0557251da4abb2c5faff15a91d19a"}, + {file = "regex-2023.10.3-cp312-cp312-win_amd64.whl", hash = "sha256:39cdf8d141d6d44e8d5a12a8569d5a227f645c87df4f92179bd06e2e2705e76b"}, + {file = "regex-2023.10.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:4a3ee019a9befe84fa3e917a2dd378807e423d013377a884c1970a3c2792d293"}, + {file = "regex-2023.10.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:76066d7ff61ba6bf3cb5efe2428fc82aac91802844c022d849a1f0f53820502d"}, + {file = "regex-2023.10.3-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bfe50b61bab1b1ec260fa7cd91106fa9fece57e6beba05630afe27c71259c59b"}, + {file = "regex-2023.10.3-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9fd88f373cb71e6b59b7fa597e47e518282455c2734fd4306a05ca219a1991b0"}, + {file = "regex-2023.10.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b3ab05a182c7937fb374f7e946f04fb23a0c0699c0450e9fb02ef567412d2fa3"}, + {file = "regex-2023.10.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dac37cf08fcf2094159922edc7a2784cfcc5c70f8354469f79ed085f0328ebdf"}, + {file = "regex-2023.10.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:e54ddd0bb8fb626aa1f9ba7b36629564544954fff9669b15da3610c22b9a0991"}, + {file = "regex-2023.10.3-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:3367007ad1951fde612bf65b0dffc8fd681a4ab98ac86957d16491400d661302"}, + {file = "regex-2023.10.3-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:16f8740eb6dbacc7113e3097b0a36065a02e37b47c936b551805d40340fb9971"}, + {file = "regex-2023.10.3-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:f4f2ca6df64cbdd27f27b34f35adb640b5d2d77264228554e68deda54456eb11"}, + {file = "regex-2023.10.3-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:39807cbcbe406efca2a233884e169d056c35aa7e9f343d4e78665246a332f597"}, + {file = "regex-2023.10.3-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:7eece6fbd3eae4a92d7c748ae825cbc1ee41a89bb1c3db05b5578ed3cfcfd7cb"}, + {file = "regex-2023.10.3-cp37-cp37m-win32.whl", hash = "sha256:ce615c92d90df8373d9e13acddd154152645c0dc060871abf6bd43809673d20a"}, + {file = "regex-2023.10.3-cp37-cp37m-win_amd64.whl", hash = "sha256:0f649fa32fe734c4abdfd4edbb8381c74abf5f34bc0b3271ce687b23729299ed"}, + {file = "regex-2023.10.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:9b98b7681a9437262947f41c7fac567c7e1f6eddd94b0483596d320092004533"}, + {file = "regex-2023.10.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:91dc1d531f80c862441d7b66c4505cd6ea9d312f01fb2f4654f40c6fdf5cc37a"}, + {file = "regex-2023.10.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:82fcc1f1cc3ff1ab8a57ba619b149b907072e750815c5ba63e7aa2e1163384a4"}, + {file = "regex-2023.10.3-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7979b834ec7a33aafae34a90aad9f914c41fd6eaa8474e66953f3f6f7cbd4368"}, + {file = "regex-2023.10.3-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ef71561f82a89af6cfcbee47f0fabfdb6e63788a9258e913955d89fdd96902ab"}, + {file = "regex-2023.10.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd829712de97753367153ed84f2de752b86cd1f7a88b55a3a775eb52eafe8a94"}, + {file = "regex-2023.10.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:00e871d83a45eee2f8688d7e6849609c2ca2a04a6d48fba3dff4deef35d14f07"}, + {file = "regex-2023.10.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:706e7b739fdd17cb89e1fbf712d9dc21311fc2333f6d435eac2d4ee81985098c"}, + {file = "regex-2023.10.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:cc3f1c053b73f20c7ad88b0d1d23be7e7b3901229ce89f5000a8399746a6e039"}, + {file = "regex-2023.10.3-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:6f85739e80d13644b981a88f529d79c5bdf646b460ba190bffcaf6d57b2a9863"}, + {file = "regex-2023.10.3-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:741ba2f511cc9626b7561a440f87d658aabb3d6b744a86a3c025f866b4d19e7f"}, + {file = "regex-2023.10.3-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:e77c90ab5997e85901da85131fd36acd0ed2221368199b65f0d11bca44549711"}, + {file = "regex-2023.10.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:979c24cbefaf2420c4e377ecd1f165ea08cc3d1fbb44bdc51bccbbf7c66a2cb4"}, + {file = "regex-2023.10.3-cp38-cp38-win32.whl", hash = "sha256:58837f9d221744d4c92d2cf7201c6acd19623b50c643b56992cbd2b745485d3d"}, + {file = "regex-2023.10.3-cp38-cp38-win_amd64.whl", hash = "sha256:c55853684fe08d4897c37dfc5faeff70607a5f1806c8be148f1695be4a63414b"}, + {file = "regex-2023.10.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:2c54e23836650bdf2c18222c87f6f840d4943944146ca479858404fedeb9f9af"}, + {file = "regex-2023.10.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:69c0771ca5653c7d4b65203cbfc5e66db9375f1078689459fe196fe08b7b4930"}, + {file = "regex-2023.10.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6ac965a998e1388e6ff2e9781f499ad1eaa41e962a40d11c7823c9952c77123e"}, + {file = "regex-2023.10.3-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1c0e8fae5b27caa34177bdfa5a960c46ff2f78ee2d45c6db15ae3f64ecadde14"}, + {file = "regex-2023.10.3-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6c56c3d47da04f921b73ff9415fbaa939f684d47293f071aa9cbb13c94afc17d"}, + {file = "regex-2023.10.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7ef1e014eed78ab650bef9a6a9cbe50b052c0aebe553fb2881e0453717573f52"}, + {file = "regex-2023.10.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d29338556a59423d9ff7b6eb0cb89ead2b0875e08fe522f3e068b955c3e7b59b"}, + {file = "regex-2023.10.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:9c6d0ced3c06d0f183b73d3c5920727268d2201aa0fe6d55c60d68c792ff3588"}, + {file = "regex-2023.10.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:994645a46c6a740ee8ce8df7911d4aee458d9b1bc5639bc968226763d07f00fa"}, + {file = "regex-2023.10.3-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:66e2fe786ef28da2b28e222c89502b2af984858091675044d93cb50e6f46d7af"}, + {file = "regex-2023.10.3-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:11175910f62b2b8c055f2b089e0fedd694fe2be3941b3e2633653bc51064c528"}, + {file = "regex-2023.10.3-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:06e9abc0e4c9ab4779c74ad99c3fc10d3967d03114449acc2c2762ad4472b8ca"}, + {file = "regex-2023.10.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:fb02e4257376ae25c6dd95a5aec377f9b18c09be6ebdefa7ad209b9137b73d48"}, + {file = "regex-2023.10.3-cp39-cp39-win32.whl", hash = "sha256:3b2c3502603fab52d7619b882c25a6850b766ebd1b18de3df23b2f939360e1bd"}, + {file = "regex-2023.10.3-cp39-cp39-win_amd64.whl", hash = "sha256:adbccd17dcaff65704c856bd29951c58a1bd4b2b0f8ad6b826dbd543fe740988"}, + {file = "regex-2023.10.3.tar.gz", hash = "sha256:3fef4f844d2290ee0ba57addcec17eec9e3df73f10a2748485dfd6a3a188cc0f"}, ] [[package]] diff --git a/templates/repo/cite/cite_buttons.tmpl b/templates/repo/cite/cite_buttons.tmpl index c0d3bf75f2..9953c92c8a 100644 --- a/templates/repo/cite/cite_buttons.tmpl +++ b/templates/repo/cite/cite_buttons.tmpl @@ -1,11 +1,11 @@ - - - diff --git a/web_src/js/features/emoji.js b/web_src/js/features/emoji.js index d00ff65456..032a3efe8a 100644 --- a/web_src/js/features/emoji.js +++ b/web_src/js/features/emoji.js @@ -23,7 +23,7 @@ for (const key of emojiKeys) { // retrieve HTML for given emoji name export function emojiHTML(name) { let inner; - if (Object.prototype.hasOwnProperty.call(customEmojis, name)) { + if (Object.hasOwn(customEmojis, name)) { inner = `:${name}:`; } else { inner = emojiString(name); From 4bde16e1bac21c2854ba3e28a7b41f621b99c3e0 Mon Sep 17 00:00:00 2001 From: GiteaBot Date: Sun, 8 Oct 2023 00:25:56 +0000 Subject: [PATCH 04/45] [skip ci] Updated translations via Crowdin --- options/locale/locale_zh-CN.ini | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index a0f3c81552..856a8e6807 100644 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -921,8 +921,10 @@ visibility.public_tooltip=对所有人可见 visibility.limited=受限 visibility.limited_tooltip=仅对已认证的用户可见 visibility.private=私有 +visibility.private_tooltip=仅对您已加入的组织的成员可见。 [repo] +new_repo_helper=代码仓库包含了所有的项目文件,包括版本历史记录。已经在其他地方托管了一个?迁移仓库。 owner=拥有者 owner_helper=由于最大仓库数量限制,一些组织可能不会显示在下拉列表中。 repo_name=仓库名称 @@ -945,6 +947,7 @@ fork_to_different_account=派生到其他账号 fork_visibility_helper=无法更改派生仓库的可见性。 fork_branch=要克隆到 Fork 的分支 all_branches=所有分支 +fork_no_valid_owners=这个代码仓库无法被派生,因为没有有效的所有者。 use_template=使用此模板 clone_in_vsc=在 VS Code 中克隆 download_zip=下载 ZIP @@ -982,6 +985,7 @@ mirror_interval_invalid=镜像间隔无效。 mirror_sync_on_commit=推送提交时同步 mirror_address=从 URL 克隆 mirror_address_desc=在授权框中输入必要的凭据。 +mirror_address_url_invalid=URL无效。请检查您所输入的URL是否正确。 mirror_lfs=大文件存储 (LFS) mirror_lfs_desc=镜像 LFS 数据。 mirror_lfs_endpoint=LFS 网址 From 7065944ac753b7068aec66c417f1469a1cdc1400 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 8 Oct 2023 02:42:32 +0200 Subject: [PATCH 05/45] Fix actionlint (#27513) `make lint-actions` is currently failing because of undeclared runner name. --- .github/actionlint.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml index 24c80bc60a..023fb05a29 100644 --- a/.github/actionlint.yaml +++ b/.github/actionlint.yaml @@ -2,3 +2,4 @@ self-hosted-runner: labels: - actuated-4cpu-8gb - actuated-4cpu-16gb + - nscloud From e96e440b8bde5516ffc7bba42691e26084a96588 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Sat, 7 Oct 2023 22:48:32 -0400 Subject: [PATCH 06/45] add a shortcut to user's profile page to admin user details (#27299) --- templates/shared/user/profile_big_avatar.tmpl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/shared/user/profile_big_avatar.tmpl b/templates/shared/user/profile_big_avatar.tmpl index 47db7e23a6..a637a9a5f9 100644 --- a/templates/shared/user/profile_big_avatar.tmpl +++ b/templates/shared/user/profile_big_avatar.tmpl @@ -13,7 +13,11 @@
{{if .ContextUser.FullName}}{{.ContextUser.FullName}}{{end}} - {{.ContextUser.Name}} + {{.ContextUser.Name}} {{if .IsAdmin}} + + {{svg "octicon-gear" 18}} + + {{end}}
{{svg "octicon-person" 18 "gt-mr-2"}}{{.NumFollowers}} {{ctx.Locale.Tr "user.followers"}} · {{.NumFollowing}} {{ctx.Locale.Tr "user.following"}} {{if .EnableFeed}} From 08efeb5cdc22d21b5ef12cc540727594a22062d1 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 8 Oct 2023 05:20:12 +0200 Subject: [PATCH 07/45] Fix mermaid flowchart margin issue (#27503) Fixes: https://github.com/go-gitea/gitea/issues/27435 Related: https://github.com/mermaid-js/mermaid/issues/4907 image --- web_src/js/markup/mermaid.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web_src/js/markup/mermaid.js b/web_src/js/markup/mermaid.js index 865a414c93..84d88a94c3 100644 --- a/web_src/js/markup/mermaid.js +++ b/web_src/js/markup/mermaid.js @@ -4,9 +4,11 @@ import {displayError} from './common.js'; const {mermaidMaxSourceCharacters} = window.config; +// margin removal is for https://github.com/mermaid-js/mermaid/issues/4907 const iframeCss = `:root {color-scheme: normal} body {margin: 0; padding: 0; overflow: hidden} -#mermaid {display: block; margin: 0 auto}`; +#mermaid {display: block; margin: 0 auto} +blockquote, dd, dl, figure, h1, h2, h3, h4, h5, h6, hr, p, pre {margin: 0}`; export async function renderMermaid() { const els = document.querySelectorAll('.markup code.language-mermaid'); From a825cc0f3423f0a5c8157c436a0c7b489ef536c1 Mon Sep 17 00:00:00 2001 From: M Hickford Date: Sun, 8 Oct 2023 04:51:08 +0100 Subject: [PATCH 08/45] Pre-register OAuth application for tea (#27509) It remains to implement OAuth login in tea https://gitea.com/gitea/tea/issues/598 Fixes #27510 --- custom/conf/app.example.ini | 3 ++- docs/content/administration/config-cheat-sheet.en-us.md | 2 +- docs/content/administration/config-cheat-sheet.zh-cn.md | 2 +- docs/content/development/oauth2-provider.en-us.md | 1 + models/auth/oauth2.go | 5 +++++ modules/setting/oauth2.go | 2 +- 6 files changed, 11 insertions(+), 4 deletions(-) diff --git a/custom/conf/app.example.ini b/custom/conf/app.example.ini index a4ff78fb35..dca530151b 100644 --- a/custom/conf/app.example.ini +++ b/custom/conf/app.example.ini @@ -548,7 +548,8 @@ ENABLE = true ;; Pre-register OAuth2 applications for some universally useful services ;; * https://github.com/hickford/git-credential-oauth ;; * https://github.com/git-ecosystem/git-credential-manager -;DEFAULT_APPLICATIONS = git-credential-oauth, git-credential-manager +;; * https://gitea.com/gitea/tea +;DEFAULT_APPLICATIONS = git-credential-oauth, git-credential-manager, tea ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/docs/content/administration/config-cheat-sheet.en-us.md b/docs/content/administration/config-cheat-sheet.en-us.md index 8bb2b19c28..3c864582ce 100644 --- a/docs/content/administration/config-cheat-sheet.en-us.md +++ b/docs/content/administration/config-cheat-sheet.en-us.md @@ -1107,7 +1107,7 @@ This section only does "set" config, a removed config key from this section won' - `JWT_SECRET_URI`: **_empty_**: Instead of defining JWT_SECRET in the configuration, this configuration option can be used to give Gitea a path to a file that contains the secret (example value: `file:/etc/gitea/oauth2_jwt_secret`) - `JWT_SIGNING_PRIVATE_KEY_FILE`: **jwt/private.pem**: Private key file path used to sign OAuth2 tokens. The path is relative to `APP_DATA_PATH`. This setting is only needed if `JWT_SIGNING_ALGORITHM` is set to `RS256`, `RS384`, `RS512`, `ES256`, `ES384` or `ES512`. The file must contain a RSA or ECDSA private key in the PKCS8 format. If no key exists a 4096 bit key will be created for you. - `MAX_TOKEN_LENGTH`: **32767**: Maximum length of token/cookie to accept from OAuth2 provider -- `DEFAULT_APPLICATIONS`: **git-credential-oauth, git-credential-manager**: Pre-register OAuth applications for some services on startup. See the [OAuth2 documentation](/development/oauth2-provider.md) for the list of available options. +- `DEFAULT_APPLICATIONS`: **git-credential-oauth, git-credential-manager, tea**: Pre-register OAuth applications for some services on startup. See the [OAuth2 documentation](/development/oauth2-provider.md) for the list of available options. ## i18n (`i18n`) diff --git a/docs/content/administration/config-cheat-sheet.zh-cn.md b/docs/content/administration/config-cheat-sheet.zh-cn.md index fbd65a1919..48df750343 100644 --- a/docs/content/administration/config-cheat-sheet.zh-cn.md +++ b/docs/content/administration/config-cheat-sheet.zh-cn.md @@ -1056,7 +1056,7 @@ Gitea 创建以下非唯一队列: - `JWT_SECRET_URI`:**_empty_**:可以使用此配置选项,而不是在配置中定义`JWT_SECRET`,以向Gitea提供包含密钥的文件的路径(示例值:`file:/etc/gitea/oauth2_jwt_secret`)。 - `JWT_SIGNING_PRIVATE_KEY_FILE`:**jwt/private.pem**:用于签署OAuth2令牌的私钥文件路径。路径相对于`APP_DATA_PATH`。仅当`JWT_SIGNING_ALGORITHM`设置为`RS256`,`RS384`,`RS512`,`ES256`,`ES384`或`ES512`时才需要此设置。文件必须包含PKCS8格式的RSA或ECDSA私钥。如果不存在密钥,则将为您创建一个4096位密钥。 - `MAX_TOKEN_LENGTH`:**32767**:从OAuth2提供者接受的令牌/cookie的最大长度。 -- `DEFAULT_APPLICATIONS`:**git-credential-oauth,git-credential-manager**:在启动时预注册用于某些服务的OAuth应用程序。有关可用选项列表,请参阅[OAuth2文档](/development/oauth2-provider.md)。 +- `DEFAULT_APPLICATIONS`:**git-credential-oauth,git-credential-manager, tea**:在启动时预注册用于某些服务的OAuth应用程序。有关可用选项列表,请参阅[OAuth2文档](/development/oauth2-provider.md)。 ## i18n (`i18n`) diff --git a/docs/content/development/oauth2-provider.en-us.md b/docs/content/development/oauth2-provider.en-us.md index 053c1d8d7e..54674f9246 100644 --- a/docs/content/development/oauth2-provider.en-us.md +++ b/docs/content/development/oauth2-provider.en-us.md @@ -86,6 +86,7 @@ Gitea creates OAuth applications for the following services by default on startu |-----------|-----------|---------| |[git-credential-oauth](https://github.com/hickford/git-credential-oauth)|Git credential helper|`a4792ccc-144e-407e-86c9-5e7d8d9c3269`| |[Git Credential Manager](https://github.com/git-ecosystem/git-credential-manager)|Git credential helper|`e90ee53c-94e2-48ac-9358-a874fb9e0662`| +|[tea](https://gitea.com/gitea/tea)|tea|`d57cb8c4-630c-4168-8324-ec79935e18d4`| To prevent unexpected behavior, they are being displayed as locked in the UI and their creation can instead be controlled by the `DEFAULT_APPLICATIONS` parameter in `app.ini`. diff --git a/models/auth/oauth2.go b/models/auth/oauth2.go index 9c419eff69..7ac1d3a5fc 100644 --- a/models/auth/oauth2.go +++ b/models/auth/oauth2.go @@ -66,6 +66,11 @@ func BuiltinApplications() map[string]*BuiltinOAuth2Application { DisplayName: "Git Credential Manager", RedirectURIs: []string{"http://127.0.0.1", "https://127.0.0.1"}, } + m["d57cb8c4-630c-4168-8324-ec79935e18d4"] = &BuiltinOAuth2Application{ + ConfigName: "tea", + DisplayName: "tea", + RedirectURIs: []string{"http://127.0.0.1", "https://127.0.0.1"}, + } return m } diff --git a/modules/setting/oauth2.go b/modules/setting/oauth2.go index ab82393106..aea76b989c 100644 --- a/modules/setting/oauth2.go +++ b/modules/setting/oauth2.go @@ -110,7 +110,7 @@ var OAuth2 = struct { JWTSigningAlgorithm: "RS256", JWTSigningPrivateKeyFile: "jwt/private.pem", MaxTokenLength: math.MaxInt16, - DefaultApplications: []string{"git-credential-oauth", "git-credential-manager"}, + DefaultApplications: []string{"git-credential-oauth", "git-credential-manager", "tea"}, } func loadOAuth2From(rootCfg ConfigProvider) { From 551dc8bb4ddcf784362d735cc78305e2e413d43f Mon Sep 17 00:00:00 2001 From: mohammed ahmed <64513301+mohammedahmed18@users.noreply.github.com> Date: Sun, 8 Oct 2023 09:35:20 +0300 Subject: [PATCH 09/45] [FIX] missing ctx in new_form (#27514) added the ctx for the project link in new_form.tmpl --- ![Screenshot_20231008_075757](https://github.com/go-gitea/gitea/assets/64513301/8adaa287-9e55-4428-bc48-f8e6a2080624) --- templates/repo/issue/new_form.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl index 62b6b5ce6f..04ae8456bb 100644 --- a/templates/repo/issue/new_form.tmpl +++ b/templates/repo/issue/new_form.tmpl @@ -134,7 +134,7 @@ {{ctx.Locale.Tr "repo.issues.new.no_projects"}}
{{if .Project}} - + {{svg .Project.IconName 18 "gt-mr-3"}}{{.Project.Title}} {{end}} From abe8fe352711601fbcd24bf4505f7e0b81a93c5d Mon Sep 17 00:00:00 2001 From: Gary Wang Date: Sun, 8 Oct 2023 18:07:55 +0800 Subject: [PATCH 10/45] Add hover background to wiki list page (#27507) This patch adds a hover background for the wiki row in wiki list page, which make its behavior more close to repo's file list page. This patch also make the wiki-git-entry visible on the row is hovered instead of the cel, so users won't be confused since the 'grid' is not visible from the web page. After the patch: (when the wiki named 'Home' is hovered) ![image](https://github.com/go-gitea/gitea/assets/10095765/f6c67c41-ad54-4ce4-a3b1-8c7551396ce0) --- web_src/css/repo/wiki.css | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web_src/css/repo/wiki.css b/web_src/css/repo/wiki.css index c0a2c0ddb8..84af37fa22 100644 --- a/web_src/css/repo/wiki.css +++ b/web_src/css/repo/wiki.css @@ -1,9 +1,13 @@ +.repository.wiki .wiki-pages-list tr:hover { + background-color: var(--color-hover); +} + .repository.wiki .wiki-pages-list .wiki-git-entry { margin-left: 10px; display: none; } -.repository.wiki .wiki-pages-list td:hover .wiki-git-entry { +.repository.wiki .wiki-pages-list tr:hover .wiki-git-entry { display: inline-block; } From ab074c9b982e242178896edea7fc6d7926fdb375 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 8 Oct 2023 15:11:26 +0200 Subject: [PATCH 11/45] Tweak labeler config (#27502) Alternative to https://github.com/go-gitea/gitea/pull/27439. Removes a few spammy labels, and disables `sync-labels` which make it never remove labels (which is default behaviour). --- .github/labeler.yml | 13 ------------- .github/workflows/pull-labeler.yml | 1 - 2 files changed, 14 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 06a5cd99d1..d9a5782f7d 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -6,10 +6,6 @@ kind/ui: - "web_src/**/*" - all: ["templates/**", "!templates/swagger/v1_json.tmpl"] -kind/api: - - "templates/swagger/v1_json.tmpl" - - "routers/api/**" - kind/build: - "Makefile" - "Dockerfile" @@ -17,15 +13,6 @@ kind/build: - "docker/**" - "webpack.config.js" -theme/package-registry: - - "modules/packages/**" - - "services/packages/**" - - "routers/api/packages/**" - - "routers/web/shared/packages/**" - -kind/cli: - - "cmd/**" - kind/lint: - ".eslintrc.yaml" - ".golangci.yml" diff --git a/.github/workflows/pull-labeler.yml b/.github/workflows/pull-labeler.yml index c62142b9d2..edd2f6d16e 100644 --- a/.github/workflows/pull-labeler.yml +++ b/.github/workflows/pull-labeler.yml @@ -18,4 +18,3 @@ jobs: - uses: actions/labeler@v4 with: dot: true - sync-labels: true From f40538e6676da69758d384c34d6e4129316f121e Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 8 Oct 2023 22:23:39 +0800 Subject: [PATCH 12/45] Remove unnecessary desc for openssh key cron task (#27515) --- options/locale/locale_en-US.ini | 2 -- templates/admin/dashboard.tmpl | 6 ++---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 4420af1588..b7b99bd7a5 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -2741,9 +2741,7 @@ dashboard.deleted_branches_cleanup = Clean-up deleted branches dashboard.update_migration_poster_id = Update migration poster IDs dashboard.git_gc_repos = Garbage collect all repositories dashboard.resync_all_sshkeys = Update the '.ssh/authorized_keys' file with Gitea SSH keys. -dashboard.resync_all_sshkeys.desc = (Not needed for the built-in SSH server.) dashboard.resync_all_sshprincipals = Update the '.ssh/authorized_principals' file with Gitea SSH principals. -dashboard.resync_all_sshprincipals.desc = (Not needed for the built-in SSH server.) dashboard.resync_all_hooks = Resynchronize pre-receive, update and post-receive hooks of all repositories. dashboard.reinit_missing_repos = Reinitialize all missing Git repositories for which records exist dashboard.sync_external_users = Synchronize external user data diff --git a/templates/admin/dashboard.tmpl b/templates/admin/dashboard.tmpl index 6cb6c38e15..65d9c370f3 100644 --- a/templates/admin/dashboard.tmpl +++ b/templates/admin/dashboard.tmpl @@ -31,13 +31,11 @@ {{if and (not .SSH.Disabled) (not .SSH.StartBuiltinServer)}} - {{ctx.Locale.Tr "admin.dashboard.resync_all_sshkeys"}}
- {{ctx.Locale.Tr "admin.dashboard.resync_all_sshkeys.desc"}} + {{ctx.Locale.Tr "admin.dashboard.resync_all_sshkeys"}} - {{ctx.Locale.Tr "admin.dashboard.resync_all_sshprincipals"}}
- {{ctx.Locale.Tr "admin.dashboard.resync_all_sshprincipals.desc"}} + {{ctx.Locale.Tr "admin.dashboard.resync_all_sshprincipals"}} {{end}} From 4335c332bad82df3886f23a61ae71f06930a2196 Mon Sep 17 00:00:00 2001 From: Gary Wang Date: Sun, 8 Oct 2023 22:36:40 +0800 Subject: [PATCH 13/45] Apply to become a maintainer (#27522) --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 8d45c03826..72171f80ed 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -58,3 +58,4 @@ CaiCandong <1290147055@qq.com> (@caicandong) Rui Chen (@chenrui333) Nanguan Lin (@lng2020) kerwin612 (@kerwin612) +Gary Wang (@BLumia) From 0c2a3f4cdcc18f5b00b043a50d8f947e11cf604d Mon Sep 17 00:00:00 2001 From: Denys Konovalov Date: Sun, 8 Oct 2023 18:16:56 +0200 Subject: [PATCH 14/45] Update labeler to match new labeling system (#27525) --- .github/labeler.yml | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index d9a5782f7d..8a5ab26975 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,22 +1,36 @@ -kind/docs: +modifies/docs: - "**/*.md" - "docs/**" -kind/ui: +modifies/frontend: - "web_src/**/*" + +modifies/templates: - all: ["templates/**", "!templates/swagger/v1_json.tmpl"] -kind/build: +modifies/api: + - "routers/api/**" + - "templates/swagger/v1_json.tmpl" + +modifies/cli: + - "cmd/**" + +modifies/translation: + - "options/locale/*.ini" + +modifies/migrations: + - "models/migrations/**/*" + +modifies/internal: - "Makefile" - "Dockerfile" - "Dockerfile.rootless" - "docker/**" - "webpack.config.js" - -kind/lint: - ".eslintrc.yaml" - ".golangci.yml" - ".markdownlint.yaml" - ".spectral.yaml" - ".stylelintrc.yaml" - ".yamllint.yaml" + - ".github/**" From 5bf367f90415c178669f4c0d7a9c9b9fbbcd601d Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 9 Oct 2023 00:16:06 +0200 Subject: [PATCH 15/45] Restore warning commit status (#27504) Partial revert of https://github.com/go-gitea/gitea/pull/25839. This commit status is used by a number of external integrations, so I think we should not remove it (See https://github.com/go-gitea/gitea/pull/25839#issuecomment-1729002077). This is a rare case where an existing migration needed to be alterted to avoid data loss. --------- Co-authored-by: delvh Co-authored-by: Giteabot --- models/git/commit_status_test.go | 4 ++++ models/migrations/v1_21/v266.go | 3 --- modules/structs/commit_status.go | 14 +++++++++++--- templates/repo/commit_status.tmpl | 3 +++ templates/repo/issue/view_content/pull.tmpl | 2 +- tests/integration/pull_status_test.go | 2 ++ tests/integration/repo_commits_test.go | 4 ++++ web_src/js/components/DashboardRepoList.vue | 1 + 8 files changed, 26 insertions(+), 7 deletions(-) diff --git a/models/git/commit_status_test.go b/models/git/commit_status_test.go index a86941a0fe..2197433b3e 100644 --- a/models/git/commit_status_test.go +++ b/models/git/commit_status_test.go @@ -31,6 +31,10 @@ func TestGetCommitStatuses(t *testing.T) { assert.Equal(t, structs.CommitStatusPending, statuses[0].State) assert.Equal(t, "https://try.gitea.io/api/v1/repos/user2/repo1/statuses/1234123412341234123412341234123412341234", statuses[0].APIURL(db.DefaultContext)) + assert.Equal(t, "cov/awesomeness", statuses[1].Context) + assert.Equal(t, structs.CommitStatusWarning, statuses[1].State) + assert.Equal(t, "https://try.gitea.io/api/v1/repos/user2/repo1/statuses/1234123412341234123412341234123412341234", statuses[1].APIURL(db.DefaultContext)) + assert.Equal(t, "cov/awesomeness", statuses[2].Context) assert.Equal(t, structs.CommitStatusSuccess, statuses[2].State) assert.Equal(t, "https://try.gitea.io/api/v1/repos/user2/repo1/statuses/1234123412341234123412341234123412341234", statuses[2].APIURL(db.DefaultContext)) diff --git a/models/migrations/v1_21/v266.go b/models/migrations/v1_21/v266.go index df85286c89..79a5f5e14c 100644 --- a/models/migrations/v1_21/v266.go +++ b/models/migrations/v1_21/v266.go @@ -18,9 +18,6 @@ func ReduceCommitStatus(x *xorm.Engine) error { if _, err := sess.Exec(`UPDATE commit_status SET state='pending' WHERE state='running'`); err != nil { return err } - if _, err := sess.Exec(`UPDATE commit_status SET state='failure' WHERE state='warning'`); err != nil { - return err - } return sess.Commit() } diff --git a/modules/structs/commit_status.go b/modules/structs/commit_status.go index fda795dca6..dc880ef5eb 100644 --- a/modules/structs/commit_status.go +++ b/modules/structs/commit_status.go @@ -16,13 +16,16 @@ const ( CommitStatusError CommitStatusState = "error" // CommitStatusFailure is for when the CommitStatus is Failure CommitStatusFailure CommitStatusState = "failure" + // CommitStatusWarning is for when the CommitStatus is Warning + CommitStatusWarning CommitStatusState = "warning" ) var commitStatusPriorities = map[CommitStatusState]int{ CommitStatusError: 0, CommitStatusFailure: 1, - CommitStatusPending: 2, - CommitStatusSuccess: 3, + CommitStatusWarning: 2, + CommitStatusPending: 3, + CommitStatusSuccess: 4, } func (css CommitStatusState) String() string { @@ -32,7 +35,7 @@ func (css CommitStatusState) String() string { // NoBetterThan returns true if this State is no better than the given State // This function only handles the states defined in CommitStatusPriorities func (css CommitStatusState) NoBetterThan(css2 CommitStatusState) bool { - // NoBetterThan only handles the 4 states above + // NoBetterThan only handles the 5 states above if _, exist := commitStatusPriorities[css]; !exist { return false } @@ -63,3 +66,8 @@ func (css CommitStatusState) IsError() bool { func (css CommitStatusState) IsFailure() bool { return css == CommitStatusFailure } + +// IsWarning represents if commit status state is warning +func (css CommitStatusState) IsWarning() bool { + return css == CommitStatusWarning +} diff --git a/templates/repo/commit_status.tmpl b/templates/repo/commit_status.tmpl index ebd8a55f65..eb700ab2bb 100644 --- a/templates/repo/commit_status.tmpl +++ b/templates/repo/commit_status.tmpl @@ -11,3 +11,6 @@ {{if eq .State "failure"}} {{svg "octicon-x" 18 "commit-status icon text red"}} {{end}} +{{if eq .State "warning"}} + {{svg "gitea-exclamation" 18 "commit-status icon text yellow"}} +{{end}} diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index f9a43d7dbe..409af3a5d5 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -13,7 +13,7 @@ {{- else if .IsBlockedByOutdatedBranch}}red {{- else if .IsBlockedByChangedProtectedFiles}}red {{- else if and .EnableStatusCheck (or .RequiredStatusCheckState.IsFailure .RequiredStatusCheckState.IsError)}}red - {{- else if and .EnableStatusCheck (or (not $.LatestCommitStatus) .RequiredStatusCheckState.IsPending)}}yellow + {{- else if and .EnableStatusCheck (or (not $.LatestCommitStatus) .RequiredStatusCheckState.IsPending .RequiredStatusCheckState.IsWarning)}}yellow {{- else if and .AllowMerge .RequireSigned (not .WillSign)}}red {{- else if .Issue.PullRequest.IsChecking}}yellow {{- else if .Issue.PullRequest.IsEmpty}}grey diff --git a/tests/integration/pull_status_test.go b/tests/integration/pull_status_test.go index 7c1f8c701e..01cb40d2cf 100644 --- a/tests/integration/pull_status_test.go +++ b/tests/integration/pull_status_test.go @@ -53,6 +53,7 @@ func TestPullCreate_CommitStatus(t *testing.T) { api.CommitStatusError, api.CommitStatusFailure, api.CommitStatusSuccess, + api.CommitStatusWarning, } statesIcons := map[api.CommitStatusState]string{ @@ -60,6 +61,7 @@ func TestPullCreate_CommitStatus(t *testing.T) { api.CommitStatusSuccess: "octicon-check", api.CommitStatusError: "gitea-exclamation", api.CommitStatusFailure: "octicon-x", + api.CommitStatusWarning: "gitea-exclamation", } testCtx := NewAPITestContext(t, "user1", "repo1", auth_model.AccessTokenScopeWriteRepository) diff --git a/tests/integration/repo_commits_test.go b/tests/integration/repo_commits_test.go index 789b5f7cc3..bb65d9e04a 100644 --- a/tests/integration/repo_commits_test.go +++ b/tests/integration/repo_commits_test.go @@ -125,6 +125,10 @@ func TestRepoCommitsWithStatusFailure(t *testing.T) { doTestRepoCommitWithStatus(t, "failure", "octicon-x", "red") } +func TestRepoCommitsWithStatusWarning(t *testing.T) { + doTestRepoCommitWithStatus(t, "warning", "gitea-exclamation", "yellow") +} + func TestRepoCommitsStatusParallel(t *testing.T) { defer tests.PrepareTestEnv(t)() diff --git a/web_src/js/components/DashboardRepoList.vue b/web_src/js/components/DashboardRepoList.vue index 5ff51168cb..f7cea32fb6 100644 --- a/web_src/js/components/DashboardRepoList.vue +++ b/web_src/js/components/DashboardRepoList.vue @@ -12,6 +12,7 @@ const commitStatus = { success: {name: 'octicon-check', color: 'green'}, error: {name: 'gitea-exclamation', color: 'red'}, failure: {name: 'octicon-x', color: 'red'}, + warning: {name: 'gitea-exclamation', color: 'yellow'}, }; const sfc = { From 4aae15af7a14c0d9403cafb855aa09570476938c Mon Sep 17 00:00:00 2001 From: GiteaBot Date: Mon, 9 Oct 2023 00:23:39 +0000 Subject: [PATCH 16/45] [skip ci] Updated translations via Crowdin --- options/locale/locale_zh-CN.ini | 71 +++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index 856a8e6807..4619e04e84 100644 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -986,6 +986,7 @@ mirror_sync_on_commit=推送提交时同步 mirror_address=从 URL 克隆 mirror_address_desc=在授权框中输入必要的凭据。 mirror_address_url_invalid=URL无效。请检查您所输入的URL是否正确。 +mirror_address_protocol_invalid=提供的URL无效。只能使用http(s)://或git://地址进行镜像操作。 mirror_lfs=大文件存储 (LFS) mirror_lfs_desc=镜像 LFS 数据。 mirror_lfs_endpoint=LFS 网址 @@ -1023,6 +1024,8 @@ transfer.accept=接受转移 transfer.accept_desc=`转移到 "%s"` transfer.reject=拒绝转移 transfer.reject_desc=`取消转移到 "%s"` +transfer.no_permission_to_accept=您没有权限接受此转让。 +transfer.no_permission_to_reject=您没有权限拒绝此转让。 desc.private=私有库 desc.public=公开 @@ -1043,6 +1046,8 @@ template.issue_labels=工单标签 template.one_item=必须至少选择一个模板项 template.invalid=必须选择一个模板仓库 +archive.title=该仓库已被归档。您可以查看文件和克隆它,但不能推送、创建工单或合并请求。 +archive.title_date=该仓库已于 %s 归档。您可以查看文件或克隆它,但不能推送、创建工单或合并请求。 archive.issue.nocomment=此仓库已存档,您不能在此工单添加评论。 archive.pull.nocomment=此仓库已存档,您不能在此合并请求添加评论。 @@ -1059,6 +1064,7 @@ migrate_options_lfs=迁移 LFS 文件 migrate_options_lfs_endpoint.label=LFS 网址 migrate_options_lfs_endpoint.description=迁移将尝试使用你的 Git remote 来 确定 LFS 服务器。如果仓库 LFS 数据存储在其他位置,你还可以指定自定义网址。 migrate_options_lfs_endpoint.description.local=支持本地服务器路径。 +migrate_options_lfs_endpoint.placeholder=如果留空,网址将从克隆 URL 中得到 migrate_items=迁移项目 migrate_items_wiki=百科 migrate_items_milestones=里程碑 @@ -1161,6 +1167,10 @@ file_view_rendered=渲染模式 file_view_raw=查看原始文件 file_permalink=永久链接 file_too_large=文件过大,无法显示。 +invisible_runes_header=`此文件含有不可见的 Unicode 字符` +invisible_runes_description=`此文件含有人类无法区分的不可见的 Unicode 字符,但可以由计算机进行不同的处理。 如果您是想特意这样的,可以安全地忽略该警告。 使用 Escape 按钮显示他们。` +ambiguous_runes_header=`此文件含有模棱两可的 Unicode 字符` +ambiguous_runes_description=`此文件含有可能会与其他字符混淆的 Unicode 字符。 如果您是想特意这样的,可以安全地忽略该警告。 使用 Escape 按钮显示他们。` invisible_runes_line=`此行含有不可见的 unicode 字符` ambiguous_runes_line=`此行有模棱两可的 unicode 字符` ambiguous_character=`%[1]c [U+%04[1]X] 容易和 %[2]c [U+%04[2]X] 混淆` @@ -1180,6 +1190,8 @@ commit_graph.hide_pr_refs=隐藏合并请求 commit_graph.monochrome=黑白 commit_graph.color=彩色 commit.contained_in=这个提交包含在: +commit.contained_in_default_branch=此提交是默认分支的一部分 +commit.load_referencing_branches_and_tags=加载引用该提交的分支和标签 blame=Blame download_file=下载文件 normal_view=普通视图 @@ -1434,6 +1446,7 @@ issues.filter_sort.moststars=点赞由多到少 issues.filter_sort.feweststars=点赞由少到多 issues.filter_sort.mostforks=派生由多到少 issues.filter_sort.fewestforks=派生由少到多 +issues.keyword_search_unavailable=关键词搜索目前不可用。请联系网站管理员。 issues.action_open=开启 issues.action_close=关闭 issues.action_label=标签 @@ -1465,6 +1478,8 @@ issues.context.edit=编辑 issues.context.delete=刪除 issues.no_content=没有提供说明。 issues.close=关闭工单 +issues.comment_pull_merged_at=已合并提交 %[1]s 到 %[2]s %[3]s +issues.comment_manually_pull_merged_at=手动合并提交 %[1]s 到 %[2]s %[3]s issues.close_comment_issue=评论并关闭 issues.reopen_issue=重新开启 issues.reopen_comment_issue=评论并重新开启 @@ -1484,9 +1499,13 @@ issues.author_helper=此用户是作者。 issues.role.owner=管理员 issues.role.owner_helper=该用户是该仓库的所有者。 issues.role.member=普通成员 +issues.role.member_helper=该用户是拥有该仓库的组织成员。 issues.role.collaborator=协作者 +issues.role.collaborator_helper=该用户已被邀请在仓库上进行协作。 issues.role.first_time_contributor=首次贡献者 +issues.role.first_time_contributor_helper=这是该用户对仓库的第一次贡献。 issues.role.contributor=贡献者 +issues.role.contributor_helper=该用户之前提交过该仓库。 issues.re_request_review=再次请求审核 issues.is_stale=此评审之后代码有更新 issues.remove_request_review=移除审核请求 @@ -1606,6 +1625,7 @@ issues.dependency.issue_closing_blockedby=关闭此工单被以下工单阻止 issues.dependency.issue_close_blocks=此工单阻止了以下工单的关闭 issues.dependency.pr_close_blocks=此合并请求阻止以下工单的关闭 issues.dependency.issue_close_blocked=您需要关闭所有阻止此工单的工单, 然后才能关闭它。 +issues.dependency.issue_batch_close_blocked=无法批量关闭您所选择的工单,因为 #%d 工单仍然有处于打开状态的依赖工单 issues.dependency.pr_close_blocked=您需要关闭所有阻止此合并请求的工单, 然后才能合并它。 issues.dependency.blocks_short=阻止 issues.dependency.blocked_by_short=依赖于 @@ -1637,6 +1657,7 @@ issues.review.pending.tooltip=此评论目前对其他用户不可见。 若要 issues.review.review=评审 issues.review.reviewers=评审人 issues.review.outdated=已过期 +issues.review.outdated_description=评论发布后内容已经修改 issues.review.option.show_outdated_comments=显示过时的评论 issues.review.option.hide_outdated_comments=隐藏过时的评论 issues.review.show_outdated=显示过时的 @@ -1682,6 +1703,8 @@ pulls.show_all_commits=显示所有提交 pulls.show_changes_since_your_last_review=显示自您上次审核以来的更改 pulls.showing_only_single_commit=仅显示提交 %[1]s 的更改 pulls.showing_specified_commit_range=仅显示 %[1]s...%[2]s 之间的更改 +pulls.select_commit_hold_shift_for_range=选择提交。按住 Shift + 单击选择一个范围 +pulls.review_only_possible_for_full_diff=只有在查看全部差异时才能进行审核 pulls.filter_changes_by_commit=按提交筛选 pulls.nothing_to_compare=分支内容相同,无需创建合并请求。 pulls.nothing_to_compare_and_allow_empty_pr=这些分支是相等的,此合并请求将为空。 @@ -1715,6 +1738,11 @@ pulls.required_status_check_failed=一些必要的检查没有成功 pulls.required_status_check_missing=缺少一些必要的检查。 pulls.required_status_check_administrator=作为管理员,您仍可合并此合并请求 pulls.blocked_by_approvals=此合并请求没有通过审批。已获取审批数%d个,共需要审批数%d个。 +pulls.blocked_by_rejection=此合并请求有官方审核员请求的更改。 +pulls.blocked_by_official_review_requests=此合并请求需要官方评审。 +pulls.blocked_by_outdated_branch=此合并请求因过期而被阻止。 +pulls.blocked_by_changed_protected_files_1=此合并请求被阻止是因为修改了被保护的文件: +pulls.blocked_by_changed_protected_files_n=此合并请求被阻止是因为修改了被保护的文件: pulls.can_auto_merge_desc=该合并请求可以进行自动合并操作。 pulls.cannot_auto_merge_desc=该合并请求存在冲突,无法进行自动合并操作。 pulls.cannot_auto_merge_helper=手动合并解决此冲突 @@ -1749,6 +1777,7 @@ pulls.rebase_conflict_summary=错误信息 pulls.unrelated_histories=合并失败:两个分支没有共同历史。提示:尝试不同的策略 pulls.merge_out_of_date=合并失败:在生成合并时,主分支已更新。提示:再试一次。 pulls.head_out_of_date=合并失败:在生成合并时,head 已更新。提示:再试一次。 +pulls.has_merged=失败:合并请求已经被合并,您不能再次合并或更改目标分支。 pulls.push_rejected=合并失败:推送被拒绝。审查此仓库的 Git 钩子。 pulls.push_rejected_summary=详细拒绝信息 pulls.push_rejected_no_message=合并失败:此推送被拒绝但未提供其他信息。
请检查此仓库的 Git Hook。 @@ -1789,6 +1818,7 @@ pulls.auto_merge_canceled_schedule_comment=`已取消当所有检查成功后自 pulls.delete.title=删除此拉取请求? pulls.delete.text=你真的要删除这个拉取请求吗? (这将永久删除所有内容。如果你打算将内容存档,请考虑关闭它) +pulls.recently_pushed_new_branches=您已经于%[2]s推送了分支 %[1]s pull.deleted_branch=(已删除): %s @@ -1798,6 +1828,7 @@ milestones.update_ago=已更新 %s milestones.no_due_date=暂无截止日期 milestones.open=开启中 milestones.close=关闭 +milestones.new_subheader=里程碑可以帮助您组织工单并跟踪其进度。 milestones.completeness=%d%% 完成 milestones.create=创建里程碑 milestones.title=标题 @@ -1822,8 +1853,17 @@ milestones.filter_sort.most_issues=工单从多到少 milestones.filter_sort.least_issues=工单从少到多 signing.will_sign=这个提交将用密钥 "%s" 签名。 +signing.wont_sign.error=在检查提交是否可以被签名时出错。 +signing.wont_sign.nokey=没有可用的密钥来签署这个提交。 signing.wont_sign.never=提交从未签名。 signing.wont_sign.always=提交总是签名。 +signing.wont_sign.pubkey=由于您没有公钥关联到您的账户,提交将不会被签名。 +signing.wont_sign.twofa=您必须启用两步验证才能签名提交。 +signing.wont_sign.parentsigned=提交将不会被签名,因为父提交没有签名。 +signing.wont_sign.basesigned=合并将不会被签名,因为父提交没有签名。 +signing.wont_sign.headsigned=合并将不会被签名,因为最新提交没有签名。 +signing.wont_sign.commitssigned=合并将不会被签名,因为所有相关的提交都没有签名。 +signing.wont_sign.approved=合并将不会被签名,因为合并请求未被批准。 signing.wont_sign.not_signed_in=您还没有登录。 ext_wiki=访问外部百科 @@ -1946,8 +1986,17 @@ settings.hooks=Web 钩子 settings.githooks=管理 Git 钩子 settings.basic_settings=基本设置 settings.mirror_settings=镜像设置 +settings.mirror_settings.docs=设置您的仓库以自动同步另一个仓库的提交、标签和分支。 +settings.mirror_settings.docs.disabled_pull_mirror.instructions=设置您的项目以自动将提交、标签和分支推送到另一个仓库。您的站点管理员已禁用了拉取镜像。 +settings.mirror_settings.docs.disabled_push_mirror.instructions=将您的项目设置为自动从一个仓库拉取提交、标签和分支。 +settings.mirror_settings.docs.disabled_push_mirror.pull_mirror_warning=现在,这只能在“迁移外部仓库”菜单中完成。欲了解更多信息,请咨询: +settings.mirror_settings.docs.disabled_push_mirror.info=您的站点管理员已禁用推送镜像。 +settings.mirror_settings.docs.no_new_mirrors=您的仓库将镜像同步另一个仓库的更改。请注意,您现在不能创建任何新的镜像。 +settings.mirror_settings.docs.can_still_use=虽然您不能修改现有镜像或创建新镜像,但您仍然可以使用已存在的镜像。 settings.mirror_settings.docs.pull_mirror_instructions=要创建一个拉取镜像,请参阅: +settings.mirror_settings.docs.more_information_if_disabled=您可以在这里找到更多关于推送和拉取镜像的信息: settings.mirror_settings.docs.doc_link_title=如何镜像仓库? +settings.mirror_settings.docs.doc_link_pull_section=文档中的 “从远程仓库拉取” 部分。 settings.mirror_settings.docs.pulling_remote_title=从远程仓库拉取代码 settings.mirror_settings.mirrored_repository=镜像库 settings.mirror_settings.direction=方向 @@ -2028,6 +2077,7 @@ settings.transfer.rejected=代码库转移被拒绝。 settings.transfer.success=代码库转移成功。 settings.transfer_abort=取消转移 settings.transfer_abort_invalid=你不能取消不存在的代码库转移。 +settings.transfer_abort_success=成功取消了将代码库转让给 %s。 settings.transfer_desc=您可以将仓库转移至您拥有管理员权限的帐户或组织。 settings.transfer_form_title=输入仓库名称以做确认: settings.transfer_in_progress=当前正在进行转让。 如果你想将此代码库转让给另一个用户,请取消它。 @@ -2063,6 +2113,7 @@ settings.delete_notices_2=- 此操作将永久删除仓库 %s settings.delete_notices_fork_1=- 在此仓库删除后,它的派生仓库将变成独立仓库。 settings.deletion_success=仓库已被删除。 settings.update_settings_success=仓库设置已更新。 +settings.update_settings_no_unit=该代码库应该至少允许某种形式的交互。 settings.confirm_delete=删除本仓库 settings.add_collaborator=增加协作者 settings.add_collaborator_success=协作者添加成功! @@ -2243,6 +2294,7 @@ settings.protect_merge_whitelist_users=合并白名单用户: settings.protect_merge_whitelist_teams=合并白名单团队: settings.protect_check_status_contexts=启用状态检查 settings.protect_status_check_patterns=状态检查模式: +settings.protect_status_check_patterns_desc=输入模式,指定哪些状态检查必须通过,才能将分支合并到符合此规则的分支中去。每一行指定一个模式,模式不能为空。 settings.protect_check_status_contexts_desc=要求状态检查通过才能合并,选择必须先通过哪些状态检查才能合并。如果启用,推送的合并请求必须先通过状态检查才能够合并到对应的分支。如果没有选择具体的状态检查上下文,则所有的状态检查都通过才能合并。 settings.protect_check_status_contexts_list=此仓库上周进行过的状态检查 settings.protect_status_check_matched=匹配 @@ -2296,6 +2348,7 @@ settings.tags.protection.allowed.teams=允许的团队 settings.tags.protection.allowed.noone=无 settings.tags.protection.create=保护Git标签 settings.tags.protection.none=没有受保护的Git标签 +settings.tags.protection.pattern.description=你可以使用单个名称或 glob 模式匹配或正则表达式来匹配多个标签。了解详情请访问 受保护Git标签指南。 settings.bot_token=Bot 令牌 settings.chat_id=聊天 ID settings.thread_id=线程 ID @@ -2304,6 +2357,7 @@ settings.matrix.room_id=房间ID settings.matrix.message_type=消息类型 settings.archive.button=归档仓库 settings.archive.header=归档此仓库 +settings.archive.text=归档仓库将使其完全只读。它将在首页隐藏。没有人(甚至你!)能够进行新的提交,或打开工单及合并请求。 settings.archive.success=仓库已成功归档。 settings.archive.error=仓库在归档时出现异常。请通过日志获取详细信息。 settings.archive.error_ismirror=请不要对镜像仓库归档,谢谢! @@ -2313,6 +2367,7 @@ settings.unarchive.button=撤销仓库归档 settings.unarchive.header=撤销此仓库归档 settings.unarchive.text=撤销归档将恢复仓库接收提交、推送,以及新工单和合并请求的能力。 settings.unarchive.success=仓库已成功撤销归档。 +settings.unarchive.error=仓库在取消归档时出现异常。请通过日志获取详细信息。 settings.update_avatar_success=仓库头像已经更新。 settings.lfs=LFS settings.lfs_filelist=存储在此仓库中的 LFS 文件 @@ -2436,6 +2491,7 @@ release.edit_release=保存此次发布 release.delete_release=删除发布 release.delete_tag=删除 Git标签 release.deletion=删除发布 +release.deletion_desc=删除版本发布只会从 Gitea 中移除。这不会影响 Git 的标签以及您仓库的内容和历史。是否继续? release.deletion_success=Release已被删除。 release.deletion_tag_desc=将从仓库中删除此 Git标签。仓库内容和历史记录保持不变。继续吗? release.deletion_tag_success=该 Git标签 已经被删除 @@ -2456,6 +2512,7 @@ branch.already_exists=名为 %s 的分支已存在。 branch.delete_head=刪除 branch.delete=删除分支 %s branch.delete_html=删除分支 +branch.delete_desc=删除分支是永久的。虽然已删除的分支在实际被删除前有可能会短时间存在,但这在大多数情况下无法撤销。是否继续? branch.deletion_success=分支 %s 已被删除。 branch.deletion_failed=删除分支 %s 失败。 branch.delete_branch_has_new_commits=因为合并之后有新的提交,分支 %s 无法被删除。 @@ -2495,6 +2552,7 @@ tag.create_success=标签"%s"已存在 topic.manage_topics=管理主题 topic.done=保存 topic.count_prompt=您最多选择25个主题 +topic.format_prompt=主题必须以字母或数字开头,可以包含连字符 ('-') 和句点 ('.'),长度不得超过35个字符。字符必须为小写。 find_file.go_to_file=转到文件 find_file.no_matching=没有找到匹配的文件 @@ -2547,6 +2605,7 @@ settings.visibility.private_shortname=私有 settings.update_settings=更新组织设置 settings.update_setting_success=组织设置已更新。 +settings.change_orgname_prompt=注意:更改组织名称同时会更改组织的 URL 地址并释放旧的名称。 settings.change_orgname_redirect_prompt=在被人使用前,旧用户名将会被重定向。 settings.update_avatar_success=组织头像已经更新。 settings.delete=删除组织 @@ -2622,6 +2681,7 @@ teams.all_repositories_helper=团队可以访问所有仓库。选择此选项 teams.all_repositories_read_permission_desc=此团队授予读取所有仓库的访问权限: 成员可以查看和克隆仓库。 teams.all_repositories_write_permission_desc=此团队授予修改所有仓库的访问权限: 成员可以查看和推送至仓库。 teams.all_repositories_admin_permission_desc=该团队拥有 管理 所有仓库的权限:团队成员可以读取、克隆、推送以及添加其它仓库协作者。 +teams.invite.title=您已被邀请加入组织 %s 中的团队 %s。 teams.invite.by=邀请人 %s teams.invite.description=请点击下面的按钮加入团队。 @@ -2834,10 +2894,12 @@ packages.size=大小 packages.published=已发布 defaulthooks=默认Web钩子 +defaulthooks.desc=当某些 Gitea 事件触发时,Web 钩子自动向服务器发出 HTTP POST 请求。这里定义的 Web 钩子是默认配置,将被复制到所有新的仓库中。详情请访问 Web 钩子指南。 defaulthooks.add_webhook=添加默认Web 钩子 defaulthooks.update_webhook=更新默认 Web 钩子 systemhooks=系统 Web 钩子 +systemhooks.desc=当某些 Gitea 事件触发时,Web 钩子自动向服务器发出HTTP POST请求。这里定义的 Web 钩子将作用于系统上的所有仓库,所以请考虑这可能带来的任何性能影响。了解详情请访问 Web 钩子指南。 systemhooks.add_webhook=添加系统 Web 钩子 systemhooks.update_webhook=更新系统 Web 钩子 @@ -2930,6 +2992,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=`在 https://bitbucket.org/account/user//oauth-consumers/new 注册新的 OAuth 消费者同时添加权限"帐户"-"读"` auths.tip.nextcloud=使用下面的菜单“设置(Settings) -> 安全(Security) -> OAuth 2.0 client”在您的实例上注册一个新的 OAuth 客户端。 @@ -2941,6 +3004,7 @@ auths.tip.google_plus=从谷歌 API 控制台 (https://console.developers.google auths.tip.openid_connect=使用 OpenID 连接发现 URL (/.well-known/openid-configuration) 来指定终点 auths.tip.twitter=访问 https://dev.twitter.com/apps,创建应用并确保启用了"允许此应用程序用于登录 Twitter"的选项。 auths.tip.discord=在 https://discordapp.com/developers/applications/me 上注册新应用程序 +auths.tip.gitea=注册一个新的 OAuth2 应用程序。可以访问 https://docs.gitea.com/development/oauth2-provider 查看帮助 auths.tip.yandex=在 https://oauth.yandex.com/client/new 上创建一个新的应用程序。在“ Yandex.Passport API”这部分中选择以下权限:“访问电子邮件地址(Access to email address)”,“访问用户头像(Access to user avatar)”和“访问用户名,名字和姓氏,性别(Access to username, first name and surname, genderAccess to username, first name and surname, gender)” auths.tip.mastodon=输入您想要认证的 mastodon 实例的自定义 URL (或使用默认值) auths.edit=修改认证源 @@ -3127,6 +3191,7 @@ monitor.queue.maxnumberworkers=最大工作者数量 monitor.queue.numberinqueue=队列中的数量 monitor.queue.review_add=查看 / 添加工作者 monitor.queue.settings.title=池设置 +monitor.queue.settings.desc=因为工作者队列阻塞,池正在动态扩展。 monitor.queue.settings.maxnumberworkers=最大工作者数量 monitor.queue.settings.maxnumberworkers.placeholder=当前 %[1]d monitor.queue.settings.maxnumberworkers.error=最大工作者数必须是数字 @@ -3245,6 +3310,7 @@ desc=管理仓库软件包。 empty=还没有软件包。 empty.documentation=关于软件包注册中心的更多信息,请参阅 文档 。 empty.repo=您上传了一个包,但没有显示在这里吗?转到 包设置 并将其链接到这个仓库中。 +registry.documentation=关于 %s 注册中心的更多信息,请参阅 文档。 filter.type=类型 filter.type.all=所有 filter.no_result=您的过滤器没有产生任何结果。 @@ -3268,6 +3334,9 @@ versions=版本 versions.view_all=查看全部 dependency.id=ID dependency.version=版本 +alpine.registry=通过在您的 /etc/apk/repositories 文件中添加 URL 来设置此注册中心: +alpine.registry.key=下载注册中心公开的 RSA 密钥到 /etc/apk/keys/ 文件夹来验证索引签名: +alpine.registry.info=从下面的列表中选择 $branch 和 $repository。 alpine.install=要安装包,请运行以下命令: alpine.repository=仓库信息 alpine.repository.branches=分支 @@ -3299,8 +3368,10 @@ container.layers=镜像层 container.labels=标签 container.labels.key=键 container.labels.value=值 +cran.registry=在您的 Rprofile.site 文件中设置此注册中心: cran.install=要安装包,请运行以下命令: debian.registry=从命令行设置此注册中心: +debian.registry.info=从下面的列表中选择 $distribution 和 $component。 debian.install=要安装包,请运行以下命令: debian.repository=仓库信息 debian.repository.distributions=发行版 From ae2794c95863374c8f68215b571d5040bd1fbd2a Mon Sep 17 00:00:00 2001 From: delvh Date: Mon, 9 Oct 2023 03:16:05 +0200 Subject: [PATCH 17/45] Document our new labeling strategy (#27523) --- CONTRIBUTING.md | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5cd83a4898..75d2cd22e6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -225,17 +225,20 @@ PRs without a milestone may not be merged. ### Labels -Every PR should be labeled correctly with every label that applies. \ -This includes especially the distinction between `bug` (fixing existing functionality), `feature` (new functionality), `enhancement` (upgrades for existing functionality), and `refactoring` (improving the internal code structure without changing the output (much)). \ -Furthermore, +Almost all labels used inside Gitea can be classified as one of the following: + +- `modifies/…`: Determines which parts of the codebase are affected. These labels will be set through the CI. +- `topic/…`: Determines the conceptual component of Gitea that is affected, i.e. issues, projects, or authentication. At best, PRs should only target one component but there might be overlap. Must be set manually. +- `type/…`: Determines the type of an issue or PR (feature, refactoring, docs, bug, …). If GitHub supported scoped labels, these labels would be exclusive, so you should set **exactly** one, not more or less (every PR should fall into one of the provided categories, and only one). +- `issue/…` / `pr/…`: Labels that are specific to issues or PRs respectively and that are only necessary in a given context, i.e. `issue/not-a-bug` or `pr/need-2-approvals` + +Every PR should be labeled correctly with every label that applies. + +There are also some labels that will be managed automatically.\ +In particular, these are - the amount of pending required approvals -- whether this PR is `blocked`, a `backport` or `breaking` -- if it targets the `ui` or `api` -- if it increases the application `speed` -- reduces `memory usage` - -are oftentimes notable labels. +- has all `backport`s or needs a manual backport ### Breaking PRs From e94a4ad28d45ade6115372a3d1461c3db935065e Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 9 Oct 2023 06:45:41 +0200 Subject: [PATCH 18/45] Add docs section for sub-paths with the container registry (#27505) Fixes #21092 suggested by https://github.com/go-gitea/gitea/issues/21092#issuecomment-1749965397 --------- Co-authored-by: wxiaoguang --- docs/content/administration/reverse-proxies.en-us.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/content/administration/reverse-proxies.en-us.md b/docs/content/administration/reverse-proxies.en-us.md index c141483700..fe54c67d02 100644 --- a/docs/content/administration/reverse-proxies.en-us.md +++ b/docs/content/administration/reverse-proxies.en-us.md @@ -381,3 +381,9 @@ If you really need to do so, to make Gitea works with sub-path (eg: `http://exam 1. Set `[server] ROOT_URL = http://example.com/gitea/` in your `app.ini` file. 2. Make the reverse-proxy pass `http://example.com/gitea/foo` to `http://gitea-server:3000/foo`. 3. Make sure the reverse-proxy not decode the URI, the request `http://example.com/gitea/a%2Fb` should be passed as `http://gitea-server:3000/a%2Fb`. + +## Docker / Container Registry + +The container registry uses a fixed sub-path `/v2` which can't be changed. +Even if you deploy Gitea with a different sub-path, `/v2` will be used by the `docker` client. +Therefore you may need to add an additional route to your reverse proxy configuration. From 79e8865aaed43de81816390ee616263bb2bee67f Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 9 Oct 2023 08:16:16 +0200 Subject: [PATCH 19/45] Simplify `contrib/backport` (#27520) This script was trying to be too smart, make it more straightforward and less error-prone so that i could be used by the backport bot too ideally. - Always delete the backport branch so that script is idempotent in this regard - Remove the push functionality, it's best done by the user because only they know the remote name - Remove reading docs/config.yaml, it no longer exists - Remove version detection, version is now a required argument - Remove opening the pull request with xdg-open, xdg-open is not portable - Remove continue from failed cherry pick. It's best to reset manually in this case - Clean up the console logging Example run: ``` $ go run ./contrib/backport --version v1.21 27503 * Backporting 27503 to origin/release/v1.21 as backport-27503-v1.21 * `git fetch origin main` * `git fetch origin release/v1.21` * `git branch -D backport-27503-v1.21` * `git checkout -b backport-27503-v1.21 origin/release/v1.21` * Attempting git cherry-pick 08efeb5cdc22d21b5ef12cc540727594a22062d1 * Amending commit to prepend `Backport #27503` to body Backport done! You can now push it with `git push yourremote backport-27503-v1.21` ``` --------- Co-authored-by: delvh --- contrib/backport/backport.go | 237 ++--------------------------------- 1 file changed, 12 insertions(+), 225 deletions(-) diff --git a/contrib/backport/backport.go b/contrib/backport/backport.go index 5cd0fe0f6e..383a848007 100644 --- a/contrib/backport/backport.go +++ b/contrib/backport/backport.go @@ -7,7 +7,6 @@ package main import ( "context" "fmt" - "log" "net/http" "os" "os/exec" @@ -19,11 +18,8 @@ import ( "github.com/google/go-github/v53/github" "github.com/urfave/cli/v2" - "gopkg.in/yaml.v3" ) -const defaultVersion = "v1.18" // to backport to - func main() { app := cli.NewApp() app.Name = "backport" @@ -54,16 +50,6 @@ func main() { Name: "backport-branch", Usage: "Backport branch to backport on to (default: backport--", }, - &cli.StringFlag{ - Name: "remote", - Value: "", - Usage: "Remote for your fork of the Gitea upstream", - }, - &cli.StringFlag{ - Name: "fork-user", - Value: "", - Usage: "Forked user name on Github", - }, &cli.BoolFlag{ Name: "no-fetch", Usage: "Set this flag to prevent fetch of remote branches", @@ -72,18 +58,6 @@ func main() { Name: "no-amend-message", Usage: "Set this flag to prevent automatic amendment of the commit message", }, - &cli.BoolFlag{ - Name: "no-push", - Usage: "Set this flag to prevent pushing the backport up to your fork", - }, - &cli.BoolFlag{ - Name: "no-xdg-open", - Usage: "Set this flag to not use xdg-open to open the PR URL", - }, - &cli.BoolFlag{ - Name: "continue", - Usage: "Set this flag to continue from a git cherry-pick that has broken", - }, } cli.AppHelpTemplate = `NAME: {{.Name}} - {{.Usage}} @@ -101,7 +75,7 @@ OPTIONS: app.Action = runBackport if err := app.Run(os.Args); err != nil { - fmt.Fprintf(os.Stderr, "Unable to backport: %v\n", err) + fmt.Fprintf(os.Stderr, "%v\n", err) } } @@ -109,24 +83,9 @@ func runBackport(c *cli.Context) error { ctx, cancel := installSignals() defer cancel() - continuing := c.Bool("continue") - - var pr string - version := c.String("version") - if version == "" && continuing { - // determine version from current branch name - var err error - pr, version, err = readCurrentBranch(ctx) - if err != nil { - return err - } - } if version == "" { - version = readVersion() - } - if version == "" { - version = defaultVersion + return fmt.Errorf("Provide a version to backport to") } upstream := c.String("upstream") @@ -134,16 +93,6 @@ func runBackport(c *cli.Context) error { upstream = "origin" } - forkUser := c.String("fork-user") - remote := c.String("remote") - if remote == "" && !c.Bool("--no-push") { - var err error - remote, forkUser, err = determineRemote(ctx, forkUser) - if err != nil { - return err - } - } - upstreamReleaseBranch := c.String("release-branch") if upstreamReleaseBranch == "" { upstreamReleaseBranch = path.Join("release", version) @@ -152,14 +101,12 @@ func runBackport(c *cli.Context) error { localReleaseBranch := path.Join(upstream, upstreamReleaseBranch) args := c.Args().Slice() - if len(args) == 0 && pr == "" { - return fmt.Errorf("no PR number provided\nProvide a PR number to backport") - } else if len(args) != 1 && pr == "" { - return fmt.Errorf("multiple PRs provided %v\nOnly a single PR can be backported at a time", args) - } - if pr == "" { - pr = args[0] + if len(args) == 0 { + return fmt.Errorf("Provide a PR number to backport") + } else if len(args) != 1 { + return fmt.Errorf("Only a single PR can be backported at a time") } + pr := args[0] backportBranch := c.String("backport-branch") if backportBranch == "" { @@ -186,10 +133,8 @@ func runBackport(c *cli.Context) error { } } - if !continuing { - if err := checkoutBackportBranch(ctx, backportBranch, localReleaseBranch); err != nil { - return err - } + if err := checkoutBackportBranch(ctx, backportBranch, localReleaseBranch); err != nil { + return err } if err := cherrypick(ctx, sha); err != nil { @@ -202,41 +147,8 @@ func runBackport(c *cli.Context) error { } } - if !c.Bool("no-push") { - url := "https://github.com/go-gitea/gitea/compare/" + upstreamReleaseBranch + "..." + forkUser + ":" + backportBranch + fmt.Printf("Backport done! You can now push it with `git push %s`\n", backportBranch) - if err := gitPushUp(ctx, remote, backportBranch); err != nil { - return err - } - - if !c.Bool("no-xdg-open") { - if err := xdgOpen(ctx, url); err != nil { - return err - } - } else { - fmt.Printf("* Navigate to %s to open PR\n", url) - } - } - return nil -} - -func xdgOpen(ctx context.Context, url string) error { - fmt.Printf("* `xdg-open %s`\n", url) - out, err := exec.CommandContext(ctx, "xdg-open", url).Output() - if err != nil { - fmt.Fprintf(os.Stderr, "%s", string(out)) - return fmt.Errorf("unable to xdg-open to %s: %w", url, err) - } - return nil -} - -func gitPushUp(ctx context.Context, remote, backportBranch string) error { - fmt.Printf("* `git push -u %s %s`\n", remote, backportBranch) - out, err := exec.CommandContext(ctx, "git", "push", "-u", remote, backportBranch).Output() - if err != nil { - fmt.Fprintf(os.Stderr, "%s", string(out)) - return fmt.Errorf("unable to push up to %s: %w", remote, err) - } return nil } @@ -267,18 +179,6 @@ func amendCommit(ctx context.Context, pr string) error { } func cherrypick(ctx context.Context, sha string) error { - // Check if a CHERRY_PICK_HEAD exists - if _, err := os.Stat(".git/CHERRY_PICK_HEAD"); err == nil { - // Assume that we are in the middle of cherry-pick - continue it - fmt.Println("* Attempting git cherry-pick --continue") - out, err := exec.CommandContext(ctx, "git", "cherry-pick", "--continue").Output() - if err != nil { - fmt.Fprintf(os.Stderr, "git cherry-pick --continue failed:\n%s\n", string(out)) - return fmt.Errorf("unable to continue cherry-pick: %w", err) - } - return nil - } - fmt.Printf("* Attempting git cherry-pick %s\n", sha) out, err := exec.CommandContext(ctx, "git", "cherry-pick", sha).Output() if err != nil { @@ -289,22 +189,8 @@ func cherrypick(ctx context.Context, sha string) error { } func checkoutBackportBranch(ctx context.Context, backportBranch, releaseBranch string) error { - out, err := exec.CommandContext(ctx, "git", "branch", "--show-current").Output() - if err != nil { - return fmt.Errorf("unable to check current branch %w", err) - } - - currentBranch := strings.TrimSpace(string(out)) - fmt.Printf("* Current branch is %s\n", currentBranch) - if currentBranch == backportBranch { - fmt.Printf("* Current branch is %s - not checking out\n", currentBranch) - return nil - } - - if _, err := exec.CommandContext(ctx, "git", "rev-list", "-1", backportBranch).Output(); err == nil { - fmt.Printf("* Branch %s already exists. Checking it out...\n", backportBranch) - return exec.CommandContext(ctx, "git", "checkout", "-f", backportBranch).Run() - } + fmt.Printf("* `git branch -D %s`\n", backportBranch) + _ = exec.CommandContext(ctx, "git", "branch", "-D", backportBranch).Run() fmt.Printf("* `git checkout -b %s %s`\n", backportBranch, releaseBranch) return exec.CommandContext(ctx, "git", "checkout", "-b", backportBranch, releaseBranch).Run() @@ -317,7 +203,6 @@ func fetchRemoteAndMain(ctx context.Context, remote, releaseBranch string) error fmt.Println(string(out)) return fmt.Errorf("unable to fetch %s from %s: %w", "main", remote, err) } - fmt.Println(string(out)) fmt.Printf("* `git fetch %s %s`\n", remote, releaseBranch) out, err = exec.CommandContext(ctx, "git", "fetch", remote, releaseBranch).Output() @@ -325,108 +210,10 @@ func fetchRemoteAndMain(ctx context.Context, remote, releaseBranch string) error fmt.Println(string(out)) return fmt.Errorf("unable to fetch %s from %s: %w", releaseBranch, remote, err) } - fmt.Println(string(out)) return nil } -func determineRemote(ctx context.Context, forkUser string) (string, string, error) { - out, err := exec.CommandContext(ctx, "git", "remote", "-v").Output() - if err != nil { - fmt.Fprintf(os.Stderr, "Unable to list git remotes:\n%s\n", string(out)) - return "", "", fmt.Errorf("unable to determine forked remote: %w", err) - } - lines := strings.Split(string(out), "\n") - for _, line := range lines { - fields := strings.Split(line, "\t") - name, remote := fields[0], fields[1] - // only look at pushers - if !strings.HasSuffix(remote, " (push)") { - continue - } - // only look at github.com pushes - if !strings.Contains(remote, "github.com") { - continue - } - // ignore go-gitea/gitea - if strings.Contains(remote, "go-gitea/gitea") { - continue - } - if !strings.Contains(remote, forkUser) { - continue - } - if strings.HasPrefix(remote, "git@github.com:") { - forkUser = strings.TrimPrefix(remote, "git@github.com:") - } else if strings.HasPrefix(remote, "https://github.com/") { - forkUser = strings.TrimPrefix(remote, "https://github.com/") - } else if strings.HasPrefix(remote, "https://www.github.com/") { - forkUser = strings.TrimPrefix(remote, "https://www.github.com/") - } else if forkUser == "" { - return "", "", fmt.Errorf("unable to extract forkUser from remote %s: %s", name, remote) - } - idx := strings.Index(forkUser, "/") - if idx >= 0 { - forkUser = forkUser[:idx] - } - return name, forkUser, nil - } - return "", "", fmt.Errorf("unable to find appropriate remote in:\n%s", string(out)) -} - -func readCurrentBranch(ctx context.Context) (pr, version string, err error) { - out, err := exec.CommandContext(ctx, "git", "branch", "--show-current").Output() - if err != nil { - fmt.Fprintf(os.Stderr, "Unable to read current git branch:\n%s\n", string(out)) - return "", "", fmt.Errorf("unable to read current git branch: %w", err) - } - parts := strings.Split(strings.TrimSpace(string(out)), "-") - - if len(parts) != 3 || parts[0] != "backport" { - fmt.Fprintf(os.Stderr, "Unable to continue from git branch:\n%s\n", string(out)) - return "", "", fmt.Errorf("unable to continue from git branch:\n%s", string(out)) - } - - return parts[1], parts[2], nil -} - -func readVersion() string { - bs, err := os.ReadFile("docs/config.yaml") - if err != nil { - if err == os.ErrNotExist { - log.Println("`docs/config.yaml` not present") - return "" - } - fmt.Fprintf(os.Stderr, "Unable to read `docs/config.yaml`: %v\n", err) - return "" - } - - type params struct { - Version string - } - type docConfig struct { - Params params - } - dc := &docConfig{} - if err := yaml.Unmarshal(bs, dc); err != nil { - fmt.Fprintf(os.Stderr, "Unable to read `docs/config.yaml`: %v\n", err) - return "" - } - - if dc.Params.Version == "" { - fmt.Fprintf(os.Stderr, "No version in `docs/config.yaml`") - return "" - } - - version := dc.Params.Version - if version[0] != 'v' { - version = "v" + version - } - - split := strings.SplitN(version, ".", 3) - - return strings.Join(split[:2], ".") -} - func determineSHAforPR(ctx context.Context, prStr string) (string, error) { prNum, err := strconv.Atoi(prStr) if err != nil { From 43632d9d34dd8e7f28cac86cd619d5d0049e3d28 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 9 Oct 2023 14:48:51 +0800 Subject: [PATCH 20/45] Improve dropdown's behavior when there is a search input in menu (#27526) Follow #27225 The change in #27225 is not ideal, this should be the complete fix: support the layout which Fomantic doesn't support. --- web_src/js/modules/aria/dropdown.js | 9 +++++++++ web_src/js/modules/fomantic.js | 3 --- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/web_src/js/modules/aria/dropdown.js b/web_src/js/modules/aria/dropdown.js index b1ff57ab85..c053256dd5 100644 --- a/web_src/js/modules/aria/dropdown.js +++ b/web_src/js/modules/aria/dropdown.js @@ -57,6 +57,15 @@ function updateSelectionLabel($label) { function delegateOne($dropdown) { const dropdownCall = fomanticDropdownFn.bind($dropdown); + // If there is a "search input" in the "menu", Fomantic will only "focus the input" but not "toggle the menu" when the "dropdown icon" is clicked. + // Actually, Fomantic UI doesn't support such layout/usage. It needs to patch the "focusSearch" / "blurSearch" functions to make sure it toggles the menu. + const oldFocusSearch = dropdownCall('internal', 'focusSearch'); + const oldBlurSearch = dropdownCall('internal', 'blurSearch'); + // * If the "dropdown icon" is clicked, Fomantic calls "focusSearch", so show the menu + dropdownCall('internal', 'focusSearch', function () { dropdownCall('show'); oldFocusSearch.call(this) }); + // * If the "dropdown icon" is clicked again when the menu is visible, Fomantic calls "blurSearch", so hide the menu + dropdownCall('internal', 'blurSearch', function () { oldBlurSearch.call(this); dropdownCall('hide') }); + // the "template" functions are used for dynamic creation (eg: AJAX) const dropdownTemplates = {...dropdownCall('setting', 'templates'), t: performance.now()}; const dropdownTemplatesMenuOld = dropdownTemplates.menu; diff --git a/web_src/js/modules/fomantic.js b/web_src/js/modules/fomantic.js index 9b52a5d429..da693e9a93 100644 --- a/web_src/js/modules/fomantic.js +++ b/web_src/js/modules/fomantic.js @@ -16,9 +16,6 @@ export function initGiteaFomantic() { $.fn.dropdown.settings.fullTextSearch = 'exact'; // Do not use "cursor: pointer" for dropdown labels $.fn.dropdown.settings.className.label += ' gt-cursor-default'; - // The default selector has a bug: if there is a "search input" in the "menu", Fomantic will only "focus the input" but not "toggle the menu" when the "dropdown icon" is clicked. - // Actually, the "search input in menu" shouldn't be considered as the dropdown's input - $.fn.dropdown.settings.selector.search = '> input.search, :not(.menu) > .search > input, :not(.menu) input.search'; // Always use Gitea's SVG icons $.fn.dropdown.settings.templates.label = function(_value, text, preserveHTML, className) { const escape = $.fn.dropdown.settings.templates.escape; From d1527dac3d1e68caf5a6f54c08144e28256e5c47 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 9 Oct 2023 15:19:23 +0800 Subject: [PATCH 21/45] Improve file history UI and fix URL escaping bug (#27531) Follow #27354 Major changes: 1. The `right aligned` in `` is a no-op because it doesn't have any content 2. The `gt-df` in `` was wrong, it causes UI misalignment, a table cell shouldn't be "flex" 3. Use `gt-py-0` for `gt-pt-0 gt-pb-0` 4. Simplify the layout for buttons, because the `text right aligned` is widely used and good enough, it doesn't make sense to introduce the `
` 5. Escape the `$.FileName` correctly Before: ![image](https://github.com/go-gitea/gitea/assets/2114189/eb2ced3f-1dad-4149-9ed2-aee4c0663621) After: ![image](https://github.com/go-gitea/gitea/assets/2114189/08244b61-416b-4279-b495-029bc0a96f67) --- templates/repo/commits_list.tmpl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index 6793a81bff..d071fb90a1 100644 --- a/templates/repo/commits_list.tmpl +++ b/templates/repo/commits_list.tmpl @@ -6,7 +6,7 @@ SHA1 {{ctx.Locale.Tr "repo.commits.message"}} {{ctx.Locale.Tr "repo.commits.date"}} - + @@ -25,7 +25,7 @@ {{$userName}} {{end}} - + {{$class := "ui sha label"}} {{if .Signature}} {{$class = (print $class " isSigned")}} @@ -76,11 +76,11 @@ {{else}} {{TimeSince .Author.When ctx.Locale}} {{end}} - -
- - {{if $.FileName}}{{svg "octicon-file-code"}}{{end}} -
+ + + {{if $.FileName}} + {{svg "octicon-file-code"}} + {{end}} {{end}} From 65eea1d53696badfb1ef376e5268dbae942089b6 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Mon, 9 Oct 2023 06:12:19 -0400 Subject: [PATCH 22/45] switch to using official AWS step in release nightly (#27532) `jakejarvis/s3-sync-action@master` is out of date, and using official actions is always recommended --- .github/workflows/release-nightly.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release-nightly.yml b/.github/workflows/release-nightly.yml index 1b467e644d..09198c3161 100644 --- a/.github/workflows/release-nightly.yml +++ b/.github/workflows/release-nightly.yml @@ -48,15 +48,15 @@ jobs: REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//') echo "Cleaned name is ${REF_NAME}" echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT" + - name: configure aws + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-region: ${{ secrets.AWS_REGION }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - name: upload binaries to s3 - uses: jakejarvis/s3-sync-action@master - env: - AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_REGION: ${{ secrets.AWS_REGION }} - SOURCE_DIR: dist/release - DEST_DIR: gitea/${{ steps.clean_name.outputs.branch }} + run: | + aws s3 sync dist/release s3://${{ secrets.AWS_S3_BUCKET }}/gitea/${{ steps.clean_name.outputs.branch }} --no-progress nightly-docker-rootful: runs-on: ubuntu-latest steps: From 5283ce9650b1ada6b4bd38212ca44ba77297a31b Mon Sep 17 00:00:00 2001 From: Michael Santos Date: Mon, 9 Oct 2023 07:22:12 -0400 Subject: [PATCH 23/45] api: GetPullRequestCommits: return file list (#27483) Fixes https://github.com/go-gitea/gitea/issues/27481 ---- Co-authored-by: silverwind Co-authored-by: wxiaoguang --- routers/api/v1/repo/notes.go | 18 ++++++++++++++- routers/api/v1/repo/pull.go | 18 ++++++++++++++- templates/swagger/v1_json.tmpl | 24 ++++++++++++++++++++ tests/integration/api_pull_commits_test.go | 5 ++++ tests/integration/api_repo_git_notes_test.go | 2 ++ 5 files changed, 65 insertions(+), 2 deletions(-) diff --git a/routers/api/v1/repo/notes.go b/routers/api/v1/repo/notes.go index 1bd66101f0..0b259703de 100644 --- a/routers/api/v1/repo/notes.go +++ b/routers/api/v1/repo/notes.go @@ -36,6 +36,14 @@ func GetNote(ctx *context.APIContext) { // description: a git ref or commit sha // type: string // required: true + // - name: verification + // in: query + // description: include verification for every commit (disable for speedup, default 'true') + // type: boolean + // - name: files + // in: query + // description: include a list of affected files for every commit (disable for speedup, default 'true') + // type: boolean // responses: // "200": // "$ref": "#/responses/Note" @@ -78,7 +86,15 @@ func getNote(ctx *context.APIContext, identifier string) { return } - cmt, err := convert.ToCommit(ctx, ctx.Repo.Repository, ctx.Repo.GitRepo, note.Commit, nil, convert.ToCommitOptions{Stat: true}) + verification := ctx.FormString("verification") == "" || ctx.FormBool("verification") + files := ctx.FormString("files") == "" || ctx.FormBool("files") + + cmt, err := convert.ToCommit(ctx, ctx.Repo.Repository, ctx.Repo.GitRepo, note.Commit, nil, + convert.ToCommitOptions{ + Stat: true, + Verification: verification, + Files: files, + }) if err != nil { ctx.Error(http.StatusInternalServerError, "ToCommit", err) return diff --git a/routers/api/v1/repo/pull.go b/routers/api/v1/repo/pull.go index 586f3385b1..6fcc5267cf 100644 --- a/routers/api/v1/repo/pull.go +++ b/routers/api/v1/repo/pull.go @@ -1275,6 +1275,14 @@ func GetPullRequestCommits(ctx *context.APIContext) { // in: query // description: page size of results // type: integer + // - name: verification + // in: query + // description: include verification for every commit (disable for speedup, default 'true') + // type: boolean + // - name: files + // in: query + // description: include a list of affected files for every commit (disable for speedup, default 'true') + // type: boolean // responses: // "200": // "$ref": "#/responses/CommitList" @@ -1328,9 +1336,17 @@ func GetPullRequestCommits(ctx *context.APIContext) { end = totalNumberOfCommits } + verification := ctx.FormString("verification") == "" || ctx.FormBool("verification") + files := ctx.FormString("files") == "" || ctx.FormBool("files") + apiCommits := make([]*api.Commit, 0, end-start) for i := start; i < end; i++ { - apiCommit, err := convert.ToCommit(ctx, ctx.Repo.Repository, baseGitRepo, commits[i], userCache, convert.ToCommitOptions{Stat: true}) + apiCommit, err := convert.ToCommit(ctx, ctx.Repo.Repository, baseGitRepo, commits[i], userCache, + convert.ToCommitOptions{ + Stat: true, + Verification: verification, + Files: files, + }) if err != nil { ctx.ServerError("toCommit", err) return diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index abe579ac82..2389ec3bee 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -5239,6 +5239,18 @@ "name": "sha", "in": "path", "required": true + }, + { + "type": "boolean", + "description": "include verification for every commit (disable for speedup, default 'true')", + "name": "verification", + "in": "query" + }, + { + "type": "boolean", + "description": "include a list of affected files for every commit (disable for speedup, default 'true')", + "name": "files", + "in": "query" } ], "responses": { @@ -10521,6 +10533,18 @@ "description": "page size of results", "name": "limit", "in": "query" + }, + { + "type": "boolean", + "description": "include verification for every commit (disable for speedup, default 'true')", + "name": "verification", + "in": "query" + }, + { + "type": "boolean", + "description": "include a list of affected files for every commit (disable for speedup, default 'true')", + "name": "files", + "in": "query" } ], "responses": { diff --git a/tests/integration/api_pull_commits_test.go b/tests/integration/api_pull_commits_test.go index 0bcfb90684..ad0cb0329c 100644 --- a/tests/integration/api_pull_commits_test.go +++ b/tests/integration/api_pull_commits_test.go @@ -35,6 +35,11 @@ func TestAPIPullCommits(t *testing.T) { assert.Equal(t, "5f22f7d0d95d614d25a5b68592adb345a4b5c7fd", commits[0].SHA) assert.Equal(t, "4a357436d925b5c974181ff12a994538ddc5a269", commits[1].SHA) + + assert.NotEmpty(t, commits[0].Files) + assert.NotEmpty(t, commits[1].Files) + assert.NotNil(t, commits[0].RepoCommit.Verification) + assert.NotNil(t, commits[1].RepoCommit.Verification) } // TODO add tests for already merged PR and closed PR diff --git a/tests/integration/api_repo_git_notes_test.go b/tests/integration/api_repo_git_notes_test.go index 30846f235f..a7327d9327 100644 --- a/tests/integration/api_repo_git_notes_test.go +++ b/tests/integration/api_repo_git_notes_test.go @@ -37,5 +37,7 @@ func TestAPIReposGitNotes(t *testing.T) { var apiData api.Note DecodeJSON(t, resp, &apiData) assert.Equal(t, "This is a test note\n", apiData.Message) + assert.NotEmpty(t, apiData.Commit.Files) + assert.NotNil(t, apiData.Commit.RepoCommit.Verification) }) } From 28ead9ea62de9640b034b8d00c57b88a85a5665b Mon Sep 17 00:00:00 2001 From: Nanguan Lin <70063547+lng2020@users.noreply.github.com> Date: Mon, 9 Oct 2023 21:20:16 +0800 Subject: [PATCH 24/45] Improve docs about register/run as a service (#27461) As title --- .../run-as-service-in-ubuntu.en-us.md | 10 +++++----- .../installation/windows-service.en-us.md | 17 +++++++++-------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/docs/content/installation/run-as-service-in-ubuntu.en-us.md b/docs/content/installation/run-as-service-in-ubuntu.en-us.md index ab862b373f..4e169d6bcc 100644 --- a/docs/content/installation/run-as-service-in-ubuntu.en-us.md +++ b/docs/content/installation/run-as-service-in-ubuntu.en-us.md @@ -1,6 +1,6 @@ --- date: "2017-07-21T12:00:00+02:00" -title: "Run as service in Linux" +title: "Run as a Linux service" slug: "linux-service" sidebar_position: 40 toc: false @@ -15,11 +15,11 @@ menu: identifier: "linux-service" --- -### Run Gitea as Linux service +# Run as a Linux service -You can run Gitea as service, using either systemd or supervisor. The steps below tested on Ubuntu 16.04, but those should work on any Linux distributions (with little modification). +You can run Gitea as a Linux service, using either systemd or supervisor. The steps below tested on Ubuntu 16.04, but those should work on any Linux distributions (with little modification). -#### Using systemd +## Using systemd Copy the sample [gitea.service](https://github.com/go-gitea/gitea/blob/main/contrib/systemd/gitea.service) to `/etc/systemd/system/gitea.service`, then edit the file with your favorite editor. @@ -41,7 +41,7 @@ If you have systemd version 220 or later, you can enable and immediately start G sudo systemctl enable gitea --now ``` -#### Using supervisor +## Using supervisor Install supervisor by running below command in terminal: diff --git a/docs/content/installation/windows-service.en-us.md b/docs/content/installation/windows-service.en-us.md index 90332b7c69..6c7d372549 100644 --- a/docs/content/installation/windows-service.en-us.md +++ b/docs/content/installation/windows-service.en-us.md @@ -1,6 +1,6 @@ --- date: "2016-12-21T15:00:00-02:00" -title: "Register as a Windows Service" +title: "Register as a Windows service" slug: "windows-service" sidebar_position: 50 toc: false @@ -14,8 +14,9 @@ menu: sidebar_position: 50 identifier: "windows-service" --- +# Register as a Windows service -# Prerequisites +## Prerequisites The following changes are made in C:\gitea\custom\conf\app.ini: @@ -27,7 +28,7 @@ Sets Gitea to run as the local system user. COMPUTERNAME is whatever the response is from `echo %COMPUTERNAME%` on the command line. If the response is `USER-PC` then `RUN_USER = USER-PC$` -## Use absolute paths +### Use absolute paths If you use SQLite3, change the `PATH` to include the full path: @@ -36,7 +37,7 @@ If you use SQLite3, change the `PATH` to include the full path: PATH = c:/gitea/data/gitea.db ``` -# Register as a Windows Service +## Register Gitea To register Gitea as a Windows service, open a command prompt (cmd) as an Administrator, then run the following command: @@ -51,7 +52,7 @@ Open "Windows Services", search for the service named "gitea", right-click it an "Run". If everything is OK, Gitea will be reachable on `http://localhost:3000` (or the port that was configured). -## Service startup type +### Service startup type It was observed that on loaded systems during boot Gitea service may fail to start with timeout records in Windows Event Log. In that case change startup type to `Automatic-Delayed`. This can be done during service creation, or by running config command @@ -60,7 +61,7 @@ In that case change startup type to `Automatic-Delayed`. This can be done during sc.exe config gitea start= delayed-auto ``` -## Adding startup dependencies +### Adding startup dependencies To add a startup dependency to the Gitea Windows service (eg Mysql, Mariadb), as an Administrator, then run the following command: @@ -70,9 +71,9 @@ sc.exe config gitea depend= mariadb This will ensure that when the Windows machine restarts, the automatic starting of Gitea is postponed until the database is ready and thus mitigate failed startups. -## Unregister as a service +## Unregister Gitea -To unregister Gitea as a service, open a command prompt (cmd) as an Administrator and run: +To unregister Gitea as a Windows service, open a command prompt (cmd) as an Administrator and run: ``` sc.exe delete gitea From e2e0280108cd0cfa4aaa7a875b2c81f17b1352e1 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Tue, 10 Oct 2023 01:10:37 +0800 Subject: [PATCH 25/45] Fix `environment-to-ini` inherited key bug (#27543) Fix #27541 The INI package has a quirk: by default, the keys are inherited. When maintaining the keys, the newly added sub key should not be affected by the parent key. --- modules/setting/config_env.go | 3 ++- modules/setting/config_env_test.go | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/modules/setting/config_env.go b/modules/setting/config_env.go index b30e44de30..242f40914a 100644 --- a/modules/setting/config_env.go +++ b/modules/setting/config_env.go @@ -149,8 +149,9 @@ func EnvironmentToConfig(cfg ConfigProvider, envs []string) (changed bool) { continue } } - key := section.Key(keyName) + key := ConfigSectionKey(section, keyName) if key == nil { + changed = true key, err = section.NewKey(keyName, keyValue) if err != nil { log.Error("Error creating key: %s in section: %s with value: %s : %v", keyName, sectionName, keyValue, err) diff --git a/modules/setting/config_env_test.go b/modules/setting/config_env_test.go index e14d5ecb41..7d07c479a1 100644 --- a/modules/setting/config_env_test.go +++ b/modules/setting/config_env_test.go @@ -115,3 +115,29 @@ key = old EnvironmentToConfig(cfg, []string{"GITEA__sec__key__FILE=" + tmpFile}) assert.Equal(t, "value-from-file\n", cfg.Section("sec").Key("key").String()) } + +func TestEnvironmentToConfigSubSecKey(t *testing.T) { + // the INI package has a quirk: by default, the keys are inherited. + // when maintaining the keys, the newly added sub key should not be affected by the parent key. + cfg, err := NewConfigProviderFromData(` +[sec] +key = some +`) + assert.NoError(t, err) + + changed := EnvironmentToConfig(cfg, []string{"GITEA__sec_0X2E_sub__key=some"}) + assert.True(t, changed) + + tmpFile := t.TempDir() + "/test-sub-sec-key.ini" + defer os.Remove(tmpFile) + err = cfg.SaveTo(tmpFile) + assert.NoError(t, err) + bs, err := os.ReadFile(tmpFile) + assert.NoError(t, err) + assert.Equal(t, `[sec] +key = some + +[sec.sub] +key = some +`, string(bs)) +} From ac4ae355429e4f06161a7cfba537a5b105b516f0 Mon Sep 17 00:00:00 2001 From: Kyle D Date: Mon, 9 Oct 2023 19:04:31 -0400 Subject: [PATCH 26/45] Remove max-width and add hide text overflow (#27359) Closes https://github.com/go-gitea/gitea/issues/27358 --- .../repo/issue/view_content/sidebar.tmpl | 24 +++++++++---------- web_src/css/repo.css | 13 ---------- 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index c3ba15390b..4be1f52dd5 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -428,15 +428,15 @@
{{range .BlockingDependencies}}
-
+
#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}} -
+
{{.Repository.OwnerName}}/{{.Repository.Name}}
-
+
{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}} {{svg "octicon-trash" 16}} @@ -446,7 +446,7 @@
{{end}} {{if .BlockingDependenciesNotPermitted}} -
+
{{ctx.Locale.TrN (len .BlockingDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockingDependenciesNotPermitted)}}
{{end}} @@ -460,15 +460,15 @@
{{range .BlockedByDependencies}}
-
+
#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}} -
+
{{.Repository.OwnerName}}/{{.Repository.Name}}
-
+
{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}} {{svg "octicon-trash" 16}} @@ -480,18 +480,18 @@ {{if $.CanCreateIssueDependencies}} {{range .BlockedByDependenciesNotPermitted}}
-
-
+
+
{{svg "octicon-lock" 16}} #{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}
-
+
{{.Repository.OwnerName}}/{{.Repository.Name}}
-
+ {{end}} {{else if .BlockedByDependenciesNotPermitted}} -
+
{{ctx.Locale.TrN (len .BlockedByDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockedByDependenciesNotPermitted)}}
{{end}} diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 8e3448c43a..2ef35ecfdc 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -95,23 +95,10 @@ } .repository .issue-content-right .ui.list .title { - max-width: 200px; overflow: hidden; text-overflow: ellipsis; } -@media (max-width: 1200px) { - .repository .issue-content-right .ui.list .title { - max-width: 150px; - } -} - -@media (max-width: 1000px) { - .repository .issue-content-right .ui.list .title { - max-width: 100px; - } -} - .repository .issue-content-right #deadlineForm input { width: 12.8rem; border-radius: var(--border-radius) 0 0 var(--border-radius); From 3c131307ac44247e65516135c626e437f089ca9f Mon Sep 17 00:00:00 2001 From: Sebastian Grabowski Date: Tue, 10 Oct 2023 02:01:46 +0200 Subject: [PATCH 27/45] Respect SSH.KeygenPath option when calculating ssh key fingerprints (#27536) Fixes #27535 --- models/asymkey/ssh_key_fingerprint.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/asymkey/ssh_key_fingerprint.go b/models/asymkey/ssh_key_fingerprint.go index 8a8d4fce15..2d6af0e3d6 100644 --- a/models/asymkey/ssh_key_fingerprint.go +++ b/models/asymkey/ssh_key_fingerprint.go @@ -81,7 +81,7 @@ func CalcFingerprint(publicKeyContent string) (string, error) { fnName, fp string err error ) - if setting.SSH.StartBuiltinServer { + if len(setting.SSH.KeygenPath) == 0 { fnName = "calcFingerprintNative" fp, err = calcFingerprintNative(publicKeyContent) } else { From 2c7b6c378e73665920056b1b20ecd8fdd78f4045 Mon Sep 17 00:00:00 2001 From: Jason Song Date: Tue, 10 Oct 2023 18:47:49 +0800 Subject: [PATCH 28/45] Increase queue length (#27555) --- custom/conf/app.example.ini | 2 +- docs/content/administration/config-cheat-sheet.en-us.md | 2 +- docs/content/administration/config-cheat-sheet.zh-cn.md | 2 +- modules/queue/manager_test.go | 2 +- modules/setting/queue.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/custom/conf/app.example.ini b/custom/conf/app.example.ini index dca530151b..ed2ff5630b 100644 --- a/custom/conf/app.example.ini +++ b/custom/conf/app.example.ini @@ -1421,7 +1421,7 @@ LEVEL = Info ;DATADIR = queues/ ; Relative paths will be made absolute against `%(APP_DATA_PATH)s`. ;; ;; Default queue length before a channel queue will block -;LENGTH = 100 +;LENGTH = 100000 ;; ;; Batch size to send for batched queues ;BATCH_LENGTH = 20 diff --git a/docs/content/administration/config-cheat-sheet.en-us.md b/docs/content/administration/config-cheat-sheet.en-us.md index 3c864582ce..e730d0207a 100644 --- a/docs/content/administration/config-cheat-sheet.en-us.md +++ b/docs/content/administration/config-cheat-sheet.en-us.md @@ -483,7 +483,7 @@ Configuration at `[queue]` will set defaults for queues with overrides for indiv - `TYPE`: **level**: General queue type, currently support: `level` (uses a LevelDB internally), `channel`, `redis`, `dummy`. Invalid types are treated as `level`. - `DATADIR`: **queues/common**: Base DataDir for storing level queues. `DATADIR` for individual queues can be set in `queue.name` sections. Relative paths will be made absolute against `%(APP_DATA_PATH)s`. -- `LENGTH`: **100**: Maximal queue size before channel queues block +- `LENGTH`: **100000**: Maximal queue size before channel queues block - `BATCH_LENGTH`: **20**: Batch data before passing to the handler - `CONN_STR`: **redis://127.0.0.1:6379/0**: Connection string for the redis queue type. For `redis-cluster` use `redis+cluster://127.0.0.1:6379/0`. Options can be set using query params. Similarly, LevelDB options can also be set using: **leveldb://relative/path?option=value** or **leveldb:///absolute/path?option=value**, and will override `DATADIR` - `QUEUE_NAME`: **_queue**: The suffix for default redis and disk queue name. Individual queues will default to **`name`**`QUEUE_NAME` but can be overridden in the specific `queue.name` section. diff --git a/docs/content/administration/config-cheat-sheet.zh-cn.md b/docs/content/administration/config-cheat-sheet.zh-cn.md index 48df750343..47d768b0a2 100644 --- a/docs/content/administration/config-cheat-sheet.zh-cn.md +++ b/docs/content/administration/config-cheat-sheet.zh-cn.md @@ -472,7 +472,7 @@ menu: - `TYPE`:**level**:通用队列类型,当前支持:`level`(在内部使用 LevelDB)、`channel`、`redis`、`dummy`。无效的类型将视为 `level`。 - `DATADIR`:**queues/common**:用于存储 level 队列的基本 DataDir。单独的队列的 `DATADIR` 可以在 `queue.name` 部分进行设置。相对路径将根据 `%(APP_DATA_PATH)s` 变为绝对路径。 -- `LENGTH`:**100**:通道队列阻塞之前的最大队列大小 +- `LENGTH`:**100000**:通道队列阻塞之前的最大队列大小 - `BATCH_LENGTH`:**20**:在传递给处理程序之前批处理数据 - `CONN_STR`:**redis://127.0.0.1:6379/0**:redis 队列类型的连接字符串。对于 `redis-cluster`,使用 `redis+cluster://127.0.0.1:6379/0`。可以使用查询参数来设置选项。类似地,LevelDB 选项也可以使用:**leveldb://relative/path?option=value** 或 **leveldb:///absolute/path?option=value** 进行设置,并将覆盖 `DATADIR`。 - `QUEUE_NAME`:**_queue**:默认的 redis 和磁盘队列名称的后缀。单独的队列将默认为 **`name`**`QUEUE_NAME`,但可以在特定的 `queue.name` 部分中进行覆盖。 diff --git a/modules/queue/manager_test.go b/modules/queue/manager_test.go index 9a5b616b1a..15dd1b4f2f 100644 --- a/modules/queue/manager_test.go +++ b/modules/queue/manager_test.go @@ -46,7 +46,7 @@ CONN_STR = redis:// assert.Equal(t, "default", q.GetName()) assert.Equal(t, "level", q.GetType()) assert.Equal(t, filepath.Join(setting.AppDataPath, "queues/common"), q.baseConfig.DataFullDir) - assert.Equal(t, 100, q.baseConfig.Length) + assert.Equal(t, 100000, q.baseConfig.Length) assert.Equal(t, 20, q.batchLength) assert.Equal(t, "", q.baseConfig.ConnStr) assert.Equal(t, "default_queue", q.baseConfig.QueueFullName) diff --git a/modules/setting/queue.go b/modules/setting/queue.go index fc15bd07ed..251a6c1e30 100644 --- a/modules/setting/queue.go +++ b/modules/setting/queue.go @@ -30,7 +30,7 @@ func GetQueueSettings(rootCfg ConfigProvider, name string) (QueueSettings, error queueSettingsDefault := QueueSettings{ Type: "level", // dummy, channel, level, redis Datadir: "queues/common", // relative to AppDataPath - Length: 100, // queue length before a channel queue will block + Length: 100000, // queue length before a channel queue will block QueueName: "_queue", SetName: "_unique", From 5b6258a0b94737ec3db1ce418d0c933512a71f78 Mon Sep 17 00:00:00 2001 From: Nanguan Lin <70063547+lng2020@users.noreply.github.com> Date: Tue, 10 Oct 2023 21:39:58 +0800 Subject: [PATCH 29/45] Fix the wrong HTTP response status code for duplicate packages (#27480) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix #27470 (hope there is nothing missing 😢 ) --------- Co-authored-by: KN4CK3R --- docs/content/usage/packages/alpine.en-us.md | 1 + docs/content/usage/packages/composer.en-us.md | 4 +++- docs/content/usage/packages/conan.en-us.md | 2 ++ docs/content/usage/packages/conda.en-us.md | 10 ++++++++++ docs/content/usage/packages/cran.en-us.md | 10 ++++++++++ docs/content/usage/packages/debian.en-us.md | 5 +++-- docs/content/usage/packages/go.en-us.md | 2 ++ docs/content/usage/packages/swift.en-us.md | 8 ++++++++ docs/content/usage/packages/vagrant.en-us.md | 10 ++++++++++ routers/api/packages/alpine/alpine.go | 2 +- routers/api/packages/chef/chef.go | 2 +- routers/api/packages/composer/composer.go | 2 +- routers/api/packages/conan/conan.go | 2 +- routers/api/packages/debian/debian.go | 2 +- routers/api/packages/maven/maven.go | 2 +- routers/api/packages/npm/npm.go | 2 +- routers/api/packages/pub/pub.go | 2 +- routers/api/packages/pypi/pypi.go | 2 +- routers/api/packages/rubygems/rubygems.go | 2 +- tests/integration/api_packages_chef_test.go | 2 +- tests/integration/api_packages_composer_test.go | 2 +- tests/integration/api_packages_debian_test.go | 2 +- tests/integration/api_packages_maven_test.go | 4 ++-- tests/integration/api_packages_npm_test.go | 2 +- tests/integration/api_packages_pub_test.go | 2 +- tests/integration/api_packages_pypi_test.go | 4 ++-- tests/integration/api_packages_rubygems_test.go | 2 +- 27 files changed, 69 insertions(+), 23 deletions(-) diff --git a/docs/content/usage/packages/alpine.en-us.md b/docs/content/usage/packages/alpine.en-us.md index 1fcbe84853..00331f3bb1 100644 --- a/docs/content/usage/packages/alpine.en-us.md +++ b/docs/content/usage/packages/alpine.en-us.md @@ -77,6 +77,7 @@ curl --user your_username:your_password_or_token \ ``` If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password. + You cannot publish a file with the same name twice to a package. You must delete the existing package file first. The server responds with the following HTTP Status codes. diff --git a/docs/content/usage/packages/composer.en-us.md b/docs/content/usage/packages/composer.en-us.md index 7fbd77ef5d..60ad52ac2d 100644 --- a/docs/content/usage/packages/composer.en-us.md +++ b/docs/content/usage/packages/composer.en-us.md @@ -25,6 +25,7 @@ To work with the Composer package registry, you can use [Composer](https://getco To publish a Composer package perform a HTTP PUT operation with the package content in the request body. The package content must be the zipped PHP project with the `composer.json` file. + You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first. ``` @@ -64,7 +65,8 @@ The server responds with the following HTTP Status codes. | HTTP Status Code | Meaning | | ----------------- | ------- | | `201 Created` | The package has been published. | -| `400 Bad Request` | The package name and/or version are invalid or a package with the same name and version already exist. | +| `400 Bad Request` | The package is invalid. | +| `409 Conflict` | A package file with the same combination of parameters exists already. | ## Configuring the package registry diff --git a/docs/content/usage/packages/conan.en-us.md b/docs/content/usage/packages/conan.en-us.md index 24c7077a88..505460b319 100644 --- a/docs/content/usage/packages/conan.en-us.md +++ b/docs/content/usage/packages/conan.en-us.md @@ -63,6 +63,8 @@ For example: conan upload --remote=gitea ConanPackage/1.2@gitea/final ``` +You cannot publish a file with the same name twice to a package. You must delete the existing package or file first. + The Gitea Conan package registry has full [revision](https://docs.conan.io/en/latest/versioning/revisions.html) support. ## Install a package diff --git a/docs/content/usage/packages/conda.en-us.md b/docs/content/usage/packages/conda.en-us.md index 5b6f97679c..a256dca51c 100644 --- a/docs/content/usage/packages/conda.en-us.md +++ b/docs/content/usage/packages/conda.en-us.md @@ -63,8 +63,18 @@ curl --user your_username:your_password_or_token \ https://gitea.example.com/api/packages/testuser/conda/package-1.0.conda ``` +If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password. + You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first. +The server responds with the following HTTP Status codes. + +| HTTP Status Code | Meaning | +| ----------------- | ------- | +| `201 Created` | The package has been published. | +| `400 Bad Request` | The package is invalid. | +| `409 Conflict` | A package file with the same combination of parameters exists already. | + ## Install a package To install a package from the package registry, execute one of the following commands: diff --git a/docs/content/usage/packages/cran.en-us.md b/docs/content/usage/packages/cran.en-us.md index 68de425d21..a6b0d31856 100644 --- a/docs/content/usage/packages/cran.en-us.md +++ b/docs/content/usage/packages/cran.en-us.md @@ -68,8 +68,18 @@ curl --user your_username:your_password_or_token \ https://gitea.example.com/api/packages/testuser/cran/bin?platform=windows&rversion=4.2 ``` +If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password. + You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first. +The server responds with the following HTTP Status codes. + +| HTTP Status Code | Meaning | +| ----------------- | ------- | +| `201 Created` | The package has been published. | +| `400 Bad Request` | The package is invalid. | +| `409 Conflict` | A package file with the same combination of parameters exists already. | + ## Install a package To install a R package from the package registry, execute the following command: diff --git a/docs/content/usage/packages/debian.en-us.md b/docs/content/usage/packages/debian.en-us.md index 6bd7475dd6..9ae1dc15c0 100644 --- a/docs/content/usage/packages/debian.en-us.md +++ b/docs/content/usage/packages/debian.en-us.md @@ -77,14 +77,15 @@ curl --user your_username:your_password_or_token \ ``` If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password. -You cannot publish a file with the same name twice to a package. You must delete the existing package version first. + +You cannot publish a package if a package of the same name, version, distribution, component and architecture already exists. You must delete the existing package first. The server responds with the following HTTP Status codes. | HTTP Status Code | Meaning | | ----------------- | ------- | | `201 Created` | The package has been published. | -| `400 Bad Request` | The package name, version, distribution, component or architecture are invalid. | +| `400 Bad Request` | The package is invalid. | | `409 Conflict` | A package file with the same combination of parameters exists already. | ## Delete a package diff --git a/docs/content/usage/packages/go.en-us.md b/docs/content/usage/packages/go.en-us.md index 7c4069248e..ed3c1a87e9 100644 --- a/docs/content/usage/packages/go.en-us.md +++ b/docs/content/usage/packages/go.en-us.md @@ -41,6 +41,8 @@ curl --user your_username:your_password_or_token \ If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password. +You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first. + The server responds with the following HTTP Status codes. | HTTP Status Code | Meaning | diff --git a/docs/content/usage/packages/swift.en-us.md b/docs/content/usage/packages/swift.en-us.md index 1bc271ddae..606fa20b36 100644 --- a/docs/content/usage/packages/swift.en-us.md +++ b/docs/content/usage/packages/swift.en-us.md @@ -67,6 +67,14 @@ curl -X PUT --user {username}:{password} \ You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first. +The server responds with the following HTTP Status codes. + +| HTTP Status Code | Meaning | +| ----------------- | ------- | +| `201 Created` | The package has been published. | +| `400 Bad Request` | The package is invalid. | +| `409 Conflict` | A package file with the same combination of parameters exists already. | + ## Install a package To install a Swift package from the package registry, add it in the `Package.swift` file dependencies list: diff --git a/docs/content/usage/packages/vagrant.en-us.md b/docs/content/usage/packages/vagrant.en-us.md index 93cf5e3e78..baa9c2b83e 100644 --- a/docs/content/usage/packages/vagrant.en-us.md +++ b/docs/content/usage/packages/vagrant.en-us.md @@ -44,8 +44,18 @@ curl --user your_username:your_password_or_token \ https://gitea.example.com/api/packages/testuser/vagrant/test_system/1.0.0/hyperv.box ``` +If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password. + You cannot publish a box if a box of the same name, version and provider already exists. You must delete the existing package first. +The server responds with the following HTTP Status codes. + +| HTTP Status Code | Meaning | +| ----------------- | ------- | +| `201 Created` | The package has been published. | +| `400 Bad Request` | The package is invalid. | +| `409 Conflict` | A package with the same combination of parameters exists already. | + ## Install a package To install a box from the package registry, execute the following command: diff --git a/routers/api/packages/alpine/alpine.go b/routers/api/packages/alpine/alpine.go index c261eee2d2..bb14c5163a 100644 --- a/routers/api/packages/alpine/alpine.go +++ b/routers/api/packages/alpine/alpine.go @@ -164,7 +164,7 @@ func UploadPackageFile(ctx *context.Context) { if err != nil { switch err { case packages_model.ErrDuplicatePackageVersion, packages_model.ErrDuplicatePackageFile: - apiError(ctx, http.StatusBadRequest, err) + apiError(ctx, http.StatusConflict, err) case packages_service.ErrQuotaTotalCount, packages_service.ErrQuotaTypeSize, packages_service.ErrQuotaTotalSize: apiError(ctx, http.StatusForbidden, err) default: diff --git a/routers/api/packages/chef/chef.go b/routers/api/packages/chef/chef.go index a1f5f49bd8..f1e9ae12d8 100644 --- a/routers/api/packages/chef/chef.go +++ b/routers/api/packages/chef/chef.go @@ -310,7 +310,7 @@ func UploadPackage(ctx *context.Context) { if err != nil { switch err { case packages_model.ErrDuplicatePackageVersion: - apiError(ctx, http.StatusBadRequest, err) + apiError(ctx, http.StatusConflict, err) case packages_service.ErrQuotaTotalCount, packages_service.ErrQuotaTypeSize, packages_service.ErrQuotaTotalSize: apiError(ctx, http.StatusForbidden, err) default: diff --git a/routers/api/packages/composer/composer.go b/routers/api/packages/composer/composer.go index 313631d7d7..0551093cd1 100644 --- a/routers/api/packages/composer/composer.go +++ b/routers/api/packages/composer/composer.go @@ -247,7 +247,7 @@ func UploadPackage(ctx *context.Context) { if err != nil { switch err { case packages_model.ErrDuplicatePackageVersion: - apiError(ctx, http.StatusBadRequest, err) + apiError(ctx, http.StatusConflict, err) case packages_service.ErrQuotaTotalCount, packages_service.ErrQuotaTypeSize, packages_service.ErrQuotaTotalSize: apiError(ctx, http.StatusForbidden, err) default: diff --git a/routers/api/packages/conan/conan.go b/routers/api/packages/conan/conan.go index f440f83b24..4bf13222dc 100644 --- a/routers/api/packages/conan/conan.go +++ b/routers/api/packages/conan/conan.go @@ -415,7 +415,7 @@ func uploadFile(ctx *context.Context, fileFilter container.Set[string], fileKey if err != nil { switch err { case packages_model.ErrDuplicatePackageFile: - apiError(ctx, http.StatusBadRequest, err) + apiError(ctx, http.StatusConflict, err) case packages_service.ErrQuotaTotalCount, packages_service.ErrQuotaTypeSize, packages_service.ErrQuotaTotalSize: apiError(ctx, http.StatusForbidden, err) default: diff --git a/routers/api/packages/debian/debian.go b/routers/api/packages/debian/debian.go index dc7ebab096..379137e87e 100644 --- a/routers/api/packages/debian/debian.go +++ b/routers/api/packages/debian/debian.go @@ -189,7 +189,7 @@ func UploadPackageFile(ctx *context.Context) { if err != nil { switch err { case packages_model.ErrDuplicatePackageVersion, packages_model.ErrDuplicatePackageFile: - apiError(ctx, http.StatusBadRequest, err) + apiError(ctx, http.StatusConflict, err) case packages_service.ErrQuotaTotalCount, packages_service.ErrQuotaTypeSize, packages_service.ErrQuotaTotalSize: apiError(ctx, http.StatusForbidden, err) default: diff --git a/routers/api/packages/maven/maven.go b/routers/api/packages/maven/maven.go index 52e31e8033..0b93382b01 100644 --- a/routers/api/packages/maven/maven.go +++ b/routers/api/packages/maven/maven.go @@ -363,7 +363,7 @@ func UploadPackageFile(ctx *context.Context) { if err != nil { switch err { case packages_model.ErrDuplicatePackageFile: - apiError(ctx, http.StatusBadRequest, err) + apiError(ctx, http.StatusConflict, err) case packages_service.ErrQuotaTotalCount, packages_service.ErrQuotaTypeSize, packages_service.ErrQuotaTotalSize: apiError(ctx, http.StatusForbidden, err) default: diff --git a/routers/api/packages/npm/npm.go b/routers/api/packages/npm/npm.go index dd6b3f148b..170edfbe11 100644 --- a/routers/api/packages/npm/npm.go +++ b/routers/api/packages/npm/npm.go @@ -214,7 +214,7 @@ func UploadPackage(ctx *context.Context) { if err != nil { switch err { case packages_model.ErrDuplicatePackageVersion: - apiError(ctx, http.StatusBadRequest, err) + apiError(ctx, http.StatusConflict, err) case packages_service.ErrQuotaTotalCount, packages_service.ErrQuotaTypeSize, packages_service.ErrQuotaTotalSize: apiError(ctx, http.StatusForbidden, err) default: diff --git a/routers/api/packages/pub/pub.go b/routers/api/packages/pub/pub.go index 8460f861cb..1f605c6c9f 100644 --- a/routers/api/packages/pub/pub.go +++ b/routers/api/packages/pub/pub.go @@ -213,7 +213,7 @@ func UploadPackageFile(ctx *context.Context) { if err != nil { switch err { case packages_model.ErrDuplicatePackageVersion: - apiError(ctx, http.StatusBadRequest, err) + apiError(ctx, http.StatusConflict, err) case packages_service.ErrQuotaTotalCount, packages_service.ErrQuotaTypeSize, packages_service.ErrQuotaTotalSize: apiError(ctx, http.StatusForbidden, err) default: diff --git a/routers/api/packages/pypi/pypi.go b/routers/api/packages/pypi/pypi.go index 8c7f9bbf38..5718b1203b 100644 --- a/routers/api/packages/pypi/pypi.go +++ b/routers/api/packages/pypi/pypi.go @@ -177,7 +177,7 @@ func UploadPackageFile(ctx *context.Context) { if err != nil { switch err { case packages_model.ErrDuplicatePackageFile: - apiError(ctx, http.StatusBadRequest, err) + apiError(ctx, http.StatusConflict, err) case packages_service.ErrQuotaTotalCount, packages_service.ErrQuotaTypeSize, packages_service.ErrQuotaTotalSize: apiError(ctx, http.StatusForbidden, err) default: diff --git a/routers/api/packages/rubygems/rubygems.go b/routers/api/packages/rubygems/rubygems.go index 061fb0871b..01fd4dad66 100644 --- a/routers/api/packages/rubygems/rubygems.go +++ b/routers/api/packages/rubygems/rubygems.go @@ -258,7 +258,7 @@ func UploadPackageFile(ctx *context.Context) { if err != nil { switch err { case packages_model.ErrDuplicatePackageVersion: - apiError(ctx, http.StatusBadRequest, err) + apiError(ctx, http.StatusConflict, err) case packages_service.ErrQuotaTotalCount, packages_service.ErrQuotaTypeSize, packages_service.ErrQuotaTotalSize: apiError(ctx, http.StatusForbidden, err) default: diff --git a/tests/integration/api_packages_chef_test.go b/tests/integration/api_packages_chef_test.go index 4a1fe2607e..7f55a84f09 100644 --- a/tests/integration/api_packages_chef_test.go +++ b/tests/integration/api_packages_chef_test.go @@ -322,7 +322,7 @@ nwIDAQAB assert.Equal(t, fmt.Sprintf("%s.tar.gz", packageVersion), pfs[0].Name) assert.True(t, pfs[0].IsLead) - uploadPackage(t, packageVersion, http.StatusBadRequest) + uploadPackage(t, packageVersion, http.StatusConflict) }) t.Run("Download", func(t *testing.T) { diff --git a/tests/integration/api_packages_composer_test.go b/tests/integration/api_packages_composer_test.go index ac12590561..896462d9a9 100644 --- a/tests/integration/api_packages_composer_test.go +++ b/tests/integration/api_packages_composer_test.go @@ -112,7 +112,7 @@ func TestPackageComposer(t *testing.T) { req = NewRequestWithBody(t, "PUT", uploadURL, bytes.NewReader(content)) req = AddBasicAuthHeader(req, user.Name) - MakeRequest(t, req, http.StatusBadRequest) + MakeRequest(t, req, http.StatusConflict) }) }) diff --git a/tests/integration/api_packages_debian_test.go b/tests/integration/api_packages_debian_test.go index 2d92b93159..f796d617db 100644 --- a/tests/integration/api_packages_debian_test.go +++ b/tests/integration/api_packages_debian_test.go @@ -147,7 +147,7 @@ func TestPackageDebian(t *testing.T) { req = NewRequestWithBody(t, "PUT", uploadURL, createArchive(packageName, packageVersion, architecture)) AddBasicAuthHeader(req, user.Name) - MakeRequest(t, req, http.StatusBadRequest) + MakeRequest(t, req, http.StatusConflict) }) t.Run("Download", func(t *testing.T) { diff --git a/tests/integration/api_packages_maven_test.go b/tests/integration/api_packages_maven_test.go index 81112f305a..c78024563f 100644 --- a/tests/integration/api_packages_maven_test.go +++ b/tests/integration/api_packages_maven_test.go @@ -50,7 +50,7 @@ func TestPackageMaven(t *testing.T) { defer tests.PrintCurrentTest(t)() putFile(t, fmt.Sprintf("/%s/%s", packageVersion, filename), "test", http.StatusCreated) - putFile(t, fmt.Sprintf("/%s/%s", packageVersion, filename), "test", http.StatusBadRequest) + putFile(t, fmt.Sprintf("/%s/%s", packageVersion, filename), "test", http.StatusConflict) putFile(t, "/maven-metadata.xml", "test", http.StatusOK) pvs, err := packages.GetVersionsByPackageType(db.DefaultContext, user.ID, packages.TypeMaven) @@ -78,7 +78,7 @@ func TestPackageMaven(t *testing.T) { t.Run("UploadExists", func(t *testing.T) { defer tests.PrintCurrentTest(t)() - putFile(t, fmt.Sprintf("/%s/%s", packageVersion, filename), "test", http.StatusBadRequest) + putFile(t, fmt.Sprintf("/%s/%s", packageVersion, filename), "test", http.StatusConflict) }) t.Run("Download", func(t *testing.T) { diff --git a/tests/integration/api_packages_npm_test.go b/tests/integration/api_packages_npm_test.go index 433b183c29..bd3bfeeff0 100644 --- a/tests/integration/api_packages_npm_test.go +++ b/tests/integration/api_packages_npm_test.go @@ -121,7 +121,7 @@ func TestPackageNpm(t *testing.T) { req := NewRequestWithBody(t, "PUT", root, strings.NewReader(buildUpload(packageVersion))) req = addTokenAuthHeader(req, token) - MakeRequest(t, req, http.StatusBadRequest) + MakeRequest(t, req, http.StatusConflict) }) t.Run("Download", func(t *testing.T) { diff --git a/tests/integration/api_packages_pub_test.go b/tests/integration/api_packages_pub_test.go index cae280c0ec..6e9d8742f4 100644 --- a/tests/integration/api_packages_pub_test.go +++ b/tests/integration/api_packages_pub_test.go @@ -121,7 +121,7 @@ description: ` + packageDescription assert.NoError(t, err) assert.Equal(t, int64(len(content)), pb.Size) - _ = uploadFile(t, result.URL, content, http.StatusBadRequest) + _ = uploadFile(t, result.URL, content, http.StatusConflict) }) t.Run("Download", func(t *testing.T) { diff --git a/tests/integration/api_packages_pypi_test.go b/tests/integration/api_packages_pypi_test.go index c7c466e730..76013b79c8 100644 --- a/tests/integration/api_packages_pypi_test.go +++ b/tests/integration/api_packages_pypi_test.go @@ -129,8 +129,8 @@ func TestPackagePyPI(t *testing.T) { t.Run("UploadExists", func(t *testing.T) { defer tests.PrintCurrentTest(t)() - uploadFile(t, "test.whl", content, http.StatusBadRequest) - uploadFile(t, "test.tar.gz", content, http.StatusBadRequest) + uploadFile(t, "test.whl", content, http.StatusConflict) + uploadFile(t, "test.tar.gz", content, http.StatusConflict) }) t.Run("Download", func(t *testing.T) { diff --git a/tests/integration/api_packages_rubygems_test.go b/tests/integration/api_packages_rubygems_test.go index 2099357cbb..a3df143209 100644 --- a/tests/integration/api_packages_rubygems_test.go +++ b/tests/integration/api_packages_rubygems_test.go @@ -150,7 +150,7 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA`) t.Run("UploadExists", func(t *testing.T) { defer tests.PrintCurrentTest(t)() - uploadFile(t, http.StatusBadRequest) + uploadFile(t, http.StatusConflict) }) t.Run("Download", func(t *testing.T) { From 7ff1f2527c7121447d88ea03ba8b436ed55813b9 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 10 Oct 2023 22:45:31 +0800 Subject: [PATCH 30/45] Make actions default enabled for newly created repository if global configuraion enabled (#27482) --- custom/conf/app.example.ini | 2 +- docs/content/administration/config-cheat-sheet.en-us.md | 2 +- docs/content/administration/config-cheat-sheet.zh-cn.md | 2 +- models/unit/unit.go | 1 + models/unit/unit_test.go | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/custom/conf/app.example.ini b/custom/conf/app.example.ini index ed2ff5630b..8cd5e6c144 100644 --- a/custom/conf/app.example.ini +++ b/custom/conf/app.example.ini @@ -951,7 +951,7 @@ LEVEL = Info ;; Note: Code and Releases can currently not be deactivated. If you specify default repo units you should still list them for future compatibility. ;; External wiki and issue tracker can't be enabled by default as it requires additional settings. ;; Disabled repo units will not be added to new repositories regardless if it is in the default list. -;DEFAULT_REPO_UNITS = repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects,repo.packages +;DEFAULT_REPO_UNITS = repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects,repo.packages,repo.actions ;; ;; Comma separated list of default forked repo units. ;; The set of allowed values and rules are the same as DEFAULT_REPO_UNITS. diff --git a/docs/content/administration/config-cheat-sheet.en-us.md b/docs/content/administration/config-cheat-sheet.en-us.md index e730d0207a..3fd78d483e 100644 --- a/docs/content/administration/config-cheat-sheet.en-us.md +++ b/docs/content/administration/config-cheat-sheet.en-us.md @@ -102,7 +102,7 @@ In addition, there is _`StaticRootPath`_ which can be set as a built-in at build - `ENABLE_PUSH_CREATE_USER`: **false**: Allow users to push local repositories to Gitea and have them automatically created for a user. - `ENABLE_PUSH_CREATE_ORG`: **false**: Allow users to push local repositories to Gitea and have them automatically created for an org. - `DISABLED_REPO_UNITS`: **_empty_**: Comma separated list of globally disabled repo units. Allowed values: \[repo.issues, repo.ext_issues, repo.pulls, repo.wiki, repo.ext_wiki, repo.projects, repo.packages, repo.actions\] -- `DEFAULT_REPO_UNITS`: **repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects,repo.packages**: Comma separated list of default new repo units. Allowed values: \[repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki, repo.projects, repo.packages, repo.actions\]. Note: Code and Releases can currently not be deactivated. If you specify default repo units you should still list them for future compatibility. External wiki and issue tracker can't be enabled by default as it requires additional settings. Disabled repo units will not be added to new repositories regardless if it is in the default list. +- `DEFAULT_REPO_UNITS`: **repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects,repo.packages,repo.actions**: Comma separated list of default new repo units. Allowed values: \[repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki, repo.projects, repo.packages, repo.actions\]. Note: Code and Releases can currently not be deactivated. If you specify default repo units you should still list them for future compatibility. External wiki and issue tracker can't be enabled by default as it requires additional settings. Disabled repo units will not be added to new repositories regardless if it is in the default list. - `DEFAULT_FORK_REPO_UNITS`: **repo.code,repo.pulls**: Comma separated list of default forked repo units. The set of allowed values and rules is the same as `DEFAULT_REPO_UNITS`. - `PREFIX_ARCHIVE_FILES`: **true**: Prefix archive files by placing them in a directory named after the repository. - `DISABLE_MIGRATIONS`: **false**: Disable migrating feature. diff --git a/docs/content/administration/config-cheat-sheet.zh-cn.md b/docs/content/administration/config-cheat-sheet.zh-cn.md index 47d768b0a2..27f46cd8be 100644 --- a/docs/content/administration/config-cheat-sheet.zh-cn.md +++ b/docs/content/administration/config-cheat-sheet.zh-cn.md @@ -102,7 +102,7 @@ menu: - `ENABLE_PUSH_CREATE_USER`: **false**: 允许用户将本地存储库推送到Gitea,并为用户自动创建它们。 - `ENABLE_PUSH_CREATE_ORG`: **false**: 允许用户将本地存储库推送到Gitea,并为组织自动创建它们。 - `DISABLED_REPO_UNITS`: **_empty_**: 逗号分隔的全局禁用的仓库单元列表。允许的值是:: \[repo.issues, repo.ext_issues, repo.pulls, repo.wiki, repo.ext_wiki, repo.projects, repo.packages, repo.actions\] -- `DEFAULT_REPO_UNITS`: **repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects,repo.packages**: 逗号分隔的默认新仓库单元列表。允许的值是:: \[repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki, repo.projects, repo.packages, repo.actions\]. 注意:目前无法停用代码和发布。如果您指定了默认的仓库单元,您仍应将它们列出以保持未来的兼容性。外部wiki和问题跟踪器不能默认启用,因为它需要额外的设置。禁用的仓库单元将不会添加到新的仓库中,无论它是否在默认列表中。 +- `DEFAULT_REPO_UNITS`: **repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects,repo.packages,repo.actions**: 逗号分隔的默认新仓库单元列表。允许的值是:: \[repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki, repo.projects, repo.packages, repo.actions\]. 注意:目前无法停用代码和发布。如果您指定了默认的仓库单元,您仍应将它们列出以保持未来的兼容性。外部wiki和问题跟踪器不能默认启用,因为它需要额外的设置。禁用的仓库单元将不会添加到新的仓库中,无论它是否在默认列表中。 - `DEFAULT_FORK_REPO_UNITS`: **repo.code,repo.pulls**: 逗号分隔的默认分叉仓库单元列表。允许的值和规则与`DEFAULT_REPO_UNITS`相同。 - `PREFIX_ARCHIVE_FILES`: **true**: 通过将存档文件放置在以仓库命名的目录中来添加前缀。 - `DISABLE_MIGRATIONS`: **false**: 禁用迁移功能。 diff --git a/models/unit/unit.go b/models/unit/unit.go index ca3e7f999d..b216712d37 100644 --- a/models/unit/unit.go +++ b/models/unit/unit.go @@ -91,6 +91,7 @@ var ( TypeWiki, TypeProjects, TypePackages, + TypeActions, } // ForkRepoUnits contains the default unit types for forks diff --git a/models/unit/unit_test.go b/models/unit/unit_test.go index 5c50a106bd..d80d8b118d 100644 --- a/models/unit/unit_test.go +++ b/models/unit/unit_test.go @@ -89,7 +89,7 @@ func TestLoadUnitConfig(t *testing.T) { setting.Repository.DefaultForkRepoUnits = []string{"repo.releases", "repo.releases"} assert.NoError(t, LoadUnitConfig()) assert.Equal(t, []Type{TypeIssues}, DisabledRepoUnits) - assert.ElementsMatch(t, []Type{TypeCode, TypePullRequests, TypeReleases, TypeWiki, TypePackages, TypeProjects}, DefaultRepoUnits) + assert.ElementsMatch(t, []Type{TypeCode, TypePullRequests, TypeReleases, TypeWiki, TypePackages, TypeProjects, TypeActions}, DefaultRepoUnits) assert.Equal(t, []Type{TypeReleases}, DefaultForkRepoUnits) }) } From 5c9fbcca00caaf676abbb475815a2a3a91107f1d Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 10 Oct 2023 23:33:56 +0800 Subject: [PATCH 31/45] Fix attachment download bug (#27486) --- services/auth/auth.go | 12 ++++++++---- services/auth/auth_test.go | 14 +++++++++----- services/auth/basic.go | 2 +- services/auth/oauth2.go | 2 +- services/auth/reverseproxy.go | 2 +- services/convert/attachment.go | 10 +--------- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/services/auth/auth.go b/services/auth/auth.go index 0c8acac61f..713463a3d4 100644 --- a/services/auth/auth.go +++ b/services/auth/auth.go @@ -36,12 +36,16 @@ func isContainerPath(req *http.Request) bool { } var ( - gitRawReleasePathRe = regexp.MustCompile(`^/[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+/(?:(?:git-(?:(?:upload)|(?:receive))-pack$)|(?:info/refs$)|(?:HEAD$)|(?:objects/)|(?:raw/)|(?:releases/download/))`) - lfsPathRe = regexp.MustCompile(`^/[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+/info/lfs/`) + gitRawOrAttachPathRe = regexp.MustCompile(`^/[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+/(?:(?:git-(?:(?:upload)|(?:receive))-pack$)|(?:info/refs$)|(?:HEAD$)|(?:objects/)|(?:raw/)|(?:releases/download/)|(?:attachments/))`) + lfsPathRe = regexp.MustCompile(`^/[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+/info/lfs/`) ) -func isGitRawReleaseOrLFSPath(req *http.Request) bool { - if gitRawReleasePathRe.MatchString(req.URL.Path) { +func isGitRawOrAttachPath(req *http.Request) bool { + return gitRawOrAttachPathRe.MatchString(req.URL.Path) +} + +func isGitRawOrAttachOrLFSPath(req *http.Request) bool { + if isGitRawOrAttachPath(req) { return true } if setting.LFS.StartServer { diff --git a/services/auth/auth_test.go b/services/auth/auth_test.go index f4e3cdf0d3..3adaa28664 100644 --- a/services/auth/auth_test.go +++ b/services/auth/auth_test.go @@ -85,6 +85,10 @@ func Test_isGitRawOrLFSPath(t *testing.T) { "/owner/repo/releases/download/tag/repo.tar.gz", true, }, + { + "/owner/repo/attachments/6d92a9ee-5d8b-4993-97c9-6181bdaa8955", + true, + }, } lfsTests := []string{ "/owner/repo/info/lfs/", @@ -104,11 +108,11 @@ func Test_isGitRawOrLFSPath(t *testing.T) { t.Run(tt.path, func(t *testing.T) { req, _ := http.NewRequest("POST", "http://localhost"+tt.path, nil) setting.LFS.StartServer = false - if got := isGitRawReleaseOrLFSPath(req); got != tt.want { + if got := isGitRawOrAttachOrLFSPath(req); got != tt.want { t.Errorf("isGitOrLFSPath() = %v, want %v", got, tt.want) } setting.LFS.StartServer = true - if got := isGitRawReleaseOrLFSPath(req); got != tt.want { + if got := isGitRawOrAttachOrLFSPath(req); got != tt.want { t.Errorf("isGitOrLFSPath() = %v, want %v", got, tt.want) } }) @@ -117,11 +121,11 @@ func Test_isGitRawOrLFSPath(t *testing.T) { t.Run(tt, func(t *testing.T) { req, _ := http.NewRequest("POST", tt, nil) setting.LFS.StartServer = false - if got := isGitRawReleaseOrLFSPath(req); got != setting.LFS.StartServer { - t.Errorf("isGitOrLFSPath(%q) = %v, want %v, %v", tt, got, setting.LFS.StartServer, gitRawReleasePathRe.MatchString(tt)) + if got := isGitRawOrAttachOrLFSPath(req); got != setting.LFS.StartServer { + t.Errorf("isGitOrLFSPath(%q) = %v, want %v, %v", tt, got, setting.LFS.StartServer, gitRawOrAttachPathRe.MatchString(tt)) } setting.LFS.StartServer = true - if got := isGitRawReleaseOrLFSPath(req); got != setting.LFS.StartServer { + if got := isGitRawOrAttachOrLFSPath(req); got != setting.LFS.StartServer { t.Errorf("isGitOrLFSPath(%q) = %v, want %v", tt, got, setting.LFS.StartServer) } }) diff --git a/services/auth/basic.go b/services/auth/basic.go index bb9eb7a321..6c3fbf595e 100644 --- a/services/auth/basic.go +++ b/services/auth/basic.go @@ -42,7 +42,7 @@ func (b *Basic) Name() string { // Returns nil if header is empty or validation fails. func (b *Basic) Verify(req *http.Request, w http.ResponseWriter, store DataStore, sess SessionStore) (*user_model.User, error) { // Basic authentication should only fire on API, Download or on Git or LFSPaths - if !middleware.IsAPIPath(req) && !isContainerPath(req) && !isAttachmentDownload(req) && !isGitRawReleaseOrLFSPath(req) { + if !middleware.IsAPIPath(req) && !isContainerPath(req) && !isAttachmentDownload(req) && !isGitRawOrAttachOrLFSPath(req) { return nil, nil } diff --git a/services/auth/oauth2.go b/services/auth/oauth2.go index 38b705cc5b..08a2a05539 100644 --- a/services/auth/oauth2.go +++ b/services/auth/oauth2.go @@ -127,7 +127,7 @@ func (o *OAuth2) userIDFromToken(ctx context.Context, tokenSHA string, store Dat func (o *OAuth2) Verify(req *http.Request, w http.ResponseWriter, store DataStore, sess SessionStore) (*user_model.User, error) { // These paths are not API paths, but we still want to check for tokens because they maybe in the API returned URLs if !middleware.IsAPIPath(req) && !isAttachmentDownload(req) && !isAuthenticatedTokenRequest(req) && - !gitRawReleasePathRe.MatchString(req.URL.Path) { + !isGitRawOrAttachPath(req) { return nil, nil } diff --git a/services/auth/reverseproxy.go b/services/auth/reverseproxy.go index ad525f5c95..359c1f2473 100644 --- a/services/auth/reverseproxy.go +++ b/services/auth/reverseproxy.go @@ -117,7 +117,7 @@ func (r *ReverseProxy) Verify(req *http.Request, w http.ResponseWriter, store Da } // Make sure requests to API paths, attachment downloads, git and LFS do not create a new session - if !middleware.IsAPIPath(req) && !isAttachmentDownload(req) && !isGitRawReleaseOrLFSPath(req) { + if !middleware.IsAPIPath(req) && !isAttachmentDownload(req) && !isGitRawOrAttachOrLFSPath(req) { if sess != nil && (sess.Get("uid") == nil || sess.Get("uid").(int64) != user.ID) { handleSignIn(w, req, sess, user) } diff --git a/services/convert/attachment.go b/services/convert/attachment.go index ab36a1c577..4a8f10f7b0 100644 --- a/services/convert/attachment.go +++ b/services/convert/attachment.go @@ -4,10 +4,7 @@ package convert import ( - "strconv" - repo_model "code.gitea.io/gitea/models/repo" - "code.gitea.io/gitea/modules/setting" api "code.gitea.io/gitea/modules/structs" ) @@ -16,12 +13,7 @@ func WebAssetDownloadURL(repo *repo_model.Repository, attach *repo_model.Attachm } func APIAssetDownloadURL(repo *repo_model.Repository, attach *repo_model.Attachment) string { - if attach.CustomDownloadURL != "" { - return attach.CustomDownloadURL - } - - // /repos/{owner}/{repo}/releases/{id}/assets/{attachment_id} - return setting.AppURL + "api/repos/" + repo.FullName() + "/releases/" + strconv.FormatInt(attach.ReleaseID, 10) + "/assets/" + strconv.FormatInt(attach.ID, 10) + return attach.DownloadURL() } // ToAttachment converts models.Attachment to api.Attachment for API usage From 50166d1f7c6df41c79561b094e29c9698c0000d5 Mon Sep 17 00:00:00 2001 From: GiteaBot Date: Wed, 11 Oct 2023 00:22:56 +0000 Subject: [PATCH 32/45] [skip ci] Updated translations via Crowdin --- options/locale/locale_de-DE.ini | 165 ++++++++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) diff --git a/options/locale/locale_de-DE.ini b/options/locale/locale_de-DE.ini index c312c4728c..4f6a5cb961 100644 --- a/options/locale/locale_de-DE.ini +++ b/options/locale/locale_de-DE.ini @@ -97,6 +97,7 @@ locked=Gesperrt copy=Kopieren copy_url=URL kopieren +copy_hash=Hash kopieren copy_content=Inhalt kopieren copy_branch=Branchenname kopieren copy_success=Kopiert! @@ -112,6 +113,7 @@ step2=Schritt 2: error=Fehler error404=Die Seite, die Du versuchst aufzurufen, existiert nicht oder Du bist nicht berechtigt, diese anzusehen. +go_back=Zurück never=Niemals unknown=Unbekannt @@ -183,6 +185,7 @@ network_error=Netzwerkfehler [startpage] app_desc=Ein einfacher, selbst gehosteter Git-Service install=Einfach zu installieren +install_desc=Starte einfach
die Anwendung für deine Plattform oder nutze Docker. Es existieren auch paketierte Versionen. platform=Plattformübergreifend platform_desc=Gitea läuft überall, wo Go kompiliert: Windows, macOS, Linux, ARM, etc. Wähle das System, das dir am meisten gefällt! lightweight=Leichtgewicht @@ -371,6 +374,7 @@ reset_password_mail_sent_prompt=Eine Bestätigungs-E-Mail wurde an %s ges active_your_account=Aktiviere dein Konto account_activated=Konto wurde aktiviert prohibit_login=Anmelden verboten +prohibit_login_desc=Die Anmeldung mit diesem Konto ist nicht gestattet. Bitte kontaktiere den Administrator. resent_limit_prompt=Du hast bereits eine Aktivierungs-E-Mail angefordert. Bitte warte 3 Minuten und probiere es dann nochmal. has_unconfirmed_mail=Hallo %s, du hast eine unbestätigte E-Mail-Adresse (%s). Wenn du keine Bestätigungs-E-Mail erhalten hast oder eine neue senden möchtest, klicke bitte auf den folgenden Button. resend_mail=Aktivierungs-E-Mail erneut verschicken @@ -378,8 +382,10 @@ email_not_associate=Diese E-Mail-Adresse ist mit keinem Konto verknüpft. send_reset_mail=Wiederherstellungs-E-Mail senden reset_password=Kontowiederherstellung invalid_code=Dein Bestätigungs-Code ist ungültig oder abgelaufen. +invalid_code_forgot_password=Dein Bestätigungscode ist ungültig oder abgelaufen. Klicke hier, um eine neue Sitzung zu starten. invalid_password=Ihr Passwort stimmt nicht mit dem Passwort überein, das zur Erstellung des Kontos verwendet wurde. reset_password_helper=Konto wiederherstellen +reset_password_wrong_user=Du bist angemeldet als %s, aber der Link zur Kontowiederherstellung ist für %s password_too_short=Das Passwort muss mindestens %d Zeichen lang sein. non_local_account=Benutzer, die nicht von Gitea verwaltet werden können ihre Passwörter nicht über das Web Interface ändern. verify=Verifizieren @@ -404,6 +410,7 @@ openid_connect_title=Mit bestehendem Konto verbinden openid_connect_desc=Die gewählte OpenID-URI ist unbekannt. Ordne sie hier einem neuen Account zu. openid_register_title=Neues Konto einrichten openid_register_desc=Die gewählte OpenID-URI ist unbekannt. Ordne sie hier einem neuen Account zu. +openid_signin_desc=Gib deine OpenID-URI ein, zum Beispiel alice.openid.example.org oder https://openid.example.org/alice. disable_forgot_password_mail=Die Kontowiederherstellung ist deaktiviert, da keine E-Mail eingerichtet ist. Bitte kontaktiere den zuständigen Administrator. disable_forgot_password_mail_admin=Die Kontowiederherstellung ist nur verfügbar, wenn eine E-Mail eingerichtet wurde. Bitte richte eine E-Mail Adresse ein, um die Kontowiederherstellung freizuschalten. email_domain_blacklisted=Du kannst dich nicht mit deiner E-Mail-Adresse registrieren. @@ -413,7 +420,9 @@ authorize_application_created_by=Diese Anwendung wurde von %s erstellt. authorize_application_description=Wenn du diese Anwendung autorisierst, wird sie die Berechtigung erhalten, alle Informationen zu deinem Account zu bearbeiten oder zu lesen. Dies beinhaltet auch private Repositories und Organisationen. authorize_title=`"%s" den Zugriff auf deinen Account gestatten?` authorization_failed=Autorisierung fehlgeschlagen +authorization_failed_desc=Die Autorisierung ist fehlgeschlagen, da wir eine ungültige Anfrage erkannt haben. Bitte kontaktiere den Betreuer der App, die du zu autorisieren versucht hast. sspi_auth_failed=SSPI-Authentifizierung fehlgeschlagen +password_pwned=Das von dir gewählte Passwort befindet sich auf einer List gestohlener Passwörter, die öffentlich verfügbar sind. Bitte versuche es erneut mit einem anderen Passwort und ziehe in Erwägung, auch anderswo deine Passwörter zu ändern. password_pwned_err=Anfrage an HaveIBeenPwned konnte nicht abgeschlossen werden [mail] @@ -428,6 +437,7 @@ activate_account.text_1=Hallo %[1]s, danke für deine Registrierung bei % activate_account.text_2=Bitte klicke innerhalb von %s auf folgenden Link, um dein Konto zu aktivieren: activate_email=Bestätige deine E-Mail-Adresse +activate_email.title=%s, bitte verifiziere deine E-Mail-Adresse activate_email.text=Bitte klicke innerhalb von %s auf folgenden Link, um dein Konto zu aktivieren: register_notify=Willkommen bei Gitea @@ -597,6 +607,7 @@ user_bio=Biografie disabled_public_activity=Dieser Benutzer hat die öffentliche Sichtbarkeit der Aktivität deaktiviert. email_visibility.limited=Ihre E-Mail-Adresse ist für alle authentifizierten Benutzer sichtbar email_visibility.private=Deine E-Mail-Adresse ist nur für Dich und Administratoren sichtbar +show_on_map=Diesen Ort auf einer Karte anzeigen settings=Benutzereinstellungen form.name_reserved=Der Benutzername "%s" ist reserviert. @@ -619,9 +630,13 @@ delete=Konto löschen twofa=Zwei-Faktor-Authentifizierung account_link=Verknüpfte Benutzerkonten organization=Organisationen +uid=UID webauthn=Hardware-Sicherheitsschlüssel public_profile=Öffentliches Profil +biography_placeholder=Erzähle uns ein wenig über Dich selbst! (Du kannst Markdown verwenden) +location_placeholder=Teile Deinen ungefähren Standort mit anderen +profile_desc=Lege fest, wie dein Profil anderen Benutzern angezeigt wird. Deine primäre E-Mail-Adresse wird für Benachrichtigungen, Passwort-Wiederherstellung und webbasierte Git-Operationen verwendet. password_username_disabled=Benutzer, die nicht von Gitea verwaltet werden können ihren Benutzernamen nicht ändern. Bitte kontaktiere deinen Administrator für mehr Details. full_name=Vollständiger Name website=Webseite @@ -633,6 +648,8 @@ update_language_not_found=Sprache "%s" ist nicht verfügbar. update_language_success=Sprache wurde aktualisiert. update_profile_success=Dein Profil wurde aktualisiert. change_username=Dein Benutzername wurde geändert. +change_username_prompt=Hinweis: Das Ändern deines Benutzernamen ändert auch deine Account-URL. +change_username_redirect_prompt=Der alte Benutzername wird auf den neuen Benutzernamen weiterleiten, bis er erneut als Benutzername verwendet wird. continue=Weiter cancel=Abbrechen language=Sprache @@ -657,6 +674,7 @@ comment_type_group_project=Projekt comment_type_group_issue_ref=Issue-Referenz saved_successfully=Die Einstellungen wurden erfolgreich gespeichert. privacy=Datenschutz +keep_activity_private=Aktivität auf der Profilseite ausblenden keep_activity_private_popup=Macht die Aktivität nur für dich und die Administratoren sichtbar lookup_avatar_by_mail=Profilbild anhand der E-Mail-Addresse suchen @@ -666,6 +684,7 @@ choose_new_avatar=Neues Profilbild auswählen update_avatar=Profilbild aktualisieren delete_current_avatar=Aktuelles Profilbild löschen uploaded_avatar_not_a_image=Die hochgeladene Datei ist kein Bild. +uploaded_avatar_is_too_big=Die hochgeladene Dateigröße (%d KiB) überschreitet die maximale Größe (%d KiB). update_avatar_success=Dein Profilbild wurde geändert. update_user_avatar_success=Der Avatar des Benutzers wurde aktualisiert. @@ -681,6 +700,7 @@ emails=E-Mail-Adressen manage_emails=E-Mail-Adressen verwalten manage_themes=Standard-Theme auswählen manage_openid=OpenID-Adressen verwalten +email_desc=Deine primäre E-Mail-Adresse wird für Benachrichtigungen, Passwort-Wiederherstellung und, sofern sie nicht versteckt ist, web-basierte Git-Operationen verwendet. theme_desc=Dies wird dein Standard-Theme auf der Seite sein. primary=Primär activated=Aktiviert @@ -688,6 +708,7 @@ requires_activation=Erfordert Aktivierung primary_email=Als primäre E-Mail-Adresse verwenden activate_email=Aktivierung senden activations_pending=Aktivierung ausstehend +can_not_add_email_activations_pending=Es gibt eine ausstehende Aktivierung, versuche es in ein paar Minuten erneut, wenn du eine neue E-Mail hinzufügen möchtest. delete_email=Löschen email_deletion=E-Mail-Adresse löschen email_deletion_desc=Die E-Mail-Adresse und die damit verbundenen Informationen werden von deinem Konto entfernt. Git-Commits von dieser E-Mail-Addresse bleiben unverändert. Fortfahren? @@ -706,6 +727,7 @@ add_email_success=Die neue E-Mail-Addresse wurde hinzugefügt. email_preference_set_success=E-Mail-Einstellungen wurden erfolgreich aktualisiert. add_openid_success=Die neue OpenID-Adresse wurde hinzugefügt. keep_email_private=E-Mail-Adresse verbergen +keep_email_private_popup=Dies wird Deine E-Mail-Adresse nicht nur in Deinem Profil ausblenden, sondern auch, wenn Du einen Pull Request erstellst oder eine Datei über das Web-Interface bearbeitest. Gepushte Commits werden nicht geändert. openid_desc=Mit OpenID kannst du dich über einen Drittanbieter authentifizieren. manage_ssh_keys=SSH-Schlüssel verwalten @@ -784,7 +806,9 @@ ssh_disabled=SSH ist deaktiviert ssh_signonly=SSH ist derzeit deaktiviert, sodass diese Schlüssel nur zur Commit-Signaturverifizierung verwendet werden. ssh_externally_managed=Dieser SSH-Schlüssel wird extern für diesen Benutzer verwaltet manage_social=Verknüpfte soziale Konten verwalten +social_desc=Diese sozialen Konten können verwendet werden, um sich bei deinem Konto anzumelden. Stelle sicher, dass du sie alle zuordnen kannst. unbind=Trennen +unbind_success=Das soziale Konto wurde erfolgreich entfernt. manage_access_token=Zugriffstokens verwalten generate_new_token=Neuen Token erzeugen @@ -805,6 +829,8 @@ permissions_access_all=Alle (öffentlich, privat und begrenzt) select_permissions=Berechtigungen auswählen permission_no_access=Kein Zugriff permission_read=Gelesen +permission_write=Lesen und Schreiben +access_token_desc=Ausgewählte Token-Berechtigungen beschränken die Authentifizierung auf die entsprechenden API-Routen. Lies die Dokumentation für mehr Informationen. at_least_one_permission=Du musst mindestens eine Berechtigung auswählen, um ein Token zu erstellen permissions_list=Berechtigungen: @@ -816,6 +842,8 @@ remove_oauth2_application_desc=Das Entfernen einer OAuth2-Anwendung wird den Zug remove_oauth2_application_success=Die Anwendung wurde gelöscht. create_oauth2_application=Neue OAuth2 Anwendung erstellen create_oauth2_application_button=Anwendung erstellen +create_oauth2_application_success=Du hast erfolgreich eine neue OAuth2-Anwendung erstellt. +update_oauth2_application_success=Du hast die OAuth2-Anwendung erfolgreich aktualisiert. oauth2_application_name=Name der Anwendung oauth2_confidential_client=Vertraulicher Client. Für Anwendungen aktivieren, die das Geheimnis sicher speichern, z. B. Webanwendungen. Wähle diese Option nicht für native Anwendungen für PCs und Mobilgeräte. oauth2_redirect_uris=URIs für die Weiterleitung. Bitte verwende eine neue Zeile für jede URI. @@ -824,19 +852,25 @@ oauth2_client_id=Client-ID oauth2_client_secret=Client-Secret oauth2_regenerate_secret=Secret neu generieren oauth2_regenerate_secret_hint=Secret verloren? +oauth2_client_secret_hint=Das Secret wird nach dem Verlassen oder Aktualisieren dieser Seite nicht mehr angezeigt. Bitte stelle sicher, dass du es gespeichert hast. oauth2_application_edit=Bearbeiten oauth2_application_create_description=OAuth2 Anwendungen geben deiner Drittanwendung Zugriff auf Benutzeraccounts dieser Gitea-Instanz. +oauth2_application_remove_description=Das Entfernen einer OAuth2-Anwendung hat zur Folge, dass diese nicht mehr auf autorisierte Benutzeraccounts auf dieser Instanz zugreifen kann. Möchtest Du fortfahren? +oauth2_application_locked=Wenn es in der Konfiguration aktiviert ist, registriert Gitea einige OAuth2-Anwendungen beim Starten vor. Um unerwartetes Verhalten zu verhindern, können diese weder bearbeitet noch entfernt werden. Weitere Informationen findest Du in der OAuth2-Dokumentation. authorized_oauth2_applications=Autorisierte OAuth2-Anwendungen +authorized_oauth2_applications_description=Den folgenden Drittanbieter-Apps hast Du Zugriff auf Deinen persönlichen Gitea-Account gewährt. Bitte widerrufe die Autorisierung für Apps, die Du nicht mehr nutzt. revoke_key=Widerrufen revoke_oauth2_grant=Autorisierung widerrufen revoke_oauth2_grant_description=Wenn du die Autorisierung widerrufst, kann die Anwendung nicht mehr auf deine Daten zugreifen. Bist du dir sicher? +revoke_oauth2_grant_success=Zugriff erfolgreich widerrufen. twofa_desc=Zwei-Faktor-Authentifizierung trägt zu einer höheren Accountsicherheit bei. twofa_is_enrolled=Für dein Konto ist die Zwei-Faktor-Authentifizierung eingeschaltet. twofa_not_enrolled=Für dein Konto ist die Zwei-Faktor-Authentifizierung momentan nicht eingeschaltet. twofa_disable=Zwei-Faktor-Authentifizierung deaktivieren twofa_scratch_token_regenerate=Neues Einmalpasswort erstellen +twofa_scratch_token_regenerated=Dein temporärer Token ist jetzt %s. Speichere ihn an einem sicheren Ort, er wird nie wieder angezeigt. twofa_enroll=Zwei-Faktor-Authentifizierung aktivieren twofa_disable_note=Du kannst die Zwei-Faktor-Authentifizierung auch wieder deaktivieren. twofa_disable_desc=Wenn du die Zwei-Faktor-Authentifizierung deaktivierst, wird die Sicherheit deines Kontos verringert. Fortfahren? @@ -863,8 +897,10 @@ remove_account_link=Verknüpften Account entfernen remove_account_link_desc=Wenn du den verknüpften Account entfernst, wirst du darüber nicht mehr auf deinen Gitea-Account zugreifen können. Fortfahren? remove_account_link_success=Der verknüpfte Account wurde entfernt. +hooks.desc=Webhooks hinzufügen, die für alle Repositories, die dir gehören, ausgelöst werden. orgs_none=Du bist kein Mitglied in einer Organisation. +repos_none=Du besitzt keine Repositories. delete_account=Konto löschen delete_prompt=Wenn du fortfährst, wird dein Account permanent gelöscht. Dies KANN NICHT rückgängig gemacht werden. @@ -883,9 +919,12 @@ visibility=Nutzer Sichtbarkeit visibility.public=Öffentlich visibility.public_tooltip=Für alle sichtbar visibility.limited=Begrenzt +visibility.limited_tooltip=Nur für authentifizierte Benutzer sichtbar visibility.private=Privat +visibility.private_tooltip=Sichtbar nur für Mitglieder von Organisationen, denen du beigetreten bist [repo] +new_repo_helper=Ein Repository enthält alle Projektdateien, einschließlich des Änderungsverlaufs. Schon woanders vorhanden? Migriere das Repository. owner=Besitzer owner_helper=Einige Organisationen könnten in der Dropdown-Liste nicht angezeigt werden, da die Anzahl an Repositories begrenzt ist. repo_name=Repository-Name @@ -897,6 +936,7 @@ template_helper=Repository zu einem Template machen template_description=Template-Repositories erlauben es Benutzern, neue Repositories mit den gleichen Verzeichnisstrukturen, Dateien und optionalen Einstellungen zu erstellen. visibility=Sichtbarkeit visibility_description=Nur der Besitzer oder Organisationsmitglieder mit entsprechender Berechtigung, werden in der Lage sein, es zu sehen. +visibility_helper=In privates Repository umwandeln visibility_helper_forced=Auf dieser Gitea-Instanz können nur private Repositories angelegt werden. visibility_fork_helper=(Eine Änderung dieses Wertes wirkt sich auf alle Forks aus) clone_helper=Benötigst du Hilfe beim Klonen? Öffne die Hilfe. @@ -905,6 +945,9 @@ fork_from=Fork von already_forked=Du hast bereits einen Fork von %s erstellt fork_to_different_account=Fork in ein anderes Konto erstellen fork_visibility_helper=Die Sichtbarkeit eines geforkten Repositories kann nicht geändert werden. +fork_branch=Branch, der zum Fork geklont werden soll +all_branches=Alle Branches +fork_no_valid_owners=Dieses Repository kann nicht geforkt werden, da keine gültigen Besitzer vorhanden sind. use_template=Dieses Template verwenden clone_in_vsc=In VS Code klonen download_zip=ZIP herunterladen @@ -933,6 +976,7 @@ trust_model_helper_collaborator_committer=Mitarbeiter+Committer: Vertraue Signat trust_model_helper_default=Standard: Verwende das Standardvertrauensmodell für diese Installation create_repo=Repository erstellen default_branch=Standardbranch +default_branch_label=Standard default_branch_helper=Der default Branch ist der Basisbranch für Pull-Requests und Commits. mirror_prune=Entfernen mirror_prune_desc=Entferne veraltete remote-tracking Referenzen @@ -941,6 +985,8 @@ mirror_interval_invalid=Das Spiegel-Intervall ist ungültig. mirror_sync_on_commit=Synchronisieren, wenn Commits gepusht wurden mirror_address=Klonen via URL mirror_address_desc=Gib alle erforderlichen Anmeldedaten im Abschnitt "Authentifizierung" ein. +mirror_address_url_invalid=Die angegebene URL ist ungültig. Achte darauf, alle URL-Komponenten korrekt zu maskieren. +mirror_address_protocol_invalid=Die angegebene URL ist ungültig. Nur URLs beginnend mit http(s):// oder git:// sind möglich. mirror_lfs=Großdatei-Speicher (LFS) mirror_lfs_desc=Mirroring von LFS-Dateien aktivieren. mirror_lfs_endpoint=LFS-Endpunkt @@ -966,13 +1012,20 @@ delete_preexisting=Vorhandene Dateien löschen delete_preexisting_content=Dateien in %s löschen delete_preexisting_success=Nicht übernommene Dateien in %s gelöscht blame_prior=Blame vor dieser Änderung anzeigen +blame.ignore_revs=Revisionen in .git-blame-ignore-revs werden ignoriert. Klicke hier, um das zu umgehen und die normale Blame-Ansicht zu sehen. +blame.ignore_revs.failed=Fehler beim Ignorieren der Revisionen in .git-blame-ignore-revs. author_search_tooltip=Zeigt maximal 30 Benutzer +tree_path_not_found_commit=Pfad %[1]s existiert nicht in Commit%[2]s +tree_path_not_found_branch=Pfad %[1]s existiert nicht in Branch %[2]s +tree_path_not_found_tag=Pfad %[1]s existiert nicht in Tag %[2]s transfer.accept=Übertragung Akzeptieren transfer.accept_desc=`Übertragung nach "%s"` transfer.reject=Übertragung Ablehnen transfer.reject_desc=Übertragung nach "%s " abbrechen +transfer.no_permission_to_accept=Du hast keine Berechtigung, diesen Transfer anzunehmen. +transfer.no_permission_to_reject=Du hast keine Berechtigung, diesen Transfer abzulehnen. desc.private=Privat desc.public=Öffentlich @@ -993,6 +1046,8 @@ template.issue_labels=Issue Label template.one_item=Es muss mindestens ein Template ausgewählt werden template.invalid=Es muss ein Template-Repository ausgewählt werden +archive.title=Dieses Repository ist archiviert. Du kannst Dateien ansehen und es klonen, kannst aber nicht pushen oder Issues/Pull-Requests öffnen. +archive.title_date=Dieses Repository wurde am %s archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen. archive.issue.nocomment=Dieses Repo ist archiviert. Du kannst Issues nicht kommentieren. archive.pull.nocomment=Dieses Repo ist archiviert. Du kannst Pull-Requests nicht kommentieren. @@ -1009,6 +1064,7 @@ migrate_options_lfs=LFS-Dateien migrieren migrate_options_lfs_endpoint.label=LFS-Endpunkt migrate_options_lfs_endpoint.description=Migration wird versuchen, über den entfernten Git-Server den LFS-Server zu bestimmen. Du kannst auch einen eigenen Endpunkt angeben, wenn die LFS-Dateien woanders gespeichert werden. migrate_options_lfs_endpoint.description.local=Ein lokaler Serverpfad wird ebenfalls unterstützt. +migrate_options_lfs_endpoint.placeholder=Wenn leer gelassen, wird der Endpunkt von der Clone-URL abgeleitet migrate_items=Migrationselemente migrate_items_wiki=Wiki migrate_items_milestones=Meilensteine @@ -1111,6 +1167,10 @@ file_view_rendered=Ansicht rendern file_view_raw=Originalformat anzeigen file_permalink=Permalink file_too_large=Die Datei ist zu groß zum Anzeigen. +invisible_runes_header=`Diese Datei enthält unsichtbare Unicode-Zeichen` +invisible_runes_description=`Diese Datei enthält unsichtbare Unicode-Zeichen, die für Menschen nicht unterscheidbar sind, aber von einem Computer unterschiedlich verarbeitet werden können. Wenn du glaubst, dass das absichtlich so ist, kannst du diese Warnung ignorieren. Benutze den „Escape“-Button, um versteckte Zeichen anzuzeigen.` +ambiguous_runes_header=`Diese Datei enthält mehrdeutige Unicode-Zeichen` +ambiguous_runes_description=`Diese Datei enthält Unicode-Zeichen, die mit anderen Zeichen verwechselt werden können. Wenn du glaubst, dass das absichtlich so ist, kannst du diese Warnung ignorieren. Benutze den „Escape“-Button, um versteckte Zeichen anzuzeigen.` invisible_runes_line=`Diese Zeile enthält unsichtbare Unicode-Zeichen` ambiguous_runes_line=`Diese Zeile enthält mehrdeutige Unicode-Zeichen` ambiguous_character=`%[1]c [U+%04[1]X] kann mit %[2]c [U+%04[2]X] verwechselt werden` @@ -1123,11 +1183,15 @@ video_not_supported_in_browser=Dein Browser unterstützt das HTML5 'video'-Tag n audio_not_supported_in_browser=Dein Browser unterstützt den HTML5 'audio'-Tag nicht. stored_lfs=Gespeichert mit Git LFS symbolic_link=Softlink +executable_file=Ausführbare Datei commit_graph=Commit graph commit_graph.select=Branches auswählen commit_graph.hide_pr_refs=Pull-Requests ausblenden commit_graph.monochrome=Monochrom commit_graph.color=Farbe +commit.contained_in=Dieser Commit ist enthalten in: +commit.contained_in_default_branch=Dieser Commit ist im Standard-Branch enthalten +commit.load_referencing_branches_and_tags=Lade Branches und Tags, die diesen Commit referenzieren blame=Blame download_file=Datei herunterladen normal_view=Normale Ansicht @@ -1220,6 +1284,7 @@ commits.signed_by_untrusted_user=Signiert von nicht vertrauenswürdigen Benutzer commits.signed_by_untrusted_user_unmatched=Signiert von nicht vertrauenswürdigen Benutzern, der nicht mit dem Committer übereinstimmt commits.gpg_key_id=GPG-Schlüssel-ID commits.ssh_key_fingerprint=SSH-Key-Fingerabdruck +commits.view_path=An diesem Punkt im Verlauf anzeigen commit.operations=Operationen commit.revert=Zurücksetzen @@ -1381,6 +1446,7 @@ issues.filter_sort.moststars=Meiste Favoriten issues.filter_sort.feweststars=Wenigste Favoriten issues.filter_sort.mostforks=Meiste Forks issues.filter_sort.fewestforks=Wenigste Forks +issues.keyword_search_unavailable=Zurzeit ist die Stichwort-Suche nicht verfügbar. Bitte wende dich an den Website-Administrator. issues.action_open=Öffnen issues.action_close=Schließen issues.action_label=Label @@ -1429,8 +1495,17 @@ issues.ref_closed_from=`hat dieses Issue %[4]s geschlossen < issues.ref_reopened_from=`hat dieses Issue %[4]s %[2]s wieder geöffnet` issues.ref_from=`von %[1]s` issues.author=Autor +issues.author_helper=Dieser Benutzer ist der Autor. issues.role.owner=Besitzer +issues.role.owner_helper=Dieser Benutzer ist der Besitzer dieses Repositorys. issues.role.member=Mitglied +issues.role.member_helper=Dieser Benutzer ist Mitglied der Organisation, die dieses Repository besitzt. +issues.role.collaborator=Mitarbeiter +issues.role.collaborator_helper=Dieser Benutzer wurde zur Zusammenarbeit am Repository eingeladen. +issues.role.first_time_contributor=Erstmaliger Mitwirkender +issues.role.first_time_contributor_helper=Dies ist der erste Beitrag dieses Benutzers zum Repository. +issues.role.contributor=Mitwirkender +issues.role.contributor_helper=Dieser Benutzer hat schon zuvor zu dem Repository beigetragen. issues.re_request_review=Review erneut anfordern issues.is_stale=Seit diesem Review gab es Änderungen an diesem PR issues.remove_request_review=Review-Anfrage entfernen @@ -1445,6 +1520,9 @@ issues.label_title=Labelname issues.label_description=Labelbeschreibung issues.label_color=Labelfarbe issues.label_exclusive=Exklusiv +issues.label_archive=Label archivieren +issues.label_archived_filter=Archivierte Labels anzeigen +issues.label_archive_tooltip=Archivierte Labels werden bei der Suche nach Label standardmäßig von den Vorschlägen ausgeschlossen. issues.label_exclusive_desc=Nenne das Label Bereich/Element um es gegenseitig ausschließend mit anderen Bereich/ Labels zu machen. issues.label_exclusive_warning=Alle im Konflikt stehenden Labels werden beim Bearbeiten der Labels eines Issues oder eines Pull-Requests entfernt. issues.label_count=%d Label @@ -1499,6 +1577,7 @@ issues.tracking_already_started=`Du hast die Zeiterfassung bereits in %[2]s#%[3]d` @@ -1649,6 +1737,12 @@ pulls.is_empty=Die Änderungen an diesem Branch sind bereits auf dem Zielbranch. pulls.required_status_check_failed=Einige erforderliche Prüfungen waren nicht erfolgreich. pulls.required_status_check_missing=Einige erforderliche Prüfungen fehlen. pulls.required_status_check_administrator=Als Administrator kannst du diesen Pull-Request weiterhin mergen. +pulls.blocked_by_approvals=Dieser Pull-Request hat noch nicht genügend Zustimmungen. %d von %d Zustimmungen erteilt. +pulls.blocked_by_rejection=Dieser Pull-Request hat Änderungen, die von einem offiziellen Reviewer angefragt wurden. +pulls.blocked_by_official_review_requests=Dieser Pull Request hat offizielle Review-Anfragen. +pulls.blocked_by_outdated_branch=Dieser Pull Request ist blockiert, da er veraltet ist. +pulls.blocked_by_changed_protected_files_1=Dieser Pull Request ist blockiert, weil er eine geschützte Datei ändert: +pulls.blocked_by_changed_protected_files_n=Dieser Pull Request ist blockiert, weil er geschützte Dateien ändert: pulls.can_auto_merge_desc=Dieser Pull-Request kann automatisch gemergt werden. pulls.cannot_auto_merge_desc=Dieser Pull-Request kann nicht automatisch gemergt werden, da es Konflikte gibt. pulls.cannot_auto_merge_helper=Bitte manuell mergen, um die Konflikte zu beheben. @@ -1748,11 +1842,21 @@ milestones.edit_success=Meilenstein "%s" wurde aktualisiert. milestones.deletion=Meilenstein löschen milestones.deletion_desc=Das Löschen des Meilensteins entfernt ihn von allen Issues. Fortfahren? milestones.deletion_success=Der Meilenstein wurde gelöscht. +milestones.filter_sort.earliest_due_data=Frühestes Fälligkeitsdatum +milestones.filter_sort.latest_due_date=Spätestes Fälligkeitsdatum milestones.filter_sort.least_complete=Am wenigsten vollständig milestones.filter_sort.most_complete=Vollständigste milestones.filter_sort.most_issues=Meiste Issues milestones.filter_sort.least_issues=Wenigste Issues +signing.will_sign=Dieser Commit wird mit dem Key "%s" signiert werden. +signing.wont_sign.error=Es gab einen Fehler bei der Prüfung, ob der Commit signiert werden kann. +signing.wont_sign.nokey=Es ist kein Schlüssel zum Signieren dieses Commits verfügbar. +signing.wont_sign.never=Commits werden nie signiert. +signing.wont_sign.always=Commits werden immer signiert. +signing.wont_sign.pubkey=Der Commit wird nicht signiert, da du keinen öffentlichen Schlüssel mit deinem Account verknüpft hast. +signing.wont_sign.twofa=Du musst Zwei-Faktor-Authentifizierung aktivieren, damit Commits signiert werden. +signing.wont_sign.not_signed_in=Du bist nicht eingeloggt. ext_wiki=Zugriff auf externes Wiki ext_wiki.desc=Verweis auf externes Wiki. @@ -1882,6 +1986,7 @@ settings.mirror_settings.docs.disabled_push_mirror.info=Push-Mirrors wurden von settings.mirror_settings.docs.no_new_mirrors=Dein Repository spiegelt Änderungen von oder zu einem anderen Repository. Bitte beachte, dass du gerade keine neuen Mirror anlegen kannst. settings.mirror_settings.docs.can_still_use=Obwohl du existierende Mirrors gerade nicht bearbeiten oder neu anlegen kannst, sind bestehende Mirrors weiterhin nutzbar. settings.mirror_settings.docs.pull_mirror_instructions=Um einen Pull-Mirror einzurichten, konsultiere bitte: +settings.mirror_settings.docs.more_information_if_disabled=Hier kannst du mehr über Push- und Pull-Mirrors erfahren: settings.mirror_settings.docs.doc_link_title=Wie spiegele ich Repositories? settings.mirror_settings.docs.pulling_remote_title=Aus einem Remote-Repository pullen settings.mirror_settings.mirrored_repository=Gespiegeltes Repository @@ -1894,6 +1999,8 @@ settings.mirror_settings.push_mirror.remote_url=URL zum Git-Remote-Repository settings.mirror_settings.push_mirror.add=Push-Mirror hinzufügen settings.sync_mirror=Jetzt synchronisieren +settings.pull_mirror_sync_in_progress=Aktuell werden Änderungen von %s gepullt. +settings.push_mirror_sync_in_progress=Aktuell werden Änderungen auf %s gepusht. settings.site=Webseite settings.update_settings=Einstellungen speichern settings.update_mirror_settings=Mirror-Einstellungen aktualisieren @@ -1960,6 +2067,7 @@ settings.transfer.rejected=Repository-Übertragung wurde abgelehnt. settings.transfer.success=Repository-Übertragung war erfolgreich. settings.transfer_abort=Übertragung abbrechen settings.transfer_abort_invalid=Du kannst nur eingeleitete Repository-Übertragung abbrechen. +settings.transfer_abort_success=Die Repository-Übertragung zu %s wurde abgebrochen. settings.transfer_desc=Übertrage dieses Repository auf einen anderen Benutzer oder eine Organisation, in der du Admin-Rechte hast. settings.transfer_form_title=Gib den Repository-Namen zur Bestätigung ein: settings.transfer_in_progress=Es gibt derzeit eine laufende Übertragung. Bitte brich diese ab, wenn du dieses Repository an einen anderen Benutzer übertragen möchtest. @@ -2026,12 +2134,14 @@ settings.webhook_deletion_desc=Das Entfernen eines Webhooks löscht seine Einste settings.webhook_deletion_success=Webhook wurde entfernt. settings.webhook.test_delivery=Senden testen settings.webhook.test_delivery_desc=Teste diesen Webhook mit einem Fake-Event. +settings.webhook.test_delivery_desc_disabled=Um diesen Webhook mit einem Fake-Event zu testen, aktiviere ihn. settings.webhook.request=Anfrage settings.webhook.response=Antwort settings.webhook.headers=Kopfzeilen settings.webhook.payload=Inhalt settings.webhook.body=Inhalt settings.webhook.replay.description=Diesen Webhook wiederholen. +settings.webhook.replay.description_disabled=Um diesen Webhook wiederzugeben, aktiviere ihn. settings.webhook.delivery.success=Ein Event wurde zur Sendungs-Warteschlange hinzugefügt. Es kann ein paar Sekunden dauern, bevor es im Verlauf erscheint. settings.githooks_desc=Git-Hooks werden von Git selbst bereitgestellt. Du kannst die Dateien der unterstützten Hooks in der Liste unten bearbeiten, um eigene Operationen einzubinden. settings.githook_edit_desc=Wenn ein Hook nicht aktiv ist, wird der Standardinhalt benutzt. Lasse den Inhalt leer, um den Hook zu deaktivieren. @@ -2191,6 +2301,7 @@ settings.dismiss_stale_approvals_desc=Wenn neue Commits gepusht werden, die den settings.require_signed_commits=Signierte Commits erforderlich settings.require_signed_commits_desc=Pushes auf diesen Branch ablehnen, wenn Commits nicht signiert oder nicht überprüfbar sind. settings.protect_branch_name_pattern=Muster für geschützte Branchnamen +settings.protect_branch_name_pattern_desc=Geschützte Branch-Namensmuster. Lies die Dokumentation für die Muster-Syntax. Beispiele: main, release/** settings.protect_patterns=Muster settings.protect_protected_file_patterns=Geschützte Dateimuster (durch Semikolon ';' getrennt): settings.protect_protected_file_patterns_desc=Geschützte Dateien dürfen nicht direkt geändert werden, auch wenn der Benutzer Rechte hat, Dateien in diesem Branch hinzuzufügen, zu bearbeiten oder zu löschen. Mehrere Muster können mit Semikolon (';') getrennt werden. Siehe github.com/gobwas/glob Dokumentation zur Mustersyntax. Beispiele: .drone.yml, /docs/**/*.txt. @@ -2229,6 +2340,7 @@ settings.tags.protection.create=Tag schützen settings.tags.protection.none=Es gibt keine geschützten Tags. settings.bot_token=Bot-Token settings.chat_id=Chat-ID +settings.thread_id=Thread-ID settings.matrix.homeserver_url=Homeserver-URL settings.matrix.room_id=Raum-ID settings.matrix.message_type=Nachrichtentyp @@ -2239,6 +2351,8 @@ settings.archive.error=Beim Versuch, das Repository zu archivieren, ist ein Fehl settings.archive.error_ismirror=Du kannst keinen Repo-Mirror archivieren. settings.archive.branchsettings_unavailable=Branch-Einstellungen sind nicht verfügbar wenn das Repo archiviert ist. settings.archive.tagsettings_unavailable=Tag Einstellungen sind nicht verfügbar, wenn das Repo archiviert wurde. +settings.unarchive.button=Archivieren rückgängig machen +settings.unarchive.header=Archivieren dieses Repositories rückgängig machen settings.update_avatar_success=Der Repository-Avatar wurde aktualisiert. settings.lfs=LFS settings.lfs_filelist=LFS-Dateien, die in diesem Repository gespeichert sind @@ -2376,6 +2490,7 @@ release.releases_for=Releases für %s release.tags_for=Tags für %s branch.name=Branchname +branch.search=Branch suchen branch.already_exists=Ein Branch mit dem Namen "%s" existiert bereits. branch.delete_head=Löschen branch.delete=Branch "%s" löschen @@ -2457,6 +2572,7 @@ form.create_org_not_allowed=Du bist nicht berechtigt, eine Organisation zu erste settings=Einstellungen settings.options=Organisation settings.full_name=Vollständiger Name +settings.email=Kontakt-E-Mail-Adresse settings.website=Webseite settings.location=Standort settings.permission=Berechtigungen @@ -2554,6 +2670,7 @@ users=Benutzerkonten organizations=Organisationen repositories=Repositories hooks=Webhooks +integrations=Integrationen authentication=Authentifizierungsquellen emails=Benutzer E-Mails config=Konfiguration @@ -2562,6 +2679,7 @@ monitor=Monitoring first_page=Erste last_page=Letzte total=Gesamt: %d +settings=Administratoreinstellungen dashboard.new_version_hint=Gitea %s ist jetzt verfügbar, deine derzeitige Version ist %s. Weitere Details findest du im Blog. dashboard.statistic=Übersicht @@ -2574,11 +2692,13 @@ dashboard.clean_unbind_oauth=Nicht verbundene OAuth-Verbindungen löschen dashboard.clean_unbind_oauth_success=Alle unverbundene OAuth-Verbindungen wurden gelöscht. dashboard.task.started=Aufgabe gestartet: %[1]s dashboard.task.process=Aufgabe: %[1]s +dashboard.task.cancelled=Aufgabe: %[1]s abgebrochen: %[3]s dashboard.task.error=Fehler in Aufgabe: %[1]s: %[3]s dashboard.task.finished=Aufgabe: %[1]s, gestartet von %[2]s, wurde beendet dashboard.task.unknown=Unbekannte Aufgabe: %[1]s dashboard.cron.started=Cron gestartet: %[1]s dashboard.cron.process=Cron: %[1]s +dashboard.cron.cancelled=Cron: %[1]s abgebrochen: %[3]s dashboard.cron.error=Fehler in Cron: %s: %[3]s dashboard.cron.finished=Cron: %[1]s ist beendet dashboard.delete_inactive_accounts=Alle nicht aktivierten Konten löschen @@ -2649,6 +2769,9 @@ users.full_name=Vollständiger Name users.activated=Aktiviert users.admin=Administrator users.restricted=Eingeschränkt +users.reserved=Reserviert +users.bot=Bot +users.remote=Remote users.2fa=2FA users.repos=Repos users.created=Registriert am @@ -2695,6 +2818,7 @@ users.list_status_filter.is_prohibit_login=Login verbieten users.list_status_filter.not_prohibit_login=Login erlaubt users.list_status_filter.is_2fa_enabled=2FA aktiviert users.list_status_filter.not_2fa_enabled=2FA deaktiviert +users.details=Benutzerdetails emails.email_manage_panel=Benutzer-E-Mail-Verwaltung emails.primary=Primär @@ -2726,10 +2850,12 @@ repos.stars=Favoriten repos.forks=Forks repos.issues=Issues repos.size=Größe +repos.lfs_size=LFS-Größe packages.package_manage_panel=Paketverwaltung packages.total_size=Gesamtgröße: %s packages.unreferenced_size=Nicht referenzierte Größe: %s +packages.cleanup=Veraltete Daten löschen packages.owner=Besitzer packages.creator=Ersteller packages.name=Name @@ -2876,6 +3002,7 @@ config.disable_router_log=Router-Log deaktivieren config.run_user=Ausführen als config.run_mode=Laufzeit-Modus config.git_version=Git-Version +config.app_data_path=App-Datenpfad config.repo_root_path=Repository-Wurzelpfad config.lfs_root_path=LFS-Wurzelpfad config.log_file_root_path=Logdateipfad @@ -3149,6 +3276,7 @@ desc=Repository-Pakete verwalten. empty=Noch keine Pakete vorhanden. empty.documentation=Weitere Informationen zur Paket-Registry findest Du in der Dokumentation. empty.repo=Hast du ein Paket hochgeladen, das hier nicht angezeigt wird? Gehe zu den Paketeinstellungen und verlinke es mit diesem Repo. +registry.documentation=Für weitere Informationen zur %s-Registry, schaue in der Dokumentation nach. filter.type=Typ filter.type.all=Alle filter.no_result=Keine Ergebnisse mit diesen Kriterien gefunden. @@ -3238,6 +3366,8 @@ pub.install=Um das Paket mit Dart zu installieren, führe den folgenden Befehl a pypi.requires=Erfordert Python pypi.install=Nutze folgenden Befehl, um das Paket mit pip zu installieren: rpm.registry=Diese Registry über die Kommandozeile einrichten: +rpm.distros.redhat=auf RedHat-basierten Distributionen +rpm.distros.suse=auf SUSE-basierten Distributionen rpm.install=Nutze folgenden Befehl, um das Paket zu installieren: rubygems.install=Um das Paket mit gem zu installieren, führe den folgenden Befehl aus: rubygems.install2=oder füg es zum Gemfile hinzu: @@ -3314,6 +3444,7 @@ status.waiting=Wartend status.running=Laufend status.success=Erfolg status.failure=Fehler +status.cancelled=Abgebrochen status.skipped=Übersprungen status.blocked=Blockiert @@ -3330,6 +3461,7 @@ runners.labels=Labels runners.last_online=Letzte Online-Zeit runners.runner_title=Runner runners.task_list=Letzte Aufgaben dieses Runners +runners.task_list.no_tasks=Es gibt noch keine Aufgabe. runners.task_list.run=Ausführen runners.task_list.status=Status runners.task_list.repository=Repository @@ -3350,17 +3482,45 @@ runners.status.idle=Inaktiv runners.status.active=Aktiv runners.status.offline=Offline runners.version=Version +runners.reset_registration_token=Registrierungs-Token zurücksetzen runners.reset_registration_token_success=Runner-Registrierungstoken erfolgreich zurückgesetzt runs.all_workflows=Alle Workflows runs.commit=Commit +runs.scheduled=Geplant +runs.pushed_by=gepusht von runs.invalid_workflow_helper=Die Workflow-Konfigurationsdatei ist ungültig. Bitte überprüfe Deine Konfigurationsdatei: %s runs.no_matching_runner_helper=Kein passender Runner: %s +runs.actor=Initiator runs.status=Status +runs.actors_no_select=Alle Initiatoren +runs.status_no_select=Alle Status +runs.no_results=Keine passenden Ergebnisse gefunden. +runs.no_runs=Der Workflow hat noch keine Ausführungen. +workflow.disable=Workflow deaktivieren +workflow.disable_success=Workflow '%s' erfolgreich deaktiviert. +workflow.enable=Workflow aktivieren +workflow.enable_success=Workflow '%s' erfolgreich aktiviert. +workflow.disabled=Workflow ist deaktiviert. need_approval_desc=Um Workflows für den Pull-Request eines Forks auszuführen, ist eine Genehmigung erforderlich. +variables=Variablen +variables.management=Variablenverwaltung +variables.creation=Variable hinzufügen +variables.none=Es gibt noch keine Variablen. +variables.deletion=Variable entfernen +variables.deletion.description=Das Entfernen einer Variable ist dauerhaft und kann nicht rückgängig gemacht werden. Fortfahren? +variables.description=Variablen werden an bestimmte Aktionen übergeben und können nicht anderweitig gelesen werden. +variables.id_not_exist=Variable mit ID %d existiert nicht. +variables.edit=Variable bearbeiten +variables.deletion.failed=Fehler beim Entfernen der Variable. +variables.deletion.success=Die Variable wurde entfernt. +variables.creation.failed=Fehler beim Hinzufügen der Variable. +variables.creation.success=Die Variable „%s“ wurde hinzugefügt. +variables.update.failed=Fehler beim Bearbeiten der Variable. +variables.update.success=Die Variable wurde bearbeitet. [projects] type-1.display_name=Individuelles Projekt @@ -3368,5 +3528,10 @@ type-2.display_name=Repository-Projekt type-3.display_name=Organisationsprojekt [git.filemode] +changed_filemode=%[1]s → %[2]s +directory=Verzeichnis +normal_file=Normale Datei +executable_file=Ausführbare Datei symbolic_link=Softlink +submodule=Submodul From ebe803e514acb4eedc884226be2489ee6b4acd28 Mon Sep 17 00:00:00 2001 From: JakobDev Date: Wed, 11 Oct 2023 06:24:07 +0200 Subject: [PATCH 33/45] Penultimate round of `db.DefaultContext` refactor (#27414) Part of #27065 --------- Co-authored-by: Lunny Xiao --- cmd/admin_auth.go | 4 +- cmd/admin_auth_ldap.go | 22 ++++---- cmd/admin_auth_ldap_test.go | 24 ++++---- cmd/admin_auth_oauth.go | 6 +- cmd/admin_auth_stmp.go | 6 +- models/actions/run_job_list.go | 2 +- models/actions/run_list.go | 4 +- models/actions/schedule_list.go | 4 +- models/actions/schedule_spec_list.go | 4 +- models/activities/statistic.go | 2 +- models/asymkey/ssh_key.go | 56 +++++++++---------- models/asymkey/ssh_key_commit_verification.go | 2 +- models/asymkey/ssh_key_deploy.go | 4 +- models/auth/source.go | 47 ++++++++-------- models/auth/source_test.go | 2 +- models/issues/comment_code.go | 2 +- models/issues/dependency.go | 8 +-- models/issues/dependency_test.go | 8 +-- models/issues/issue_label.go | 18 +++--- models/issues/issue_label_test.go | 3 +- models/issues/issue_lock.go | 14 +++-- models/issues/issue_project.go | 14 ++--- models/issues/issue_search.go | 4 +- models/issues/issue_test.go | 6 +- models/issues/label_test.go | 16 +++--- models/issues/milestone_list.go | 4 +- models/issues/milestone_test.go | 8 +-- models/issues/pull.go | 42 +++++++------- models/issues/pull_test.go | 12 ++-- models/repo.go | 10 ++-- models/repo/avatar.go | 4 +- models/repo/language_stats.go | 12 ++-- models/repo/repo.go | 28 +++++----- models/repo/repo_indexer.go | 4 +- models/repo/repo_list.go | 8 +-- models/repo/repo_test.go | 6 +- models/repo_test.go | 2 +- modules/context/repo.go | 6 +- modules/doctor/mergebase.go | 2 +- modules/doctor/misc.go | 2 +- modules/indexer/code/indexer.go | 2 +- modules/indexer/issues/util.go | 2 +- modules/indexer/stats/db.go | 2 +- modules/indexer/stats/indexer.go | 8 ++- modules/indexer/stats/indexer_test.go | 2 +- routers/api/v1/admin/user.go | 2 +- routers/api/v1/api.go | 5 +- routers/api/v1/org/avatar.go | 4 +- routers/api/v1/org/team.go | 2 +- routers/api/v1/repo/issue.go | 4 +- routers/api/v1/repo/issue_dependency.go | 4 +- routers/api/v1/repo/key.go | 4 +- routers/api/v1/repo/milestone.go | 2 +- routers/api/v1/repo/pull.go | 4 +- routers/api/v1/user/avatar.go | 4 +- routers/api/v1/user/key.go | 14 ++--- routers/common/markup.go | 4 +- routers/init.go | 2 +- routers/private/actions.go | 2 +- routers/private/hook_post_receive.go | 10 ++-- routers/private/key.go | 2 +- routers/private/serv.go | 6 +- routers/web/admin/auths.go | 16 +++--- routers/web/admin/users.go | 10 ++-- routers/web/auth/auth.go | 4 +- routers/web/auth/linkaccount.go | 2 +- routers/web/auth/oauth.go | 6 +- routers/web/explore/code.go | 2 +- routers/web/feed/convert.go | 2 +- routers/web/org/projects.go | 2 +- routers/web/org/setting.go | 2 +- routers/web/org/teams.go | 2 +- routers/web/repo/branch.go | 2 +- routers/web/repo/http.go | 2 +- routers/web/repo/issue.go | 26 ++++----- routers/web/repo/issue_dependency.go | 4 +- routers/web/repo/issue_lock.go | 4 +- routers/web/repo/milestone.go | 6 +- routers/web/repo/projects.go | 6 +- routers/web/repo/pull.go | 6 +- routers/web/repo/release.go | 4 +- routers/web/repo/render.go | 2 +- routers/web/repo/view.go | 8 +-- routers/web/repo/wiki.go | 2 +- routers/web/shared/user/header.go | 2 +- routers/web/user/code.go | 2 +- routers/web/user/home.go | 14 ++--- routers/web/user/setting/keys.go | 8 +-- routers/web/user/setting/profile.go | 4 +- routers/web/user/setting/security/security.go | 2 +- routers/web/web.go | 3 +- services/actions/schedule_tasks.go | 2 +- services/agit/agit.go | 2 +- services/asymkey/ssh_key.go | 2 +- services/asymkey/ssh_key_test.go | 4 +- services/auth/httpsign.go | 2 +- services/auth/signin.go | 4 +- .../auth/source/ldap/source_authenticate.go | 6 +- services/auth/source/ldap/source_sync.go | 8 +-- services/auth/sspi.go | 6 +- services/auth/sync.go | 2 +- services/convert/pull.go | 2 +- services/issue/issue_test.go | 2 +- services/issue/label.go | 8 +-- services/issue/milestone.go | 8 +-- services/issue/milestone_test.go | 3 +- services/mailer/mail.go | 2 +- services/mailer/mail_issue.go | 2 +- services/mailer/mail_release.go | 2 +- services/mailer/notify.go | 2 +- services/migrations/gitea_uploader.go | 2 +- services/migrations/gitea_uploader_test.go | 4 +- services/pull/check.go | 4 +- services/pull/pull.go | 2 +- services/repository/archiver/archiver.go | 12 ++-- services/repository/archiver/archiver_test.go | 13 +++-- services/repository/branch.go | 2 +- services/repository/fork.go | 2 +- services/uinotification/notify.go | 2 +- services/user/avatar.go | 9 +-- services/user/user.go | 2 +- templates/repo/branch/list.tmpl | 4 +- templates/repo/commit_page.tmpl | 6 +- templates/repo/commits_list.tmpl | 4 +- templates/repo/commits_list_small.tmpl | 4 +- templates/repo/diff/compare.tmpl | 4 +- templates/repo/graph/commits.tmpl | 2 +- templates/repo/header.tmpl | 2 +- templates/repo/icon.tmpl | 2 +- templates/repo/issue/view_content/pull.tmpl | 2 +- templates/repo/issue/view_title.tmpl | 2 +- templates/repo/view_list.tmpl | 6 +- templates/shared/issueicon.tmpl | 4 +- templates/user/dashboard/feeds.tmpl | 2 +- tests/integration/auth_ldap_test.go | 2 +- tests/integration/pull_merge_test.go | 2 +- 136 files changed, 428 insertions(+), 421 deletions(-) diff --git a/cmd/admin_auth.go b/cmd/admin_auth.go index ef826a4893..0c931e74eb 100644 --- a/cmd/admin_auth.go +++ b/cmd/admin_auth.go @@ -62,7 +62,7 @@ func runListAuth(c *cli.Context) error { return err } - authSources, err := auth_model.Sources() + authSources, err := auth_model.Sources(ctx) if err != nil { return err } @@ -100,7 +100,7 @@ func runDeleteAuth(c *cli.Context) error { return err } - source, err := auth_model.GetSourceByID(c.Int64("id")) + source, err := auth_model.GetSourceByID(ctx, c.Int64("id")) if err != nil { return err } diff --git a/cmd/admin_auth_ldap.go b/cmd/admin_auth_ldap.go index 111bc7955c..e3c81809f8 100644 --- a/cmd/admin_auth_ldap.go +++ b/cmd/admin_auth_ldap.go @@ -17,9 +17,9 @@ import ( type ( authService struct { initDB func(ctx context.Context) error - createAuthSource func(*auth.Source) error - updateAuthSource func(*auth.Source) error - getAuthSourceByID func(id int64) (*auth.Source, error) + createAuthSource func(context.Context, *auth.Source) error + updateAuthSource func(context.Context, *auth.Source) error + getAuthSourceByID func(ctx context.Context, id int64) (*auth.Source, error) } ) @@ -289,12 +289,12 @@ func findLdapSecurityProtocolByName(name string) (ldap.SecurityProtocol, bool) { // getAuthSource gets the login source by its id defined in the command line flags. // It returns an error if the id is not set, does not match any source or if the source is not of expected type. -func (a *authService) getAuthSource(c *cli.Context, authType auth.Type) (*auth.Source, error) { +func (a *authService) getAuthSource(ctx context.Context, c *cli.Context, authType auth.Type) (*auth.Source, error) { if err := argsSet(c, "id"); err != nil { return nil, err } - authSource, err := a.getAuthSourceByID(c.Int64("id")) + authSource, err := a.getAuthSourceByID(ctx, c.Int64("id")) if err != nil { return nil, err } @@ -332,7 +332,7 @@ func (a *authService) addLdapBindDn(c *cli.Context) error { return err } - return a.createAuthSource(authSource) + return a.createAuthSource(ctx, authSource) } // updateLdapBindDn updates a new LDAP via Bind DN authentication source. @@ -344,7 +344,7 @@ func (a *authService) updateLdapBindDn(c *cli.Context) error { return err } - authSource, err := a.getAuthSource(c, auth.LDAP) + authSource, err := a.getAuthSource(ctx, c, auth.LDAP) if err != nil { return err } @@ -354,7 +354,7 @@ func (a *authService) updateLdapBindDn(c *cli.Context) error { return err } - return a.updateAuthSource(authSource) + return a.updateAuthSource(ctx, authSource) } // addLdapSimpleAuth adds a new LDAP (simple auth) authentication source. @@ -383,7 +383,7 @@ func (a *authService) addLdapSimpleAuth(c *cli.Context) error { return err } - return a.createAuthSource(authSource) + return a.createAuthSource(ctx, authSource) } // updateLdapBindDn updates a new LDAP (simple auth) authentication source. @@ -395,7 +395,7 @@ func (a *authService) updateLdapSimpleAuth(c *cli.Context) error { return err } - authSource, err := a.getAuthSource(c, auth.DLDAP) + authSource, err := a.getAuthSource(ctx, c, auth.DLDAP) if err != nil { return err } @@ -405,5 +405,5 @@ func (a *authService) updateLdapSimpleAuth(c *cli.Context) error { return err } - return a.updateAuthSource(authSource) + return a.updateAuthSource(ctx, authSource) } diff --git a/cmd/admin_auth_ldap_test.go b/cmd/admin_auth_ldap_test.go index 228c9dd3ed..7791f3a9cc 100644 --- a/cmd/admin_auth_ldap_test.go +++ b/cmd/admin_auth_ldap_test.go @@ -210,15 +210,15 @@ func TestAddLdapBindDn(t *testing.T) { initDB: func(context.Context) error { return nil }, - createAuthSource: func(authSource *auth.Source) error { + createAuthSource: func(ctx context.Context, authSource *auth.Source) error { createdAuthSource = authSource return nil }, - updateAuthSource: func(authSource *auth.Source) error { + updateAuthSource: func(ctx context.Context, authSource *auth.Source) error { assert.FailNow(t, "case %d: should not call updateAuthSource", n) return nil }, - getAuthSourceByID: func(id int64) (*auth.Source, error) { + getAuthSourceByID: func(ctx context.Context, id int64) (*auth.Source, error) { assert.FailNow(t, "case %d: should not call getAuthSourceByID", n) return nil, nil }, @@ -441,15 +441,15 @@ func TestAddLdapSimpleAuth(t *testing.T) { initDB: func(context.Context) error { return nil }, - createAuthSource: func(authSource *auth.Source) error { + createAuthSource: func(ctx context.Context, authSource *auth.Source) error { createdAuthSource = authSource return nil }, - updateAuthSource: func(authSource *auth.Source) error { + updateAuthSource: func(ctx context.Context, authSource *auth.Source) error { assert.FailNow(t, "case %d: should not call updateAuthSource", n) return nil }, - getAuthSourceByID: func(id int64) (*auth.Source, error) { + getAuthSourceByID: func(ctx context.Context, id int64) (*auth.Source, error) { assert.FailNow(t, "case %d: should not call getAuthSourceByID", n) return nil, nil }, @@ -896,15 +896,15 @@ func TestUpdateLdapBindDn(t *testing.T) { initDB: func(context.Context) error { return nil }, - createAuthSource: func(authSource *auth.Source) error { + createAuthSource: func(ctx context.Context, authSource *auth.Source) error { assert.FailNow(t, "case %d: should not call createAuthSource", n) return nil }, - updateAuthSource: func(authSource *auth.Source) error { + updateAuthSource: func(ctx context.Context, authSource *auth.Source) error { updatedAuthSource = authSource return nil }, - getAuthSourceByID: func(id int64) (*auth.Source, error) { + getAuthSourceByID: func(ctx context.Context, id int64) (*auth.Source, error) { if c.id != 0 { assert.Equal(t, c.id, id, "case %d: wrong id", n) } @@ -1286,15 +1286,15 @@ func TestUpdateLdapSimpleAuth(t *testing.T) { initDB: func(context.Context) error { return nil }, - createAuthSource: func(authSource *auth.Source) error { + createAuthSource: func(ctx context.Context, authSource *auth.Source) error { assert.FailNow(t, "case %d: should not call createAuthSource", n) return nil }, - updateAuthSource: func(authSource *auth.Source) error { + updateAuthSource: func(ctx context.Context, authSource *auth.Source) error { updatedAuthSource = authSource return nil }, - getAuthSourceByID: func(id int64) (*auth.Source, error) { + getAuthSourceByID: func(ctx context.Context, id int64) (*auth.Source, error) { if c.id != 0 { assert.Equal(t, c.id, id, "case %d: wrong id", n) } diff --git a/cmd/admin_auth_oauth.go b/cmd/admin_auth_oauth.go index cc54ac9454..c151c0af27 100644 --- a/cmd/admin_auth_oauth.go +++ b/cmd/admin_auth_oauth.go @@ -183,7 +183,7 @@ func runAddOauth(c *cli.Context) error { } } - return auth_model.CreateSource(&auth_model.Source{ + return auth_model.CreateSource(ctx, &auth_model.Source{ Type: auth_model.OAuth2, Name: c.String("name"), IsActive: true, @@ -203,7 +203,7 @@ func runUpdateOauth(c *cli.Context) error { return err } - source, err := auth_model.GetSourceByID(c.Int64("id")) + source, err := auth_model.GetSourceByID(ctx, c.Int64("id")) if err != nil { return err } @@ -294,5 +294,5 @@ func runUpdateOauth(c *cli.Context) error { oAuth2Config.CustomURLMapping = customURLMapping source.Cfg = oAuth2Config - return auth_model.UpdateSource(source) + return auth_model.UpdateSource(ctx, source) } diff --git a/cmd/admin_auth_stmp.go b/cmd/admin_auth_stmp.go index 8c65de8a1b..58a6e2ac22 100644 --- a/cmd/admin_auth_stmp.go +++ b/cmd/admin_auth_stmp.go @@ -156,7 +156,7 @@ func runAddSMTP(c *cli.Context) error { smtpConfig.Auth = "PLAIN" } - return auth_model.CreateSource(&auth_model.Source{ + return auth_model.CreateSource(ctx, &auth_model.Source{ Type: auth_model.SMTP, Name: c.String("name"), IsActive: active, @@ -176,7 +176,7 @@ func runUpdateSMTP(c *cli.Context) error { return err } - source, err := auth_model.GetSourceByID(c.Int64("id")) + source, err := auth_model.GetSourceByID(ctx, c.Int64("id")) if err != nil { return err } @@ -197,5 +197,5 @@ func runUpdateSMTP(c *cli.Context) error { source.Cfg = smtpConfig - return auth_model.UpdateSource(source) + return auth_model.UpdateSource(ctx, source) } diff --git a/models/actions/run_job_list.go b/models/actions/run_job_list.go index 047bf64410..a166396694 100644 --- a/models/actions/run_job_list.go +++ b/models/actions/run_job_list.go @@ -42,7 +42,7 @@ func (jobs ActionJobList) LoadRuns(ctx context.Context, withRepo bool) error { for _, r := range runs { runsList = append(runsList, r) } - return runsList.LoadRepos() + return runsList.LoadRepos(ctx) } return nil } diff --git a/models/actions/run_list.go b/models/actions/run_list.go index db36f6df98..cd053ea7b5 100644 --- a/models/actions/run_list.go +++ b/models/actions/run_list.go @@ -52,9 +52,9 @@ func (runs RunList) LoadTriggerUser(ctx context.Context) error { return nil } -func (runs RunList) LoadRepos() error { +func (runs RunList) LoadRepos(ctx context.Context) error { repoIDs := runs.GetRepoIDs() - repos, err := repo_model.GetRepositoriesMapByIDs(repoIDs) + repos, err := repo_model.GetRepositoriesMapByIDs(ctx, repoIDs) if err != nil { return err } diff --git a/models/actions/schedule_list.go b/models/actions/schedule_list.go index e873c05ec3..ddd9a1321e 100644 --- a/models/actions/schedule_list.go +++ b/models/actions/schedule_list.go @@ -49,9 +49,9 @@ func (schedules ScheduleList) LoadTriggerUser(ctx context.Context) error { return nil } -func (schedules ScheduleList) LoadRepos() error { +func (schedules ScheduleList) LoadRepos(ctx context.Context) error { repoIDs := schedules.GetRepoIDs() - repos, err := repo_model.GetRepositoriesMapByIDs(repoIDs) + repos, err := repo_model.GetRepositoriesMapByIDs(ctx, repoIDs) if err != nil { return err } diff --git a/models/actions/schedule_spec_list.go b/models/actions/schedule_spec_list.go index 2c017fdabc..6bf91cf819 100644 --- a/models/actions/schedule_spec_list.go +++ b/models/actions/schedule_spec_list.go @@ -53,9 +53,9 @@ func (specs SpecList) GetRepoIDs() []int64 { return ids.Values() } -func (specs SpecList) LoadRepos() error { +func (specs SpecList) LoadRepos(ctx context.Context) error { repoIDs := specs.GetRepoIDs() - repos, err := repo_model.GetRepositoriesMapByIDs(repoIDs) + repos, err := repo_model.GetRepositoriesMapByIDs(ctx, repoIDs) if err != nil { return err } diff --git a/models/activities/statistic.go b/models/activities/statistic.go index ea13f3ed5c..009c8c5ab4 100644 --- a/models/activities/statistic.go +++ b/models/activities/statistic.go @@ -102,7 +102,7 @@ func GetStatistic(ctx context.Context) (stats Statistic) { stats.Counter.Follow, _ = e.Count(new(user_model.Follow)) stats.Counter.Mirror, _ = e.Count(new(repo_model.Mirror)) stats.Counter.Release, _ = e.Count(new(repo_model.Release)) - stats.Counter.AuthSource = auth.CountSources() + stats.Counter.AuthSource = auth.CountSources(ctx) stats.Counter.Webhook, _ = e.Count(new(webhook.Webhook)) stats.Counter.Milestone, _ = e.Count(new(issues_model.Milestone)) stats.Counter.Label, _ = e.Count(new(issues_model.Label)) diff --git a/models/asymkey/ssh_key.go b/models/asymkey/ssh_key.go index 8d84c2f7dc..f36738fb3d 100644 --- a/models/asymkey/ssh_key.go +++ b/models/asymkey/ssh_key.go @@ -91,7 +91,7 @@ func addKey(ctx context.Context, key *PublicKey) (err error) { } // AddPublicKey adds new public key to database and authorized_keys file. -func AddPublicKey(ownerID int64, name, content string, authSourceID int64) (*PublicKey, error) { +func AddPublicKey(ctx context.Context, ownerID int64, name, content string, authSourceID int64) (*PublicKey, error) { log.Trace(content) fingerprint, err := CalcFingerprint(content) @@ -99,7 +99,7 @@ func AddPublicKey(ownerID int64, name, content string, authSourceID int64) (*Pub return nil, err } - ctx, committer, err := db.TxContext(db.DefaultContext) + ctx, committer, err := db.TxContext(ctx) if err != nil { return nil, err } @@ -136,9 +136,9 @@ func AddPublicKey(ownerID int64, name, content string, authSourceID int64) (*Pub } // GetPublicKeyByID returns public key by given ID. -func GetPublicKeyByID(keyID int64) (*PublicKey, error) { +func GetPublicKeyByID(ctx context.Context, keyID int64) (*PublicKey, error) { key := new(PublicKey) - has, err := db.GetEngine(db.DefaultContext). + has, err := db.GetEngine(ctx). ID(keyID). Get(key) if err != nil { @@ -180,7 +180,7 @@ func SearchPublicKeyByContentExact(ctx context.Context, content string) (*Public } // SearchPublicKey returns a list of public keys matching the provided arguments. -func SearchPublicKey(uid int64, fingerprint string) ([]*PublicKey, error) { +func SearchPublicKey(ctx context.Context, uid int64, fingerprint string) ([]*PublicKey, error) { keys := make([]*PublicKey, 0, 5) cond := builder.NewCond() if uid != 0 { @@ -189,12 +189,12 @@ func SearchPublicKey(uid int64, fingerprint string) ([]*PublicKey, error) { if fingerprint != "" { cond = cond.And(builder.Eq{"fingerprint": fingerprint}) } - return keys, db.GetEngine(db.DefaultContext).Where(cond).Find(&keys) + return keys, db.GetEngine(ctx).Where(cond).Find(&keys) } // ListPublicKeys returns a list of public keys belongs to given user. -func ListPublicKeys(uid int64, listOptions db.ListOptions) ([]*PublicKey, error) { - sess := db.GetEngine(db.DefaultContext).Where("owner_id = ? AND type != ?", uid, KeyTypePrincipal) +func ListPublicKeys(ctx context.Context, uid int64, listOptions db.ListOptions) ([]*PublicKey, error) { + sess := db.GetEngine(ctx).Where("owner_id = ? AND type != ?", uid, KeyTypePrincipal) if listOptions.Page != 0 { sess = db.SetSessionPagination(sess, &listOptions) @@ -207,30 +207,30 @@ func ListPublicKeys(uid int64, listOptions db.ListOptions) ([]*PublicKey, error) } // CountPublicKeys count public keys a user has -func CountPublicKeys(userID int64) (int64, error) { - sess := db.GetEngine(db.DefaultContext).Where("owner_id = ? AND type != ?", userID, KeyTypePrincipal) +func CountPublicKeys(ctx context.Context, userID int64) (int64, error) { + sess := db.GetEngine(ctx).Where("owner_id = ? AND type != ?", userID, KeyTypePrincipal) return sess.Count(&PublicKey{}) } // ListPublicKeysBySource returns a list of synchronized public keys for a given user and login source. -func ListPublicKeysBySource(uid, authSourceID int64) ([]*PublicKey, error) { +func ListPublicKeysBySource(ctx context.Context, uid, authSourceID int64) ([]*PublicKey, error) { keys := make([]*PublicKey, 0, 5) - return keys, db.GetEngine(db.DefaultContext). + return keys, db.GetEngine(ctx). Where("owner_id = ? AND login_source_id = ?", uid, authSourceID). Find(&keys) } // UpdatePublicKeyUpdated updates public key use time. -func UpdatePublicKeyUpdated(id int64) error { +func UpdatePublicKeyUpdated(ctx context.Context, id int64) error { // Check if key exists before update as affected rows count is unreliable // and will return 0 affected rows if two updates are made at the same time - if cnt, err := db.GetEngine(db.DefaultContext).ID(id).Count(&PublicKey{}); err != nil { + if cnt, err := db.GetEngine(ctx).ID(id).Count(&PublicKey{}); err != nil { return err } else if cnt != 1 { return ErrKeyNotExist{id} } - _, err := db.GetEngine(db.DefaultContext).ID(id).Cols("updated_unix").Update(&PublicKey{ + _, err := db.GetEngine(ctx).ID(id).Cols("updated_unix").Update(&PublicKey{ UpdatedUnix: timeutil.TimeStampNow(), }) if err != nil { @@ -250,7 +250,7 @@ func DeletePublicKeys(ctx context.Context, keyIDs ...int64) error { } // PublicKeysAreExternallyManaged returns whether the provided KeyID represents an externally managed Key -func PublicKeysAreExternallyManaged(keys []*PublicKey) ([]bool, error) { +func PublicKeysAreExternallyManaged(ctx context.Context, keys []*PublicKey) ([]bool, error) { sources := make([]*auth.Source, 0, 5) externals := make([]bool, len(keys)) keyloop: @@ -272,7 +272,7 @@ keyloop: if source == nil { var err error - source, err = auth.GetSourceByID(key.LoginSourceID) + source, err = auth.GetSourceByID(ctx, key.LoginSourceID) if err != nil { if auth.IsErrSourceNotExist(err) { externals[i] = false @@ -295,15 +295,15 @@ keyloop: } // PublicKeyIsExternallyManaged returns whether the provided KeyID represents an externally managed Key -func PublicKeyIsExternallyManaged(id int64) (bool, error) { - key, err := GetPublicKeyByID(id) +func PublicKeyIsExternallyManaged(ctx context.Context, id int64) (bool, error) { + key, err := GetPublicKeyByID(ctx, id) if err != nil { return false, err } if key.LoginSourceID == 0 { return false, nil } - source, err := auth.GetSourceByID(key.LoginSourceID) + source, err := auth.GetSourceByID(ctx, key.LoginSourceID) if err != nil { if auth.IsErrSourceNotExist(err) { return false, nil @@ -318,9 +318,9 @@ func PublicKeyIsExternallyManaged(id int64) (bool, error) { } // deleteKeysMarkedForDeletion returns true if ssh keys needs update -func deleteKeysMarkedForDeletion(keys []string) (bool, error) { +func deleteKeysMarkedForDeletion(ctx context.Context, keys []string) (bool, error) { // Start session - ctx, committer, err := db.TxContext(db.DefaultContext) + ctx, committer, err := db.TxContext(ctx) if err != nil { return false, err } @@ -349,7 +349,7 @@ func deleteKeysMarkedForDeletion(keys []string) (bool, error) { } // AddPublicKeysBySource add a users public keys. Returns true if there are changes. -func AddPublicKeysBySource(usr *user_model.User, s *auth.Source, sshPublicKeys []string) bool { +func AddPublicKeysBySource(ctx context.Context, usr *user_model.User, s *auth.Source, sshPublicKeys []string) bool { var sshKeysNeedUpdate bool for _, sshKey := range sshPublicKeys { var err error @@ -368,7 +368,7 @@ func AddPublicKeysBySource(usr *user_model.User, s *auth.Source, sshPublicKeys [ marshalled = marshalled[:len(marshalled)-1] sshKeyName := fmt.Sprintf("%s-%s", s.Name, ssh.FingerprintSHA256(out)) - if _, err := AddPublicKey(usr.ID, sshKeyName, marshalled, s.ID); err != nil { + if _, err := AddPublicKey(ctx, usr.ID, sshKeyName, marshalled, s.ID); err != nil { if IsErrKeyAlreadyExist(err) { log.Trace("AddPublicKeysBySource[%s]: Public SSH Key %s already exists for user", sshKeyName, usr.Name) } else { @@ -387,14 +387,14 @@ func AddPublicKeysBySource(usr *user_model.User, s *auth.Source, sshPublicKeys [ } // SynchronizePublicKeys updates a users public keys. Returns true if there are changes. -func SynchronizePublicKeys(usr *user_model.User, s *auth.Source, sshPublicKeys []string) bool { +func SynchronizePublicKeys(ctx context.Context, usr *user_model.User, s *auth.Source, sshPublicKeys []string) bool { var sshKeysNeedUpdate bool log.Trace("synchronizePublicKeys[%s]: Handling Public SSH Key synchronization for user %s", s.Name, usr.Name) // Get Public Keys from DB with current LDAP source var giteaKeys []string - keys, err := ListPublicKeysBySource(usr.ID, s.ID) + keys, err := ListPublicKeysBySource(ctx, usr.ID, s.ID) if err != nil { log.Error("synchronizePublicKeys[%s]: Error listing Public SSH Keys for user %s: %v", s.Name, usr.Name, err) } @@ -429,7 +429,7 @@ func SynchronizePublicKeys(usr *user_model.User, s *auth.Source, sshPublicKeys [ newKeys = append(newKeys, key) } } - if AddPublicKeysBySource(usr, s, newKeys) { + if AddPublicKeysBySource(ctx, usr, s, newKeys) { sshKeysNeedUpdate = true } @@ -443,7 +443,7 @@ func SynchronizePublicKeys(usr *user_model.User, s *auth.Source, sshPublicKeys [ } // Delete keys from DB that no longer exist in the source - needUpd, err := deleteKeysMarkedForDeletion(giteaKeysToDelete) + needUpd, err := deleteKeysMarkedForDeletion(ctx, giteaKeysToDelete) if err != nil { log.Error("synchronizePublicKeys[%s]: Error deleting Public Keys marked for deletion for user %s: %v", s.Name, usr.Name, err) } diff --git a/models/asymkey/ssh_key_commit_verification.go b/models/asymkey/ssh_key_commit_verification.go index 80931c9af4..a61f0663b1 100644 --- a/models/asymkey/ssh_key_commit_verification.go +++ b/models/asymkey/ssh_key_commit_verification.go @@ -21,7 +21,7 @@ import ( func ParseCommitWithSSHSignature(ctx context.Context, c *git.Commit, committer *user_model.User) *CommitVerification { // Now try to associate the signature with the committer, if present if committer.ID != 0 { - keys, err := ListPublicKeys(committer.ID, db.ListOptions{}) + keys, err := ListPublicKeys(ctx, committer.ID, db.ListOptions{}) if err != nil { // Skipping failed to get ssh keys of user log.Error("ListPublicKeys: %v", err) return &CommitVerification{ diff --git a/models/asymkey/ssh_key_deploy.go b/models/asymkey/ssh_key_deploy.go index cc84392117..25d95291fa 100644 --- a/models/asymkey/ssh_key_deploy.go +++ b/models/asymkey/ssh_key_deploy.go @@ -48,8 +48,8 @@ func (key *DeployKey) AfterLoad() { } // GetContent gets associated public key content. -func (key *DeployKey) GetContent() error { - pkey, err := GetPublicKeyByID(key.KeyID) +func (key *DeployKey) GetContent(ctx context.Context) error { + pkey, err := GetPublicKeyByID(ctx, key.KeyID) if err != nil { return err } diff --git a/models/auth/source.go b/models/auth/source.go index 0a904b7772..0f57d1702a 100644 --- a/models/auth/source.go +++ b/models/auth/source.go @@ -5,6 +5,7 @@ package auth import ( + "context" "fmt" "reflect" @@ -199,8 +200,8 @@ func (source *Source) SkipVerify() bool { // CreateSource inserts a AuthSource in the DB if not already // existing with the given name. -func CreateSource(source *Source) error { - has, err := db.GetEngine(db.DefaultContext).Where("name=?", source.Name).Exist(new(Source)) +func CreateSource(ctx context.Context, source *Source) error { + has, err := db.GetEngine(ctx).Where("name=?", source.Name).Exist(new(Source)) if err != nil { return err } else if has { @@ -211,7 +212,7 @@ func CreateSource(source *Source) error { source.IsSyncEnabled = false } - _, err = db.GetEngine(db.DefaultContext).Insert(source) + _, err = db.GetEngine(ctx).Insert(source) if err != nil { return err } @@ -232,7 +233,7 @@ func CreateSource(source *Source) error { err = registerableSource.RegisterSource() if err != nil { // remove the AuthSource in case of errors while registering configuration - if _, err := db.GetEngine(db.DefaultContext).Delete(source); err != nil { + if _, err := db.GetEngine(ctx).Delete(source); err != nil { log.Error("CreateSource: Error while wrapOpenIDConnectInitializeError: %v", err) } } @@ -240,33 +241,33 @@ func CreateSource(source *Source) error { } // Sources returns a slice of all login sources found in DB. -func Sources() ([]*Source, error) { +func Sources(ctx context.Context) ([]*Source, error) { auths := make([]*Source, 0, 6) - return auths, db.GetEngine(db.DefaultContext).Find(&auths) + return auths, db.GetEngine(ctx).Find(&auths) } // SourcesByType returns all sources of the specified type -func SourcesByType(loginType Type) ([]*Source, error) { +func SourcesByType(ctx context.Context, loginType Type) ([]*Source, error) { sources := make([]*Source, 0, 1) - if err := db.GetEngine(db.DefaultContext).Where("type = ?", loginType).Find(&sources); err != nil { + if err := db.GetEngine(ctx).Where("type = ?", loginType).Find(&sources); err != nil { return nil, err } return sources, nil } // AllActiveSources returns all active sources -func AllActiveSources() ([]*Source, error) { +func AllActiveSources(ctx context.Context) ([]*Source, error) { sources := make([]*Source, 0, 5) - if err := db.GetEngine(db.DefaultContext).Where("is_active = ?", true).Find(&sources); err != nil { + if err := db.GetEngine(ctx).Where("is_active = ?", true).Find(&sources); err != nil { return nil, err } return sources, nil } // ActiveSources returns all active sources of the specified type -func ActiveSources(tp Type) ([]*Source, error) { +func ActiveSources(ctx context.Context, tp Type) ([]*Source, error) { sources := make([]*Source, 0, 1) - if err := db.GetEngine(db.DefaultContext).Where("is_active = ? and type = ?", true, tp).Find(&sources); err != nil { + if err := db.GetEngine(ctx).Where("is_active = ? and type = ?", true, tp).Find(&sources); err != nil { return nil, err } return sources, nil @@ -274,11 +275,11 @@ func ActiveSources(tp Type) ([]*Source, error) { // IsSSPIEnabled returns true if there is at least one activated login // source of type LoginSSPI -func IsSSPIEnabled() bool { +func IsSSPIEnabled(ctx context.Context) bool { if !db.HasEngine { return false } - sources, err := ActiveSources(SSPI) + sources, err := ActiveSources(ctx, SSPI) if err != nil { log.Error("ActiveSources: %v", err) return false @@ -287,7 +288,7 @@ func IsSSPIEnabled() bool { } // GetSourceByID returns login source by given ID. -func GetSourceByID(id int64) (*Source, error) { +func GetSourceByID(ctx context.Context, id int64) (*Source, error) { source := new(Source) if id == 0 { source.Cfg = registeredConfigs[NoType]() @@ -297,7 +298,7 @@ func GetSourceByID(id int64) (*Source, error) { return source, nil } - has, err := db.GetEngine(db.DefaultContext).ID(id).Get(source) + has, err := db.GetEngine(ctx).ID(id).Get(source) if err != nil { return nil, err } else if !has { @@ -307,24 +308,24 @@ func GetSourceByID(id int64) (*Source, error) { } // UpdateSource updates a Source record in DB. -func UpdateSource(source *Source) error { +func UpdateSource(ctx context.Context, source *Source) error { var originalSource *Source if source.IsOAuth2() { // keep track of the original values so we can restore in case of errors while registering OAuth2 providers var err error - if originalSource, err = GetSourceByID(source.ID); err != nil { + if originalSource, err = GetSourceByID(ctx, source.ID); err != nil { return err } } - has, err := db.GetEngine(db.DefaultContext).Where("name=? AND id!=?", source.Name, source.ID).Exist(new(Source)) + has, err := db.GetEngine(ctx).Where("name=? AND id!=?", source.Name, source.ID).Exist(new(Source)) if err != nil { return err } else if has { return ErrSourceAlreadyExist{source.Name} } - _, err = db.GetEngine(db.DefaultContext).ID(source.ID).AllCols().Update(source) + _, err = db.GetEngine(ctx).ID(source.ID).AllCols().Update(source) if err != nil { return err } @@ -345,7 +346,7 @@ func UpdateSource(source *Source) error { err = registerableSource.RegisterSource() if err != nil { // restore original values since we cannot update the provider it self - if _, err := db.GetEngine(db.DefaultContext).ID(source.ID).AllCols().Update(originalSource); err != nil { + if _, err := db.GetEngine(ctx).ID(source.ID).AllCols().Update(originalSource); err != nil { log.Error("UpdateSource: Error while wrapOpenIDConnectInitializeError: %v", err) } } @@ -353,8 +354,8 @@ func UpdateSource(source *Source) error { } // CountSources returns number of login sources. -func CountSources() int64 { - count, _ := db.GetEngine(db.DefaultContext).Count(new(Source)) +func CountSources(ctx context.Context) int64 { + count, _ := db.GetEngine(ctx).Count(new(Source)) return count } diff --git a/models/auth/source_test.go b/models/auth/source_test.go index 31216cca8e..36e76d5e28 100644 --- a/models/auth/source_test.go +++ b/models/auth/source_test.go @@ -42,7 +42,7 @@ func TestDumpAuthSource(t *testing.T) { auth_model.RegisterTypeConfig(auth_model.OAuth2, new(TestSource)) - auth_model.CreateSource(&auth_model.Source{ + auth_model.CreateSource(db.DefaultContext, &auth_model.Source{ Type: auth_model.OAuth2, Name: "TestSource", IsActive: false, diff --git a/models/issues/comment_code.go b/models/issues/comment_code.go index 49927fbbe2..25e606f092 100644 --- a/models/issues/comment_code.go +++ b/models/issues/comment_code.go @@ -111,7 +111,7 @@ func findCodeComments(ctx context.Context, opts FindCommentsOptions, issue *Issu if comment.RenderedContent, err = markdown.RenderString(&markup.RenderContext{ Ctx: ctx, URLPrefix: issue.Repo.Link(), - Metas: issue.Repo.ComposeMetas(), + Metas: issue.Repo.ComposeMetas(ctx), }, comment.Content); err != nil { return nil, err } diff --git a/models/issues/dependency.go b/models/issues/dependency.go index 4dc5a4aec7..146dd1887d 100644 --- a/models/issues/dependency.go +++ b/models/issues/dependency.go @@ -127,8 +127,8 @@ const ( ) // CreateIssueDependency creates a new dependency for an issue -func CreateIssueDependency(user *user_model.User, issue, dep *Issue) error { - ctx, committer, err := db.TxContext(db.DefaultContext) +func CreateIssueDependency(ctx context.Context, user *user_model.User, issue, dep *Issue) error { + ctx, committer, err := db.TxContext(ctx) if err != nil { return err } @@ -168,8 +168,8 @@ func CreateIssueDependency(user *user_model.User, issue, dep *Issue) error { } // RemoveIssueDependency removes a dependency from an issue -func RemoveIssueDependency(user *user_model.User, issue, dep *Issue, depType DependencyType) (err error) { - ctx, committer, err := db.TxContext(db.DefaultContext) +func RemoveIssueDependency(ctx context.Context, user *user_model.User, issue, dep *Issue, depType DependencyType) (err error) { + ctx, committer, err := db.TxContext(ctx) if err != nil { return err } diff --git a/models/issues/dependency_test.go b/models/issues/dependency_test.go index cdc8e3182d..6eed483cc9 100644 --- a/models/issues/dependency_test.go +++ b/models/issues/dependency_test.go @@ -28,16 +28,16 @@ func TestCreateIssueDependency(t *testing.T) { assert.NoError(t, err) // Create a dependency and check if it was successful - err = issues_model.CreateIssueDependency(user1, issue1, issue2) + err = issues_model.CreateIssueDependency(db.DefaultContext, user1, issue1, issue2) assert.NoError(t, err) // Do it again to see if it will check if the dependency already exists - err = issues_model.CreateIssueDependency(user1, issue1, issue2) + err = issues_model.CreateIssueDependency(db.DefaultContext, user1, issue1, issue2) assert.Error(t, err) assert.True(t, issues_model.IsErrDependencyExists(err)) // Check for circular dependencies - err = issues_model.CreateIssueDependency(user1, issue2, issue1) + err = issues_model.CreateIssueDependency(db.DefaultContext, user1, issue2, issue1) assert.Error(t, err) assert.True(t, issues_model.IsErrCircularDependency(err)) @@ -57,6 +57,6 @@ func TestCreateIssueDependency(t *testing.T) { assert.True(t, left) // Test removing the dependency - err = issues_model.RemoveIssueDependency(user1, issue1, issue2, issues_model.DependencyTypeBlockedBy) + err = issues_model.RemoveIssueDependency(db.DefaultContext, user1, issue1, issue2, issues_model.DependencyTypeBlockedBy) assert.NoError(t, err) } diff --git a/models/issues/issue_label.go b/models/issues/issue_label.go index 0a2ffdb35f..733f1043b0 100644 --- a/models/issues/issue_label.go +++ b/models/issues/issue_label.go @@ -83,12 +83,12 @@ func RemoveDuplicateExclusiveIssueLabels(ctx context.Context, issue *Issue, labe } // NewIssueLabel creates a new issue-label relation. -func NewIssueLabel(issue *Issue, label *Label, doer *user_model.User) (err error) { - if HasIssueLabel(db.DefaultContext, issue.ID, label.ID) { +func NewIssueLabel(ctx context.Context, issue *Issue, label *Label, doer *user_model.User) (err error) { + if HasIssueLabel(ctx, issue.ID, label.ID) { return nil } - ctx, committer, err := db.TxContext(db.DefaultContext) + ctx, committer, err := db.TxContext(ctx) if err != nil { return err } @@ -149,8 +149,8 @@ func newIssueLabels(ctx context.Context, issue *Issue, labels []*Label, doer *us } // NewIssueLabels creates a list of issue-label relations. -func NewIssueLabels(issue *Issue, labels []*Label, doer *user_model.User) (err error) { - ctx, committer, err := db.TxContext(db.DefaultContext) +func NewIssueLabels(ctx context.Context, issue *Issue, labels []*Label, doer *user_model.User) (err error) { + ctx, committer, err := db.TxContext(ctx) if err != nil { return err } @@ -359,8 +359,8 @@ func clearIssueLabels(ctx context.Context, issue *Issue, doer *user_model.User) // ClearIssueLabels removes all issue labels as the given user. // Triggers appropriate WebHooks, if any. -func ClearIssueLabels(issue *Issue, doer *user_model.User) (err error) { - ctx, committer, err := db.TxContext(db.DefaultContext) +func ClearIssueLabels(ctx context.Context, issue *Issue, doer *user_model.User) (err error) { + ctx, committer, err := db.TxContext(ctx) if err != nil { return err } @@ -432,8 +432,8 @@ func RemoveDuplicateExclusiveLabels(labels []*Label) []*Label { // ReplaceIssueLabels removes all current labels and add new labels to the issue. // Triggers appropriate WebHooks, if any. -func ReplaceIssueLabels(issue *Issue, labels []*Label, doer *user_model.User) (err error) { - ctx, committer, err := db.TxContext(db.DefaultContext) +func ReplaceIssueLabels(ctx context.Context, issue *Issue, labels []*Label, doer *user_model.User) (err error) { + ctx, committer, err := db.TxContext(ctx) if err != nil { return err } diff --git a/models/issues/issue_label_test.go b/models/issues/issue_label_test.go index 0d991b7c4f..0470b99e24 100644 --- a/models/issues/issue_label_test.go +++ b/models/issues/issue_label_test.go @@ -6,6 +6,7 @@ package issues_test import ( "testing" + "code.gitea.io/gitea/models/db" issues_model "code.gitea.io/gitea/models/issues" "code.gitea.io/gitea/models/unittest" user_model "code.gitea.io/gitea/models/user" @@ -21,7 +22,7 @@ func TestNewIssueLabelsScope(t *testing.T) { label2 := unittest.AssertExistsAndLoadBean(t, &issues_model.Label{ID: 8}) doer := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) - assert.NoError(t, issues_model.NewIssueLabels(issue, []*issues_model.Label{label1, label2}, doer)) + assert.NoError(t, issues_model.NewIssueLabels(db.DefaultContext, issue, []*issues_model.Label{label1, label2}, doer)) assert.Len(t, issue.Labels, 1) assert.Equal(t, label2.ID, issue.Labels[0].ID) diff --git a/models/issues/issue_lock.go b/models/issues/issue_lock.go index 19cd6d3167..b21629b529 100644 --- a/models/issues/issue_lock.go +++ b/models/issues/issue_lock.go @@ -4,6 +4,8 @@ package issues import ( + "context" + "code.gitea.io/gitea/models/db" user_model "code.gitea.io/gitea/models/user" ) @@ -17,16 +19,16 @@ type IssueLockOptions struct { // LockIssue locks an issue. This would limit commenting abilities to // users with write access to the repo -func LockIssue(opts *IssueLockOptions) error { - return updateIssueLock(opts, true) +func LockIssue(ctx context.Context, opts *IssueLockOptions) error { + return updateIssueLock(ctx, opts, true) } // UnlockIssue unlocks a previously locked issue. -func UnlockIssue(opts *IssueLockOptions) error { - return updateIssueLock(opts, false) +func UnlockIssue(ctx context.Context, opts *IssueLockOptions) error { + return updateIssueLock(ctx, opts, false) } -func updateIssueLock(opts *IssueLockOptions, lock bool) error { +func updateIssueLock(ctx context.Context, opts *IssueLockOptions, lock bool) error { if opts.Issue.IsLocked == lock { return nil } @@ -39,7 +41,7 @@ func updateIssueLock(opts *IssueLockOptions, lock bool) error { commentType = CommentTypeUnlock } - ctx, committer, err := db.TxContext(db.DefaultContext) + ctx, committer, err := db.TxContext(ctx) if err != nil { return err } diff --git a/models/issues/issue_project.go b/models/issues/issue_project.go index ed249527bf..7906c3eace 100644 --- a/models/issues/issue_project.go +++ b/models/issues/issue_project.go @@ -38,11 +38,7 @@ func (issue *Issue) projectID(ctx context.Context) int64 { } // ProjectBoardID return project board id if issue was assigned to one -func (issue *Issue) ProjectBoardID() int64 { - return issue.projectBoardID(db.DefaultContext) -} - -func (issue *Issue) projectBoardID(ctx context.Context) int64 { +func (issue *Issue) ProjectBoardID(ctx context.Context) int64 { var ip project_model.ProjectIssue has, err := db.GetEngine(ctx).Where("issue_id=?", issue.ID).Get(&ip) if err != nil || !has { @@ -100,8 +96,8 @@ func LoadIssuesFromBoardList(ctx context.Context, bs project_model.BoardList) (m } // ChangeProjectAssign changes the project associated with an issue -func ChangeProjectAssign(issue *Issue, doer *user_model.User, newProjectID int64) error { - ctx, committer, err := db.TxContext(db.DefaultContext) +func ChangeProjectAssign(ctx context.Context, issue *Issue, doer *user_model.User, newProjectID int64) error { + ctx, committer, err := db.TxContext(ctx) if err != nil { return err } @@ -156,8 +152,8 @@ func addUpdateIssueProject(ctx context.Context, issue *Issue, doer *user_model.U } // MoveIssueAcrossProjectBoards move a card from one board to another -func MoveIssueAcrossProjectBoards(issue *Issue, board *project_model.Board) error { - ctx, committer, err := db.TxContext(db.DefaultContext) +func MoveIssueAcrossProjectBoards(ctx context.Context, issue *Issue, board *project_model.Board) error { + ctx, committer, err := db.TxContext(ctx) if err != nil { return err } diff --git a/models/issues/issue_search.go b/models/issues/issue_search.go index 5c05ead687..3e878ff1e7 100644 --- a/models/issues/issue_search.go +++ b/models/issues/issue_search.go @@ -444,9 +444,9 @@ func applySubscribedCondition(sess *xorm.Session, subscriberID int64) *xorm.Sess } // GetRepoIDsForIssuesOptions find all repo ids for the given options -func GetRepoIDsForIssuesOptions(opts *IssuesOptions, user *user_model.User) ([]int64, error) { +func GetRepoIDsForIssuesOptions(ctx context.Context, opts *IssuesOptions, user *user_model.User) ([]int64, error) { repoIDs := make([]int64, 0, 5) - e := db.GetEngine(db.DefaultContext) + e := db.GetEngine(ctx) sess := e.Join("INNER", "repository", "`issue`.repo_id = `repository`.id") diff --git a/models/issues/issue_test.go b/models/issues/issue_test.go index 4e98442c11..f554820964 100644 --- a/models/issues/issue_test.go +++ b/models/issues/issue_test.go @@ -34,7 +34,7 @@ func TestIssue_ReplaceLabels(t *testing.T) { for i, labelID := range labelIDs { labels[i] = unittest.AssertExistsAndLoadBean(t, &issues_model.Label{ID: labelID, RepoID: repo.ID}) } - assert.NoError(t, issues_model.ReplaceIssueLabels(issue, labels, doer)) + assert.NoError(t, issues_model.ReplaceIssueLabels(db.DefaultContext, issue, labels, doer)) unittest.AssertCount(t, &issues_model.IssueLabel{IssueID: issueID}, len(expectedLabelIDs)) for _, labelID := range expectedLabelIDs { unittest.AssertExistsAndLoadBean(t, &issues_model.IssueLabel{IssueID: issueID, LabelID: labelID}) @@ -122,7 +122,7 @@ func TestIssue_ClearLabels(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: test.issueID}) doer := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: test.doerID}) - assert.NoError(t, issues_model.ClearIssueLabels(issue, doer)) + assert.NoError(t, issues_model.ClearIssueLabels(db.DefaultContext, issue, doer)) unittest.AssertNotExistsBean(t, &issues_model.IssueLabel{IssueID: test.issueID}) } } @@ -230,7 +230,7 @@ func TestGetRepoIDsForIssuesOptions(t *testing.T) { []int64{1, 2}, }, } { - repoIDs, err := issues_model.GetRepoIDsForIssuesOptions(&test.Opts, user) + repoIDs, err := issues_model.GetRepoIDsForIssuesOptions(db.DefaultContext, &test.Opts, user) assert.NoError(t, err) if assert.Len(t, repoIDs, len(test.ExpectedRepoIDs)) { for i, repoID := range repoIDs { diff --git a/models/issues/label_test.go b/models/issues/label_test.go index 9f44cd3e03..3a8db6ceec 100644 --- a/models/issues/label_test.go +++ b/models/issues/label_test.go @@ -307,7 +307,7 @@ func TestNewIssueLabel(t *testing.T) { // add new IssueLabel prevNumIssues := label.NumIssues - assert.NoError(t, issues_model.NewIssueLabel(issue, label, doer)) + assert.NoError(t, issues_model.NewIssueLabel(db.DefaultContext, issue, label, doer)) unittest.AssertExistsAndLoadBean(t, &issues_model.IssueLabel{IssueID: issue.ID, LabelID: label.ID}) unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{ Type: issues_model.CommentTypeLabel, @@ -320,7 +320,7 @@ func TestNewIssueLabel(t *testing.T) { assert.EqualValues(t, prevNumIssues+1, label.NumIssues) // re-add existing IssueLabel - assert.NoError(t, issues_model.NewIssueLabel(issue, label, doer)) + assert.NoError(t, issues_model.NewIssueLabel(db.DefaultContext, issue, label, doer)) unittest.CheckConsistencyFor(t, &issues_model.Issue{}, &issues_model.Label{}) } @@ -334,19 +334,19 @@ func TestNewIssueExclusiveLabel(t *testing.T) { exclusiveLabelB := unittest.AssertExistsAndLoadBean(t, &issues_model.Label{ID: 8}) // coexisting regular and exclusive label - assert.NoError(t, issues_model.NewIssueLabel(issue, otherLabel, doer)) - assert.NoError(t, issues_model.NewIssueLabel(issue, exclusiveLabelA, doer)) + assert.NoError(t, issues_model.NewIssueLabel(db.DefaultContext, issue, otherLabel, doer)) + assert.NoError(t, issues_model.NewIssueLabel(db.DefaultContext, issue, exclusiveLabelA, doer)) unittest.AssertExistsAndLoadBean(t, &issues_model.IssueLabel{IssueID: issue.ID, LabelID: otherLabel.ID}) unittest.AssertExistsAndLoadBean(t, &issues_model.IssueLabel{IssueID: issue.ID, LabelID: exclusiveLabelA.ID}) // exclusive label replaces existing one - assert.NoError(t, issues_model.NewIssueLabel(issue, exclusiveLabelB, doer)) + assert.NoError(t, issues_model.NewIssueLabel(db.DefaultContext, issue, exclusiveLabelB, doer)) unittest.AssertExistsAndLoadBean(t, &issues_model.IssueLabel{IssueID: issue.ID, LabelID: otherLabel.ID}) unittest.AssertExistsAndLoadBean(t, &issues_model.IssueLabel{IssueID: issue.ID, LabelID: exclusiveLabelB.ID}) unittest.AssertNotExistsBean(t, &issues_model.IssueLabel{IssueID: issue.ID, LabelID: exclusiveLabelA.ID}) // exclusive label replaces existing one again - assert.NoError(t, issues_model.NewIssueLabel(issue, exclusiveLabelA, doer)) + assert.NoError(t, issues_model.NewIssueLabel(db.DefaultContext, issue, exclusiveLabelA, doer)) unittest.AssertExistsAndLoadBean(t, &issues_model.IssueLabel{IssueID: issue.ID, LabelID: otherLabel.ID}) unittest.AssertExistsAndLoadBean(t, &issues_model.IssueLabel{IssueID: issue.ID, LabelID: exclusiveLabelA.ID}) unittest.AssertNotExistsBean(t, &issues_model.IssueLabel{IssueID: issue.ID, LabelID: exclusiveLabelB.ID}) @@ -359,7 +359,7 @@ func TestNewIssueLabels(t *testing.T) { issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: 5}) doer := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) - assert.NoError(t, issues_model.NewIssueLabels(issue, []*issues_model.Label{label1, label2}, doer)) + assert.NoError(t, issues_model.NewIssueLabels(db.DefaultContext, issue, []*issues_model.Label{label1, label2}, doer)) unittest.AssertExistsAndLoadBean(t, &issues_model.IssueLabel{IssueID: issue.ID, LabelID: label1.ID}) unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{ Type: issues_model.CommentTypeLabel, @@ -377,7 +377,7 @@ func TestNewIssueLabels(t *testing.T) { assert.EqualValues(t, 1, label2.NumClosedIssues) // corner case: test empty slice - assert.NoError(t, issues_model.NewIssueLabels(issue, []*issues_model.Label{}, doer)) + assert.NoError(t, issues_model.NewIssueLabels(db.DefaultContext, issue, []*issues_model.Label{}, doer)) unittest.CheckConsistencyFor(t, &issues_model.Issue{}, &issues_model.Label{}) } diff --git a/models/issues/milestone_list.go b/models/issues/milestone_list.go index d5c9b1358c..d55c18a995 100644 --- a/models/issues/milestone_list.go +++ b/models/issues/milestone_list.go @@ -58,8 +58,8 @@ func (opts GetMilestonesOption) toCond() builder.Cond { } // GetMilestones returns milestones filtered by GetMilestonesOption's -func GetMilestones(opts GetMilestonesOption) (MilestoneList, int64, error) { - sess := db.GetEngine(db.DefaultContext).Where(opts.toCond()) +func GetMilestones(ctx context.Context, opts GetMilestonesOption) (MilestoneList, int64, error) { + sess := db.GetEngine(ctx).Where(opts.toCond()) if opts.Page != 0 { sess = db.SetSessionPagination(sess, &opts) diff --git a/models/issues/milestone_test.go b/models/issues/milestone_test.go index 403eeaadb3..ecfccf6ddb 100644 --- a/models/issues/milestone_test.go +++ b/models/issues/milestone_test.go @@ -40,7 +40,7 @@ func TestGetMilestonesByRepoID(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) test := func(repoID int64, state api.StateType) { repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: repoID}) - milestones, _, err := issues_model.GetMilestones(issues_model.GetMilestonesOption{ + milestones, _, err := issues_model.GetMilestones(db.DefaultContext, issues_model.GetMilestonesOption{ RepoID: repo.ID, State: state, }) @@ -77,7 +77,7 @@ func TestGetMilestonesByRepoID(t *testing.T) { test(3, api.StateClosed) test(3, api.StateAll) - milestones, _, err := issues_model.GetMilestones(issues_model.GetMilestonesOption{ + milestones, _, err := issues_model.GetMilestones(db.DefaultContext, issues_model.GetMilestonesOption{ RepoID: unittest.NonexistentID, State: api.StateOpen, }) @@ -90,7 +90,7 @@ func TestGetMilestones(t *testing.T) { repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1}) test := func(sortType string, sortCond func(*issues_model.Milestone) int) { for _, page := range []int{0, 1} { - milestones, _, err := issues_model.GetMilestones(issues_model.GetMilestonesOption{ + milestones, _, err := issues_model.GetMilestones(db.DefaultContext, issues_model.GetMilestonesOption{ ListOptions: db.ListOptions{ Page: page, PageSize: setting.UI.IssuePagingNum, @@ -107,7 +107,7 @@ func TestGetMilestones(t *testing.T) { } assert.True(t, sort.IntsAreSorted(values)) - milestones, _, err = issues_model.GetMilestones(issues_model.GetMilestonesOption{ + milestones, _, err = issues_model.GetMilestones(db.DefaultContext, issues_model.GetMilestonesOption{ ListOptions: db.ListOptions{ Page: page, PageSize: setting.UI.IssuePagingNum, diff --git a/models/issues/pull.go b/models/issues/pull.go index 9adcaee1a1..971ce049c3 100644 --- a/models/issues/pull.go +++ b/models/issues/pull.go @@ -378,9 +378,9 @@ func (pr *PullRequest) GetApprovalCounts(ctx context.Context) ([]*ReviewCount, e } // GetApprovers returns the approvers of the pull request -func (pr *PullRequest) GetApprovers() string { +func (pr *PullRequest) GetApprovers(ctx context.Context) string { stringBuilder := strings.Builder{} - if err := pr.getReviewedByLines(&stringBuilder); err != nil { + if err := pr.getReviewedByLines(ctx, &stringBuilder); err != nil { log.Error("Unable to getReviewedByLines: Error: %v", err) return "" } @@ -388,14 +388,14 @@ func (pr *PullRequest) GetApprovers() string { return stringBuilder.String() } -func (pr *PullRequest) getReviewedByLines(writer io.Writer) error { +func (pr *PullRequest) getReviewedByLines(ctx context.Context, writer io.Writer) error { maxReviewers := setting.Repository.PullRequest.DefaultMergeMessageMaxApprovers if maxReviewers == 0 { return nil } - ctx, committer, err := db.TxContext(db.DefaultContext) + ctx, committer, err := db.TxContext(ctx) if err != nil { return err } @@ -594,9 +594,9 @@ func GetUnmergedPullRequest(ctx context.Context, headRepoID, baseRepoID int64, h // GetLatestPullRequestByHeadInfo returns the latest pull request (regardless of its status) // by given head information (repo and branch). -func GetLatestPullRequestByHeadInfo(repoID int64, branch string) (*PullRequest, error) { +func GetLatestPullRequestByHeadInfo(ctx context.Context, repoID int64, branch string) (*PullRequest, error) { pr := new(PullRequest) - has, err := db.GetEngine(db.DefaultContext). + has, err := db.GetEngine(ctx). Where("head_repo_id = ? AND head_branch = ? AND flow = ?", repoID, branch, PullRequestFlowGithub). OrderBy("id DESC"). Get(pr) @@ -646,9 +646,9 @@ func GetPullRequestByID(ctx context.Context, id int64) (*PullRequest, error) { } // GetPullRequestByIssueIDWithNoAttributes returns pull request with no attributes loaded by given issue ID. -func GetPullRequestByIssueIDWithNoAttributes(issueID int64) (*PullRequest, error) { +func GetPullRequestByIssueIDWithNoAttributes(ctx context.Context, issueID int64) (*PullRequest, error) { var pr PullRequest - has, err := db.GetEngine(db.DefaultContext).Where("issue_id = ?", issueID).Get(&pr) + has, err := db.GetEngine(ctx).Where("issue_id = ?", issueID).Get(&pr) if err != nil { return nil, err } @@ -687,14 +687,14 @@ func GetAllUnmergedAgitPullRequestByPoster(ctx context.Context, uid int64) ([]*P } // Update updates all fields of pull request. -func (pr *PullRequest) Update() error { - _, err := db.GetEngine(db.DefaultContext).ID(pr.ID).AllCols().Update(pr) +func (pr *PullRequest) Update(ctx context.Context) error { + _, err := db.GetEngine(ctx).ID(pr.ID).AllCols().Update(pr) return err } // UpdateCols updates specific fields of pull request. -func (pr *PullRequest) UpdateCols(cols ...string) error { - _, err := db.GetEngine(db.DefaultContext).ID(pr.ID).Cols(cols...).Update(pr) +func (pr *PullRequest) UpdateCols(ctx context.Context, cols ...string) error { + _, err := db.GetEngine(ctx).ID(pr.ID).Cols(cols...).Update(pr) return err } @@ -706,8 +706,8 @@ func (pr *PullRequest) UpdateColsIfNotMerged(ctx context.Context, cols ...string // IsWorkInProgress determine if the Pull Request is a Work In Progress by its title // Issue must be set before this method can be called. -func (pr *PullRequest) IsWorkInProgress() bool { - if err := pr.LoadIssue(db.DefaultContext); err != nil { +func (pr *PullRequest) IsWorkInProgress(ctx context.Context) bool { + if err := pr.LoadIssue(ctx); err != nil { log.Error("LoadIssue: %v", err) return false } @@ -774,8 +774,8 @@ func GetPullRequestsByHeadBranch(ctx context.Context, headBranch string, headRep } // GetBaseBranchLink returns the relative URL of the base branch -func (pr *PullRequest) GetBaseBranchLink() string { - if err := pr.LoadBaseRepo(db.DefaultContext); err != nil { +func (pr *PullRequest) GetBaseBranchLink(ctx context.Context) string { + if err := pr.LoadBaseRepo(ctx); err != nil { log.Error("LoadBaseRepo: %v", err) return "" } @@ -786,12 +786,12 @@ func (pr *PullRequest) GetBaseBranchLink() string { } // GetHeadBranchLink returns the relative URL of the head branch -func (pr *PullRequest) GetHeadBranchLink() string { +func (pr *PullRequest) GetHeadBranchLink(ctx context.Context) string { if pr.Flow == PullRequestFlowAGit { return "" } - if err := pr.LoadHeadRepo(db.DefaultContext); err != nil { + if err := pr.LoadHeadRepo(ctx); err != nil { log.Error("LoadHeadRepo: %v", err) return "" } @@ -810,14 +810,14 @@ func UpdateAllowEdits(ctx context.Context, pr *PullRequest) error { } // Mergeable returns if the pullrequest is mergeable. -func (pr *PullRequest) Mergeable() bool { +func (pr *PullRequest) Mergeable(ctx context.Context) bool { // If a pull request isn't mergable if it's: // - Being conflict checked. // - Has a conflict. // - Received a error while being conflict checked. // - Is a work-in-progress pull request. return pr.Status != PullRequestStatusChecking && pr.Status != PullRequestStatusConflict && - pr.Status != PullRequestStatusError && !pr.IsWorkInProgress() + pr.Status != PullRequestStatusError && !pr.IsWorkInProgress(ctx) } // HasEnoughApprovals returns true if pr has enough granted approvals. @@ -890,7 +890,7 @@ func MergeBlockedByOutdatedBranch(protectBranch *git_model.ProtectedBranch, pr * func PullRequestCodeOwnersReview(ctx context.Context, pull *Issue, pr *PullRequest) error { files := []string{"CODEOWNERS", "docs/CODEOWNERS", ".gitea/CODEOWNERS"} - if pr.IsWorkInProgress() { + if pr.IsWorkInProgress(ctx) { return nil } diff --git a/models/issues/pull_test.go b/models/issues/pull_test.go index 3636263c46..173417136c 100644 --- a/models/issues/pull_test.go +++ b/models/issues/pull_test.go @@ -213,7 +213,7 @@ func TestPullRequest_Update(t *testing.T) { pr := unittest.AssertExistsAndLoadBean(t, &issues_model.PullRequest{ID: 1}) pr.BaseBranch = "baseBranch" pr.HeadBranch = "headBranch" - pr.Update() + pr.Update(db.DefaultContext) pr = unittest.AssertExistsAndLoadBean(t, &issues_model.PullRequest{ID: pr.ID}) assert.Equal(t, "baseBranch", pr.BaseBranch) @@ -228,7 +228,7 @@ func TestPullRequest_UpdateCols(t *testing.T) { BaseBranch: "baseBranch", HeadBranch: "headBranch", } - assert.NoError(t, pr.UpdateCols("head_branch")) + assert.NoError(t, pr.UpdateCols(db.DefaultContext, "head_branch")) pr = unittest.AssertExistsAndLoadBean(t, &issues_model.PullRequest{ID: 1}) assert.Equal(t, "master", pr.BaseBranch) @@ -260,13 +260,13 @@ func TestPullRequest_IsWorkInProgress(t *testing.T) { pr := unittest.AssertExistsAndLoadBean(t, &issues_model.PullRequest{ID: 2}) pr.LoadIssue(db.DefaultContext) - assert.False(t, pr.IsWorkInProgress()) + assert.False(t, pr.IsWorkInProgress(db.DefaultContext)) pr.Issue.Title = "WIP: " + pr.Issue.Title - assert.True(t, pr.IsWorkInProgress()) + assert.True(t, pr.IsWorkInProgress(db.DefaultContext)) pr.Issue.Title = "[wip]: " + pr.Issue.Title - assert.True(t, pr.IsWorkInProgress()) + assert.True(t, pr.IsWorkInProgress(db.DefaultContext)) } func TestPullRequest_GetWorkInProgressPrefixWorkInProgress(t *testing.T) { @@ -334,7 +334,7 @@ func TestGetApprovers(t *testing.T) { // Official reviews are already deduplicated. Allow unofficial reviews // to assert that there are no duplicated approvers. setting.Repository.PullRequest.DefaultMergeMessageOfficialApproversOnly = false - approvers := pr.GetApprovers() + approvers := pr.GetApprovers(db.DefaultContext) expected := "Reviewed-by: User Five \nReviewed-by: Org Six \n" assert.EqualValues(t, expected, approvers) } diff --git a/models/repo.go b/models/repo.go index 82433ca055..d525264b3b 100644 --- a/models/repo.go +++ b/models/repo.go @@ -277,8 +277,8 @@ func UpdateRepoStats(ctx context.Context, id int64) error { return nil } -func updateUserStarNumbers(users []user_model.User) error { - ctx, committer, err := db.TxContext(db.DefaultContext) +func updateUserStarNumbers(ctx context.Context, users []user_model.User) error { + ctx, committer, err := db.TxContext(ctx) if err != nil { return err } @@ -294,19 +294,19 @@ func updateUserStarNumbers(users []user_model.User) error { } // DoctorUserStarNum recalculate Stars number for all user -func DoctorUserStarNum() (err error) { +func DoctorUserStarNum(ctx context.Context) (err error) { const batchSize = 100 for start := 0; ; start += batchSize { users := make([]user_model.User, 0, batchSize) - if err = db.GetEngine(db.DefaultContext).Limit(batchSize, start).Where("type = ?", 0).Cols("id").Find(&users); err != nil { + if err = db.GetEngine(ctx).Limit(batchSize, start).Where("type = ?", 0).Cols("id").Find(&users); err != nil { return err } if len(users) == 0 { break } - if err = updateUserStarNumbers(users); err != nil { + if err = updateUserStarNumbers(ctx, users); err != nil { return err } } diff --git a/models/repo/avatar.go b/models/repo/avatar.go index a76a949267..72ee938ada 100644 --- a/models/repo/avatar.go +++ b/models/repo/avatar.go @@ -31,8 +31,8 @@ func ExistsWithAvatarAtStoragePath(ctx context.Context, storagePath string) (boo } // RelAvatarLink returns a relative link to the repository's avatar. -func (repo *Repository) RelAvatarLink() string { - return repo.relAvatarLink(db.DefaultContext) +func (repo *Repository) RelAvatarLink(ctx context.Context) string { + return repo.relAvatarLink(ctx) } // generateRandomAvatar generates a random avatar for repository. diff --git a/models/repo/language_stats.go b/models/repo/language_stats.go index 2da16814bd..0bc0f1fb40 100644 --- a/models/repo/language_stats.go +++ b/models/repo/language_stats.go @@ -108,8 +108,8 @@ func GetLanguageStats(ctx context.Context, repo *Repository) (LanguageStatList, } // GetTopLanguageStats returns the top language statistics for a repository -func GetTopLanguageStats(repo *Repository, limit int) (LanguageStatList, error) { - stats, err := GetLanguageStats(db.DefaultContext, repo) +func GetTopLanguageStats(ctx context.Context, repo *Repository, limit int) (LanguageStatList, error) { + stats, err := GetLanguageStats(ctx, repo) if err != nil { return nil, err } @@ -140,8 +140,8 @@ func GetTopLanguageStats(repo *Repository, limit int) (LanguageStatList, error) } // UpdateLanguageStats updates the language statistics for repository -func UpdateLanguageStats(repo *Repository, commitID string, stats map[string]int64) error { - ctx, committer, err := db.TxContext(db.DefaultContext) +func UpdateLanguageStats(ctx context.Context, repo *Repository, commitID string, stats map[string]int64) error { + ctx, committer, err := db.TxContext(ctx) if err != nil { return err } @@ -212,8 +212,8 @@ func UpdateLanguageStats(repo *Repository, commitID string, stats map[string]int } // CopyLanguageStat Copy originalRepo language stat information to destRepo (use for forked repo) -func CopyLanguageStat(originalRepo, destRepo *Repository) error { - ctx, committer, err := db.TxContext(db.DefaultContext) +func CopyLanguageStat(ctx context.Context, originalRepo, destRepo *Repository) error { + ctx, committer, err := db.TxContext(ctx) if err != nil { return err } diff --git a/models/repo/repo.go b/models/repo/repo.go index 0b0c029993..c4b215e074 100644 --- a/models/repo/repo.go +++ b/models/repo/repo.go @@ -447,7 +447,7 @@ func (repo *Repository) MustOwner(ctx context.Context) *user_model.User { } // ComposeMetas composes a map of metas for properly rendering issue links and external issue trackers. -func (repo *Repository) ComposeMetas() map[string]string { +func (repo *Repository) ComposeMetas(ctx context.Context) map[string]string { if len(repo.RenderingMetas) == 0 { metas := map[string]string{ "user": repo.OwnerName, @@ -456,7 +456,7 @@ func (repo *Repository) ComposeMetas() map[string]string { "mode": "comment", } - unit, err := repo.GetUnit(db.DefaultContext, unit.TypeExternalTracker) + unit, err := repo.GetUnit(ctx, unit.TypeExternalTracker) if err == nil { metas["format"] = unit.ExternalTrackerConfig().ExternalTrackerFormat switch unit.ExternalTrackerConfig().ExternalTrackerStyle { @@ -470,10 +470,10 @@ func (repo *Repository) ComposeMetas() map[string]string { } } - repo.MustOwner(db.DefaultContext) + repo.MustOwner(ctx) if repo.Owner.IsOrganization() { teams := make([]string, 0, 5) - _ = db.GetEngine(db.DefaultContext).Table("team_repo"). + _ = db.GetEngine(ctx).Table("team_repo"). Join("INNER", "team", "team.id = team_repo.team_id"). Where("team_repo.repo_id = ?", repo.ID). Select("team.lower_name"). @@ -489,10 +489,10 @@ func (repo *Repository) ComposeMetas() map[string]string { } // ComposeDocumentMetas composes a map of metas for properly rendering documents -func (repo *Repository) ComposeDocumentMetas() map[string]string { +func (repo *Repository) ComposeDocumentMetas(ctx context.Context) map[string]string { if len(repo.DocumentRenderingMetas) == 0 { metas := map[string]string{} - for k, v := range repo.ComposeMetas() { + for k, v := range repo.ComposeMetas(ctx) { metas[k] = v } metas["mode"] = "document" @@ -566,8 +566,8 @@ func (repo *Repository) CanEnablePulls() bool { } // AllowsPulls returns true if repository meets the requirements of accepting pulls and has them enabled. -func (repo *Repository) AllowsPulls() bool { - return repo.CanEnablePulls() && repo.UnitEnabled(db.DefaultContext, unit.TypePullRequests) +func (repo *Repository) AllowsPulls(ctx context.Context) bool { + return repo.CanEnablePulls() && repo.UnitEnabled(ctx, unit.TypePullRequests) } // CanEnableEditor returns true if repository meets the requirements of web editor. @@ -718,12 +718,12 @@ func GetRepositoryByOwnerAndName(ctx context.Context, ownerName, repoName string } // GetRepositoryByName returns the repository by given name under user if exists. -func GetRepositoryByName(ownerID int64, name string) (*Repository, error) { +func GetRepositoryByName(ctx context.Context, ownerID int64, name string) (*Repository, error) { repo := &Repository{ OwnerID: ownerID, LowerName: strings.ToLower(name), } - has, err := db.GetEngine(db.DefaultContext).Get(repo) + has, err := db.GetEngine(ctx).Get(repo) if err != nil { return nil, err } else if !has { @@ -788,9 +788,9 @@ func GetRepositoryByID(ctx context.Context, id int64) (*Repository, error) { } // GetRepositoriesMapByIDs returns the repositories by given id slice. -func GetRepositoriesMapByIDs(ids []int64) (map[int64]*Repository, error) { +func GetRepositoriesMapByIDs(ctx context.Context, ids []int64) (map[int64]*Repository, error) { repos := make(map[int64]*Repository, len(ids)) - return repos, db.GetEngine(db.DefaultContext).In("id", ids).Find(&repos) + return repos, db.GetEngine(ctx).In("id", ids).Find(&repos) } // IsRepositoryModelOrDirExist returns true if the repository with given name under user has already existed. @@ -822,8 +822,8 @@ func GetTemplateRepo(ctx context.Context, repo *Repository) (*Repository, error) } // TemplateRepo returns the repository, which is template of this repository -func (repo *Repository) TemplateRepo() *Repository { - repo, err := GetTemplateRepo(db.DefaultContext, repo) +func (repo *Repository) TemplateRepo(ctx context.Context) *Repository { + repo, err := GetTemplateRepo(ctx, repo) if err != nil { log.Error("TemplateRepo: %v", err) return nil diff --git a/models/repo/repo_indexer.go b/models/repo/repo_indexer.go index 9667c56244..bad1248b40 100644 --- a/models/repo/repo_indexer.go +++ b/models/repo/repo_indexer.go @@ -36,14 +36,14 @@ func init() { } // GetUnindexedRepos returns repos which do not have an indexer status -func GetUnindexedRepos(indexerType RepoIndexerType, maxRepoID int64, page, pageSize int) ([]int64, error) { +func GetUnindexedRepos(ctx context.Context, indexerType RepoIndexerType, maxRepoID int64, page, pageSize int) ([]int64, error) { ids := make([]int64, 0, 50) cond := builder.Cond(builder.IsNull{ "repo_indexer_status.id", }).And(builder.Eq{ "repository.is_empty": false, }) - sess := db.GetEngine(db.DefaultContext).Table("repository").Join("LEFT OUTER", "repo_indexer_status", "repository.id = repo_indexer_status.repo_id AND repo_indexer_status.indexer_type = ?", indexerType) + sess := db.GetEngine(ctx).Table("repository").Join("LEFT OUTER", "repo_indexer_status", "repository.id = repo_indexer_status.repo_id AND repo_indexer_status.indexer_type = ?", indexerType) if maxRepoID > 0 { cond = builder.And(cond, builder.Lte{ "repository.id": maxRepoID, diff --git a/models/repo/repo_list.go b/models/repo/repo_list.go index a0485ed8d4..4a703dc584 100644 --- a/models/repo/repo_list.go +++ b/models/repo/repo_list.go @@ -21,8 +21,8 @@ import ( ) // FindReposMapByIDs find repos as map -func FindReposMapByIDs(repoIDs []int64, res map[int64]*Repository) error { - return db.GetEngine(db.DefaultContext).In("id", repoIDs).Find(&res) +func FindReposMapByIDs(ctx context.Context, repoIDs []int64, res map[int64]*Repository) error { + return db.GetEngine(ctx).In("id", repoIDs).Find(&res) } // RepositoryListDefaultPageSize is the default number of repositories @@ -672,12 +672,12 @@ func SearchRepositoryByName(ctx context.Context, opts *SearchRepoOptions) (Repos // SearchRepositoryIDs takes keyword and part of repository name to search, // it returns results in given range and number of total results. -func SearchRepositoryIDs(opts *SearchRepoOptions) ([]int64, int64, error) { +func SearchRepositoryIDs(ctx context.Context, opts *SearchRepoOptions) ([]int64, int64, error) { opts.IncludeDescription = false cond := SearchRepositoryCondition(opts) - sess, count, err := searchRepositoryByCondition(db.DefaultContext, opts, cond) + sess, count, err := searchRepositoryByCondition(ctx, opts, cond) if err != nil { return nil, 0, err } diff --git a/models/repo/repo_test.go b/models/repo/repo_test.go index fb021561c3..4bbfeb634a 100644 --- a/models/repo/repo_test.go +++ b/models/repo/repo_test.go @@ -83,7 +83,7 @@ func TestMetas(t *testing.T) { repo.Units = nil - metas := repo.ComposeMetas() + metas := repo.ComposeMetas(db.DefaultContext) assert.Equal(t, "testRepo", metas["repo"]) assert.Equal(t, "testOwner", metas["user"]) @@ -97,7 +97,7 @@ func TestMetas(t *testing.T) { testSuccess := func(expectedStyle string) { repo.Units = []*repo_model.RepoUnit{&externalTracker} repo.RenderingMetas = nil - metas := repo.ComposeMetas() + metas := repo.ComposeMetas(db.DefaultContext) assert.Equal(t, expectedStyle, metas["style"]) assert.Equal(t, "testRepo", metas["repo"]) assert.Equal(t, "testOwner", metas["user"]) @@ -118,7 +118,7 @@ func TestMetas(t *testing.T) { repo, err := repo_model.GetRepositoryByID(db.DefaultContext, 3) assert.NoError(t, err) - metas = repo.ComposeMetas() + metas = repo.ComposeMetas(db.DefaultContext) assert.Contains(t, metas, "org") assert.Contains(t, metas, "teams") assert.Equal(t, "org3", metas["org"]) diff --git a/models/repo_test.go b/models/repo_test.go index da66b16136..2a8a4a743e 100644 --- a/models/repo_test.go +++ b/models/repo_test.go @@ -20,5 +20,5 @@ func TestCheckRepoStats(t *testing.T) { func TestDoctorUserStarNum(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) - assert.NoError(t, DoctorUserStarNum()) + assert.NoError(t, DoctorUserStarNum(db.DefaultContext)) } diff --git a/modules/context/repo.go b/modules/context/repo.go index 18b6650b6e..b340a6e230 100644 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -495,7 +495,7 @@ func RepoAssignment(ctx *Context) context.CancelFunc { } // Get repository. - repo, err := repo_model.GetRepositoryByName(owner.ID, repoName) + repo, err := repo_model.GetRepositoryByName(ctx, owner.ID, repoName) if err != nil { if repo_model.IsErrRepoNotExist(err) { redirectRepoID, err := repo_model.LookupRedirect(owner.ID, repoName) @@ -711,13 +711,13 @@ func RepoAssignment(ctx *Context) context.CancelFunc { // Pull request is allowed if this is a fork repository // and base repository accepts pull requests. - if repo.BaseRepo != nil && repo.BaseRepo.AllowsPulls() { + if repo.BaseRepo != nil && repo.BaseRepo.AllowsPulls(ctx) { canCompare = true ctx.Data["BaseRepo"] = repo.BaseRepo ctx.Repo.PullRequest.BaseRepo = repo.BaseRepo ctx.Repo.PullRequest.Allowed = canPush ctx.Repo.PullRequest.HeadInfoSubURL = url.PathEscape(ctx.Repo.Owner.Name) + ":" + util.PathEscapeSegments(ctx.Repo.BranchName) - } else if repo.AllowsPulls() { + } else if repo.AllowsPulls(ctx) { // Or, this is repository accepts pull requests between branches. canCompare = true ctx.Data["BaseRepo"] = repo diff --git a/modules/doctor/mergebase.go b/modules/doctor/mergebase.go index e79369e581..de460c4190 100644 --- a/modules/doctor/mergebase.go +++ b/modules/doctor/mergebase.go @@ -74,7 +74,7 @@ func checkPRMergeBase(ctx context.Context, logger log.Logger, autofix bool) erro pr.MergeBase = strings.TrimSpace(pr.MergeBase) if pr.MergeBase != oldMergeBase { if autofix { - if err := pr.UpdateCols("merge_base"); err != nil { + if err := pr.UpdateCols(ctx, "merge_base"); err != nil { logger.Critical("Failed to update merge_base. ERROR: %v", err) return fmt.Errorf("Failed to update merge_base. ERROR: %w", err) } diff --git a/modules/doctor/misc.go b/modules/doctor/misc.go index e01c3e109b..f0b5966b54 100644 --- a/modules/doctor/misc.go +++ b/modules/doctor/misc.go @@ -74,7 +74,7 @@ func checkHooks(ctx context.Context, logger log.Logger, autofix bool) error { func checkUserStarNum(ctx context.Context, logger log.Logger, autofix bool) error { if autofix { - if err := models.DoctorUserStarNum(); err != nil { + if err := models.DoctorUserStarNum(ctx); err != nil { logger.Critical("Unable update User Stars numbers") return err } diff --git a/modules/indexer/code/indexer.go b/modules/indexer/code/indexer.go index 019773fe51..ebebf6ba8a 100644 --- a/modules/indexer/code/indexer.go +++ b/modules/indexer/code/indexer.go @@ -288,7 +288,7 @@ func populateRepoIndexer(ctx context.Context) { return default: } - ids, err := repo_model.GetUnindexedRepos(repo_model.RepoIndexerTypeCode, maxRepoID, 0, 50) + ids, err := repo_model.GetUnindexedRepos(ctx, repo_model.RepoIndexerTypeCode, maxRepoID, 0, 50) if err != nil { log.Error("populateRepoIndexer: %v", err) return diff --git a/modules/indexer/issues/util.go b/modules/indexer/issues/util.go index 2dec3b71db..ca4ff6d42f 100644 --- a/modules/indexer/issues/util.go +++ b/modules/indexer/issues/util.go @@ -107,7 +107,7 @@ func getIssueIndexerData(ctx context.Context, issueID int64) (*internal.IndexerD NoLabel: len(labels) == 0, MilestoneID: issue.MilestoneID, ProjectID: projectID, - ProjectBoardID: issue.ProjectBoardID(), + ProjectBoardID: issue.ProjectBoardID(ctx), PosterID: issue.PosterID, AssigneeID: issue.AssigneeID, MentionIDs: mentionIDs, diff --git a/modules/indexer/stats/db.go b/modules/indexer/stats/db.go index 2a0475dea6..163843b47f 100644 --- a/modules/indexer/stats/db.go +++ b/modules/indexer/stats/db.go @@ -68,7 +68,7 @@ func (db *DBIndexer) Index(id int64) error { } return err } - err = repo_model.UpdateLanguageStats(repo, commitID, stats) + err = repo_model.UpdateLanguageStats(ctx, repo, commitID, stats) if err != nil { log.Error("Unable to update language stats for ID %s for default branch %s in %s. Error: %v", commitID, repo.DefaultBranch, repo.RepoPath(), err) return err diff --git a/modules/indexer/stats/indexer.go b/modules/indexer/stats/indexer.go index 6bfa8bdedb..7ec89e2afb 100644 --- a/modules/indexer/stats/indexer.go +++ b/modules/indexer/stats/indexer.go @@ -4,6 +4,8 @@ package stats import ( + "context" + "code.gitea.io/gitea/models/db" repo_model "code.gitea.io/gitea/models/repo" "code.gitea.io/gitea/modules/graceful" @@ -28,14 +30,14 @@ func Init() error { return err } - go populateRepoIndexer() + go populateRepoIndexer(db.DefaultContext) return nil } // populateRepoIndexer populate the repo indexer with pre-existing data. This // should only be run when the indexer is created for the first time. -func populateRepoIndexer() { +func populateRepoIndexer(ctx context.Context) { log.Info("Populating the repo stats indexer with existing repositories") isShutdown := graceful.GetManager().IsShutdown() @@ -62,7 +64,7 @@ func populateRepoIndexer() { return default: } - ids, err := repo_model.GetUnindexedRepos(repo_model.RepoIndexerTypeStats, maxRepoID, 0, 50) + ids, err := repo_model.GetUnindexedRepos(ctx, repo_model.RepoIndexerTypeStats, maxRepoID, 0, 50) if err != nil { log.Error("populateRepoIndexer: %v", err) return diff --git a/modules/indexer/stats/indexer_test.go b/modules/indexer/stats/indexer_test.go index 6f935a20de..5be45d7a3b 100644 --- a/modules/indexer/stats/indexer_test.go +++ b/modules/indexer/stats/indexer_test.go @@ -45,7 +45,7 @@ func TestRepoStatsIndex(t *testing.T) { status, err := repo_model.GetIndexerStatus(db.DefaultContext, repo, repo_model.RepoIndexerTypeStats) assert.NoError(t, err) assert.Equal(t, "65f1bf27bc3bf70f64657658635e66094edbcb4d", status.CommitSha) - langs, err := repo_model.GetTopLanguageStats(repo, 5) + langs, err := repo_model.GetTopLanguageStats(db.DefaultContext, repo, 5) assert.NoError(t, err) assert.Empty(t, langs) } diff --git a/routers/api/v1/admin/user.go b/routers/api/v1/admin/user.go index 610eba1749..09d7c1a940 100644 --- a/routers/api/v1/admin/user.go +++ b/routers/api/v1/admin/user.go @@ -36,7 +36,7 @@ func parseAuthSource(ctx *context.APIContext, u *user_model.User, sourceID int64 return } - source, err := auth.GetSourceByID(sourceID) + source, err := auth.GetSourceByID(ctx, sourceID) if err != nil { if auth.IsErrSourceNotExist(err) { ctx.Error(http.StatusUnprocessableEntity, "", err) diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index 441801885f..8abe51ea4f 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -70,6 +70,7 @@ import ( actions_model "code.gitea.io/gitea/models/actions" auth_model "code.gitea.io/gitea/models/auth" + "code.gitea.io/gitea/models/db" "code.gitea.io/gitea/models/organization" "code.gitea.io/gitea/models/perm" access_model "code.gitea.io/gitea/models/perm/access" @@ -165,7 +166,7 @@ func repoAssignment() func(ctx *context.APIContext) { ctx.ContextUser = owner // Get repository. - repo, err := repo_model.GetRepositoryByName(owner.ID, repoName) + repo, err := repo_model.GetRepositoryByName(ctx, owner.ID, repoName) if err != nil { if repo_model.IsErrRepoNotExist(err) { redirectRepoID, err := repo_model.LookupRedirect(owner.ID, repoName) @@ -716,7 +717,7 @@ func buildAuthGroup() *auth.Group { group.Add(&auth.ReverseProxy{}) } - if setting.IsWindows && auth_model.IsSSPIEnabled() { + if setting.IsWindows && auth_model.IsSSPIEnabled(db.DefaultContext) { group.Add(&auth.SSPI{}) // it MUST be the last, see the comment of SSPI } diff --git a/routers/api/v1/org/avatar.go b/routers/api/v1/org/avatar.go index a7b5008525..7b621a50c3 100644 --- a/routers/api/v1/org/avatar.go +++ b/routers/api/v1/org/avatar.go @@ -43,7 +43,7 @@ func UpdateAvatar(ctx *context.APIContext) { return } - err = user_service.UploadAvatar(ctx.Org.Organization.AsUser(), content) + err = user_service.UploadAvatar(ctx, ctx.Org.Organization.AsUser(), content) if err != nil { ctx.Error(http.StatusInternalServerError, "UploadAvatar", err) } @@ -69,7 +69,7 @@ func DeleteAvatar(ctx *context.APIContext) { // "$ref": "#/responses/empty" // "404": // "$ref": "#/responses/notFound" - err := user_service.DeleteAvatar(ctx.Org.Organization.AsUser()) + err := user_service.DeleteAvatar(ctx, ctx.Org.Organization.AsUser()) if err != nil { ctx.Error(http.StatusInternalServerError, "DeleteAvatar", err) } diff --git a/routers/api/v1/org/team.go b/routers/api/v1/org/team.go index 9b68253623..f129c66230 100644 --- a/routers/api/v1/org/team.go +++ b/routers/api/v1/org/team.go @@ -638,7 +638,7 @@ func GetTeamRepo(ctx *context.APIContext) { // getRepositoryByParams get repository by a team's organization ID and repo name func getRepositoryByParams(ctx *context.APIContext) *repo_model.Repository { - repo, err := repo_model.GetRepositoryByName(ctx.Org.Team.OrgID, ctx.Params(":reponame")) + repo, err := repo_model.GetRepositoryByName(ctx, ctx.Org.Team.OrgID, ctx.Params(":reponame")) if err != nil { if repo_model.IsErrRepoNotExist(err) { ctx.NotFound() diff --git a/routers/api/v1/repo/issue.go b/routers/api/v1/repo/issue.go index 58689b72a6..74e6361f6c 100644 --- a/routers/api/v1/repo/issue.go +++ b/routers/api/v1/repo/issue.go @@ -188,7 +188,7 @@ func SearchIssues(ctx *context.APIContext) { allPublic = true opts.AllPublic = false // set it false to avoid returning too many repos, we could filter by indexer } - repoIDs, _, err = repo_model.SearchRepositoryIDs(opts) + repoIDs, _, err = repo_model.SearchRepositoryIDs(ctx, opts) if err != nil { ctx.Error(http.StatusInternalServerError, "SearchRepositoryIDs", err) return @@ -837,7 +837,7 @@ func EditIssue(ctx *context.APIContext) { issue.MilestoneID != *form.Milestone { oldMilestoneID := issue.MilestoneID issue.MilestoneID = *form.Milestone - if err = issue_service.ChangeMilestoneAssign(issue, ctx.Doer, oldMilestoneID); err != nil { + if err = issue_service.ChangeMilestoneAssign(ctx, issue, ctx.Doer, oldMilestoneID); err != nil { ctx.Error(http.StatusInternalServerError, "ChangeMilestoneAssign", err) return } diff --git a/routers/api/v1/repo/issue_dependency.go b/routers/api/v1/repo/issue_dependency.go index 9571532800..0e3bcd93ef 100644 --- a/routers/api/v1/repo/issue_dependency.go +++ b/routers/api/v1/repo/issue_dependency.go @@ -576,7 +576,7 @@ func createIssueDependency(ctx *context.APIContext, target, dependency *issues_m return } - err := issues_model.CreateIssueDependency(ctx.Doer, target, dependency) + err := issues_model.CreateIssueDependency(ctx, ctx.Doer, target, dependency) if err != nil { ctx.Error(http.StatusInternalServerError, "CreateIssueDependency", err) return @@ -602,7 +602,7 @@ func removeIssueDependency(ctx *context.APIContext, target, dependency *issues_m return } - err := issues_model.RemoveIssueDependency(ctx.Doer, target, dependency, issues_model.DependencyTypeBlockedBy) + err := issues_model.RemoveIssueDependency(ctx, ctx.Doer, target, dependency, issues_model.DependencyTypeBlockedBy) if err != nil { ctx.Error(http.StatusInternalServerError, "CreateIssueDependency", err) return diff --git a/routers/api/v1/repo/key.go b/routers/api/v1/repo/key.go index 7d97f5f5e2..e2b7b49438 100644 --- a/routers/api/v1/repo/key.go +++ b/routers/api/v1/repo/key.go @@ -105,7 +105,7 @@ func ListDeployKeys(ctx *context.APIContext) { apiLink := composeDeployKeysAPILink(ctx.Repo.Owner.Name, ctx.Repo.Repository.Name) apiKeys := make([]*api.DeployKey, len(keys)) for i := range keys { - if err := keys[i].GetContent(); err != nil { + if err := keys[i].GetContent(ctx); err != nil { ctx.Error(http.StatusInternalServerError, "GetContent", err) return } @@ -159,7 +159,7 @@ func GetDeployKey(ctx *context.APIContext) { return } - if err = key.GetContent(); err != nil { + if err = key.GetContent(ctx); err != nil { ctx.Error(http.StatusInternalServerError, "GetContent", err) return } diff --git a/routers/api/v1/repo/milestone.go b/routers/api/v1/repo/milestone.go index 1a86444660..da470dfa74 100644 --- a/routers/api/v1/repo/milestone.go +++ b/routers/api/v1/repo/milestone.go @@ -58,7 +58,7 @@ func ListMilestones(ctx *context.APIContext) { // "404": // "$ref": "#/responses/notFound" - milestones, total, err := issues_model.GetMilestones(issues_model.GetMilestonesOption{ + milestones, total, err := issues_model.GetMilestones(ctx, issues_model.GetMilestonesOption{ ListOptions: utils.GetListOptions(ctx), RepoID: ctx.Repo.Repository.ID, State: api.StateType(ctx.FormString("state")), diff --git a/routers/api/v1/repo/pull.go b/routers/api/v1/repo/pull.go index 6fcc5267cf..df9e7217bb 100644 --- a/routers/api/v1/repo/pull.go +++ b/routers/api/v1/repo/pull.go @@ -555,7 +555,7 @@ func EditPullRequest(ctx *context.APIContext) { issue.MilestoneID != form.Milestone { oldMilestoneID := issue.MilestoneID issue.MilestoneID = form.Milestone - if err = issue_service.ChangeMilestoneAssign(issue, ctx.Doer, oldMilestoneID); err != nil { + if err = issue_service.ChangeMilestoneAssign(ctx, issue, ctx.Doer, oldMilestoneID); err != nil { ctx.Error(http.StatusInternalServerError, "ChangeMilestoneAssign", err) return } @@ -578,7 +578,7 @@ func EditPullRequest(ctx *context.APIContext) { labels = append(labels, orgLabels...) } - if err = issues_model.ReplaceIssueLabels(issue, labels, ctx.Doer); err != nil { + if err = issues_model.ReplaceIssueLabels(ctx, issue, labels, ctx.Doer); err != nil { ctx.Error(http.StatusInternalServerError, "ReplaceLabelsError", err) return } diff --git a/routers/api/v1/user/avatar.go b/routers/api/v1/user/avatar.go index 84fa129b13..1c1bb6181a 100644 --- a/routers/api/v1/user/avatar.go +++ b/routers/api/v1/user/avatar.go @@ -36,7 +36,7 @@ func UpdateAvatar(ctx *context.APIContext) { return } - err = user_service.UploadAvatar(ctx.Doer, content) + err = user_service.UploadAvatar(ctx, ctx.Doer, content) if err != nil { ctx.Error(http.StatusInternalServerError, "UploadAvatar", err) } @@ -54,7 +54,7 @@ func DeleteAvatar(ctx *context.APIContext) { // responses: // "204": // "$ref": "#/responses/empty" - err := user_service.DeleteAvatar(ctx.Doer) + err := user_service.DeleteAvatar(ctx, ctx.Doer) if err != nil { ctx.Error(http.StatusInternalServerError, "DeleteAvatar", err) } diff --git a/routers/api/v1/user/key.go b/routers/api/v1/user/key.go index 7fc10e82f2..fd891699ce 100644 --- a/routers/api/v1/user/key.go +++ b/routers/api/v1/user/key.go @@ -59,14 +59,14 @@ func listPublicKeys(ctx *context.APIContext, user *user_model.User) { // Querying not just listing if username != "" { // Restrict to provided uid - keys, err = asymkey_model.SearchPublicKey(user.ID, fingerprint) + keys, err = asymkey_model.SearchPublicKey(ctx, user.ID, fingerprint) } else { // Unrestricted - keys, err = asymkey_model.SearchPublicKey(0, fingerprint) + keys, err = asymkey_model.SearchPublicKey(ctx, 0, fingerprint) } count = len(keys) } else { - total, err2 := asymkey_model.CountPublicKeys(user.ID) + total, err2 := asymkey_model.CountPublicKeys(ctx, user.ID) if err2 != nil { ctx.InternalServerError(err) return @@ -74,7 +74,7 @@ func listPublicKeys(ctx *context.APIContext, user *user_model.User) { count = int(total) // Use ListPublicKeys - keys, err = asymkey_model.ListPublicKeys(user.ID, utils.GetListOptions(ctx)) + keys, err = asymkey_model.ListPublicKeys(ctx, user.ID, utils.GetListOptions(ctx)) } if err != nil { @@ -176,7 +176,7 @@ func GetPublicKey(ctx *context.APIContext) { // "404": // "$ref": "#/responses/notFound" - key, err := asymkey_model.GetPublicKeyByID(ctx.ParamsInt64(":id")) + key, err := asymkey_model.GetPublicKeyByID(ctx, ctx.ParamsInt64(":id")) if err != nil { if asymkey_model.IsErrKeyNotExist(err) { ctx.NotFound() @@ -202,7 +202,7 @@ func CreateUserPublicKey(ctx *context.APIContext, form api.CreateKeyOption, uid return } - key, err := asymkey_model.AddPublicKey(uid, form.Title, content, 0) + key, err := asymkey_model.AddPublicKey(ctx, uid, form.Title, content, 0) if err != nil { repo.HandleAddKeyError(ctx, err) return @@ -262,7 +262,7 @@ func DeletePublicKey(ctx *context.APIContext) { // "$ref": "#/responses/notFound" id := ctx.ParamsInt64(":id") - externallyManaged, err := asymkey_model.PublicKeyIsExternallyManaged(id) + externallyManaged, err := asymkey_model.PublicKeyIsExternallyManaged(ctx, id) if err != nil { if asymkey_model.IsErrKeyNotExist(err) { ctx.NotFound() diff --git a/routers/common/markup.go b/routers/common/markup.go index 5f412014d7..aaedc13de9 100644 --- a/routers/common/markup.go +++ b/routers/common/markup.go @@ -65,9 +65,9 @@ func RenderMarkup(ctx *context.Base, repo *context.Repository, mode, text, urlPr meta := map[string]string{} if repo != nil && repo.Repository != nil { if mode == "comment" { - meta = repo.Repository.ComposeMetas() + meta = repo.Repository.ComposeMetas(ctx) } else { - meta = repo.Repository.ComposeDocumentMetas() + meta = repo.Repository.ComposeDocumentMetas(ctx) } } if mode != "comment" { diff --git a/routers/init.go b/routers/init.go index 3cd63eb9ae..0da510cc59 100644 --- a/routers/init.go +++ b/routers/init.go @@ -121,7 +121,7 @@ func InitWebInstalled(ctx context.Context) { mustInit(cache.NewContext) mustInit(feed_service.Init) mustInit(uinotification.Init) - mustInit(archiver.Init) + mustInitCtx(ctx, archiver.Init) highlight.NewContext() external.RegisterRenderers() diff --git a/routers/private/actions.go b/routers/private/actions.go index 74515256da..025a6a2c39 100644 --- a/routers/private/actions.go +++ b/routers/private/actions.go @@ -83,7 +83,7 @@ func parseScope(ctx *context.PrivateContext, scope string) (ownerID, repoID int6 return ownerID, repoID, nil } - r, err := repo_model.GetRepositoryByName(u.ID, repoName) + r, err := repo_model.GetRepositoryByName(ctx, u.ID, repoName) if err != nil { return ownerID, repoID, err } diff --git a/routers/private/hook_post_receive.go b/routers/private/hook_post_receive.go index 0c9a2a10fa..d5a46e4e7f 100644 --- a/routers/private/hook_post_receive.go +++ b/routers/private/hook_post_receive.go @@ -150,7 +150,7 @@ func HookPostReceive(ctx *gitea_context.PrivateContext) { } results = append(results, private.HookPostReceiveBranchResult{ - Message: setting.Git.PullRequestPushMessage && repo.AllowsPulls(), + Message: setting.Git.PullRequestPushMessage && repo.AllowsPulls(ctx), Create: false, Branch: "", URL: fmt.Sprintf("%s/pulls/%d", repo.HTMLURL(), pr.Index), @@ -179,12 +179,12 @@ func HookPostReceive(ctx *gitea_context.PrivateContext) { }) return } - if repo.BaseRepo.AllowsPulls() { + if repo.BaseRepo.AllowsPulls(ctx) { baseRepo = repo.BaseRepo } } - if !baseRepo.AllowsPulls() { + if !baseRepo.AllowsPulls(ctx) { // We can stop there's no need to go any further ctx.JSON(http.StatusOK, private.HookPostReceiveResult{ RepoWasEmpty: wasEmpty, @@ -217,14 +217,14 @@ func HookPostReceive(ctx *gitea_context.PrivateContext) { branch = fmt.Sprintf("%s:%s", repo.OwnerName, branch) } results = append(results, private.HookPostReceiveBranchResult{ - Message: setting.Git.PullRequestPushMessage && baseRepo.AllowsPulls(), + Message: setting.Git.PullRequestPushMessage && baseRepo.AllowsPulls(ctx), Create: true, Branch: branch, URL: fmt.Sprintf("%s/compare/%s...%s", baseRepo.HTMLURL(), util.PathEscapeSegments(baseRepo.DefaultBranch), util.PathEscapeSegments(branch)), }) } else { results = append(results, private.HookPostReceiveBranchResult{ - Message: setting.Git.PullRequestPushMessage && baseRepo.AllowsPulls(), + Message: setting.Git.PullRequestPushMessage && baseRepo.AllowsPulls(ctx), Create: false, Branch: branch, URL: fmt.Sprintf("%s/pulls/%d", baseRepo.HTMLURL(), pr.Index), diff --git a/routers/private/key.go b/routers/private/key.go index a13b4c12ae..176e5ffcc8 100644 --- a/routers/private/key.go +++ b/routers/private/key.go @@ -16,7 +16,7 @@ import ( func UpdatePublicKeyInRepo(ctx *context.PrivateContext) { keyID := ctx.ParamsInt64(":id") repoID := ctx.ParamsInt64(":repoid") - if err := asymkey_model.UpdatePublicKeyUpdated(keyID); err != nil { + if err := asymkey_model.UpdatePublicKeyUpdated(ctx, keyID); err != nil { ctx.JSON(http.StatusInternalServerError, private.Response{ Err: err.Error(), }) diff --git a/routers/private/serv.go b/routers/private/serv.go index b1efc58800..00731947a5 100644 --- a/routers/private/serv.go +++ b/routers/private/serv.go @@ -33,7 +33,7 @@ func ServNoCommand(ctx *context.PrivateContext) { } results := private.KeyAndOwner{} - key, err := asymkey_model.GetPublicKeyByID(keyID) + key, err := asymkey_model.GetPublicKeyByID(ctx, keyID) if err != nil { if asymkey_model.IsErrKeyNotExist(err) { ctx.JSON(http.StatusUnauthorized, private.Response{ @@ -132,7 +132,7 @@ func ServCommand(ctx *context.PrivateContext) { // Now get the Repository and set the results section repoExist := true - repo, err := repo_model.GetRepositoryByName(owner.ID, results.RepoName) + repo, err := repo_model.GetRepositoryByName(ctx, owner.ID, results.RepoName) if err != nil { if repo_model.IsErrRepoNotExist(err) { repoExist = false @@ -184,7 +184,7 @@ func ServCommand(ctx *context.PrivateContext) { } // Get the Public Key represented by the keyID - key, err := asymkey_model.GetPublicKeyByID(keyID) + key, err := asymkey_model.GetPublicKeyByID(ctx, keyID) if err != nil { if asymkey_model.IsErrKeyNotExist(err) { ctx.JSON(http.StatusNotFound, private.Response{ diff --git a/routers/web/admin/auths.go b/routers/web/admin/auths.go index b743d1b0a5..22de15036c 100644 --- a/routers/web/admin/auths.go +++ b/routers/web/admin/auths.go @@ -48,13 +48,13 @@ func Authentications(ctx *context.Context) { ctx.Data["PageIsAdminAuthentications"] = true var err error - ctx.Data["Sources"], err = auth.Sources() + ctx.Data["Sources"], err = auth.Sources(ctx) if err != nil { ctx.ServerError("auth.Sources", err) return } - ctx.Data["Total"] = auth.CountSources() + ctx.Data["Total"] = auth.CountSources(ctx) ctx.HTML(http.StatusOK, tplAuths) } @@ -284,7 +284,7 @@ func NewAuthSourcePost(ctx *context.Context) { ctx.RenderWithErr(err.Error(), tplAuthNew, form) return } - existing, err := auth.SourcesByType(auth.SSPI) + existing, err := auth.SourcesByType(ctx, auth.SSPI) if err != nil || len(existing) > 0 { ctx.Data["Err_Type"] = true ctx.RenderWithErr(ctx.Tr("admin.auths.login_source_of_type_exist"), tplAuthNew, form) @@ -301,7 +301,7 @@ func NewAuthSourcePost(ctx *context.Context) { return } - if err := auth.CreateSource(&auth.Source{ + if err := auth.CreateSource(ctx, &auth.Source{ Type: auth.Type(form.Type), Name: form.Name, IsActive: form.IsActive, @@ -337,7 +337,7 @@ func EditAuthSource(ctx *context.Context) { oauth2providers := oauth2.GetOAuth2Providers() ctx.Data["OAuth2Providers"] = oauth2providers - source, err := auth.GetSourceByID(ctx.ParamsInt64(":authid")) + source, err := auth.GetSourceByID(ctx, ctx.ParamsInt64(":authid")) if err != nil { ctx.ServerError("auth.GetSourceByID", err) return @@ -371,7 +371,7 @@ func EditAuthSourcePost(ctx *context.Context) { oauth2providers := oauth2.GetOAuth2Providers() ctx.Data["OAuth2Providers"] = oauth2providers - source, err := auth.GetSourceByID(ctx.ParamsInt64(":authid")) + source, err := auth.GetSourceByID(ctx, ctx.ParamsInt64(":authid")) if err != nil { ctx.ServerError("auth.GetSourceByID", err) return @@ -421,7 +421,7 @@ func EditAuthSourcePost(ctx *context.Context) { source.IsActive = form.IsActive source.IsSyncEnabled = form.IsSyncEnabled source.Cfg = config - if err := auth.UpdateSource(source); err != nil { + if err := auth.UpdateSource(ctx, source); err != nil { if auth.IsErrSourceAlreadyExist(err) { ctx.Data["Err_Name"] = true ctx.RenderWithErr(ctx.Tr("admin.auths.login_source_exist", err.(auth.ErrSourceAlreadyExist).Name), tplAuthEdit, form) @@ -442,7 +442,7 @@ func EditAuthSourcePost(ctx *context.Context) { // DeleteAuthSource response for deleting an auth source func DeleteAuthSource(ctx *context.Context) { - source, err := auth.GetSourceByID(ctx.ParamsInt64(":authid")) + source, err := auth.GetSourceByID(ctx, ctx.ParamsInt64(":authid")) if err != nil { ctx.ServerError("auth.GetSourceByID", err) return diff --git a/routers/web/admin/users.go b/routers/web/admin/users.go index 18d7313e72..91a578fb55 100644 --- a/routers/web/admin/users.go +++ b/routers/web/admin/users.go @@ -90,7 +90,7 @@ func NewUser(ctx *context.Context) { ctx.Data["login_type"] = "0-0" - sources, err := auth.Sources() + sources, err := auth.Sources(ctx) if err != nil { ctx.ServerError("auth.Sources", err) return @@ -109,7 +109,7 @@ func NewUserPost(ctx *context.Context) { ctx.Data["DefaultUserVisibilityMode"] = setting.Service.DefaultUserVisibilityMode ctx.Data["AllowedUserVisibilityModes"] = setting.Service.AllowedUserVisibilityModesSlice.ToVisibleTypeSlice() - sources, err := auth.Sources() + sources, err := auth.Sources(ctx) if err != nil { ctx.ServerError("auth.Sources", err) return @@ -221,7 +221,7 @@ func prepareUserInfo(ctx *context.Context) *user_model.User { ctx.Data["User"] = u if u.LoginSource > 0 { - ctx.Data["LoginSource"], err = auth.GetSourceByID(u.LoginSource) + ctx.Data["LoginSource"], err = auth.GetSourceByID(ctx, u.LoginSource) if err != nil { ctx.ServerError("auth.GetSourceByID", err) return nil @@ -230,7 +230,7 @@ func prepareUserInfo(ctx *context.Context) *user_model.User { ctx.Data["LoginSource"] = &auth.Source{} } - sources, err := auth.Sources() + sources, err := auth.Sources(ctx) if err != nil { ctx.ServerError("auth.Sources", err) return nil @@ -532,7 +532,7 @@ func DeleteAvatar(ctx *context.Context) { return } - if err := user_service.DeleteAvatar(u); err != nil { + if err := user_service.DeleteAvatar(ctx, u); err != nil { ctx.Flash.Error(err.Error()) } diff --git a/routers/web/auth/auth.go b/routers/web/auth/auth.go index 8017602d99..df835a2fa1 100644 --- a/routers/web/auth/auth.go +++ b/routers/web/auth/auth.go @@ -157,7 +157,7 @@ func SignIn(ctx *context.Context) { ctx.Data["SignInLink"] = setting.AppSubURL + "/user/login" ctx.Data["PageIsSignIn"] = true ctx.Data["PageIsLogin"] = true - ctx.Data["EnableSSPI"] = auth.IsSSPIEnabled() + ctx.Data["EnableSSPI"] = auth.IsSSPIEnabled(ctx) if setting.Service.EnableCaptcha && setting.Service.RequireCaptchaForLogin { context.SetCaptchaData(ctx) @@ -181,7 +181,7 @@ func SignInPost(ctx *context.Context) { ctx.Data["SignInLink"] = setting.AppSubURL + "/user/login" ctx.Data["PageIsSignIn"] = true ctx.Data["PageIsLogin"] = true - ctx.Data["EnableSSPI"] = auth.IsSSPIEnabled() + ctx.Data["EnableSSPI"] = auth.IsSSPIEnabled(ctx) if ctx.HasError() { ctx.HTML(http.StatusOK, tplSignIn) diff --git a/routers/web/auth/linkaccount.go b/routers/web/auth/linkaccount.go index 42d846180d..1e70d85cee 100644 --- a/routers/web/auth/linkaccount.go +++ b/routers/web/auth/linkaccount.go @@ -152,7 +152,7 @@ func LinkAccountPostSignIn(ctx *context.Context) { } func linkAccount(ctx *context.Context, u *user_model.User, gothUser goth.User, remember bool) { - updateAvatarIfNeed(gothUser.AvatarURL, u) + updateAvatarIfNeed(ctx, gothUser.AvatarURL, u) // If this user is enrolled in 2FA, we can't sign the user in just yet. // Instead, redirect them to the 2FA authentication page. diff --git a/routers/web/auth/oauth.go b/routers/web/auth/oauth.go index ce58cbdef9..64106e1ab6 100644 --- a/routers/web/auth/oauth.go +++ b/routers/web/auth/oauth.go @@ -1074,7 +1074,7 @@ func showLinkingLogin(ctx *context.Context, gothUser goth.User) { ctx.Redirect(setting.AppSubURL + "/user/link_account") } -func updateAvatarIfNeed(url string, u *user_model.User) { +func updateAvatarIfNeed(ctx *context.Context, url string, u *user_model.User) { if setting.OAuth2Client.UpdateAvatar && len(url) > 0 { resp, err := http.Get(url) if err == nil { @@ -1086,14 +1086,14 @@ func updateAvatarIfNeed(url string, u *user_model.User) { if err == nil && resp.StatusCode == http.StatusOK { data, err := io.ReadAll(io.LimitReader(resp.Body, setting.Avatar.MaxFileSize+1)) if err == nil && int64(len(data)) <= setting.Avatar.MaxFileSize { - _ = user_service.UploadAvatar(u, data) + _ = user_service.UploadAvatar(ctx, u, data) } } } } func handleOAuth2SignIn(ctx *context.Context, source *auth.Source, u *user_model.User, gothUser goth.User) { - updateAvatarIfNeed(gothUser.AvatarURL, u) + updateAvatarIfNeed(ctx, gothUser.AvatarURL, u) needs2FA := false if !source.Cfg.(*oauth2.Source).SkipLocalTwoFA { diff --git a/routers/web/explore/code.go b/routers/web/explore/code.go index 94d83818fc..d81884ec62 100644 --- a/routers/web/explore/code.go +++ b/routers/web/explore/code.go @@ -102,7 +102,7 @@ func Code(ctx *context.Context) { } } - repoMaps, err := repo_model.GetRepositoriesMapByIDs(loadRepoIDs) + repoMaps, err := repo_model.GetRepositoriesMapByIDs(ctx, loadRepoIDs) if err != nil { ctx.ServerError("GetRepositoriesMapByIDs", err) return diff --git a/routers/web/feed/convert.go b/routers/web/feed/convert.go index 04078955bb..4d4918a8fd 100644 --- a/routers/web/feed/convert.go +++ b/routers/web/feed/convert.go @@ -290,7 +290,7 @@ func releasesToFeedItems(ctx *context.Context, releases []*repo_model.Release, i content, err = markdown.RenderString(&markup.RenderContext{ Ctx: ctx, URLPrefix: rel.Repo.Link(), - Metas: rel.Repo.ComposeMetas(), + Metas: rel.Repo.ComposeMetas(ctx), }, rel.Note) if err != nil { diff --git a/routers/web/org/projects.go b/routers/web/org/projects.go index 19d3682f51..439fdf644b 100644 --- a/routers/web/org/projects.go +++ b/routers/web/org/projects.go @@ -468,7 +468,7 @@ func UpdateIssueProject(ctx *context.Context) { } } - if err := issues_model.ChangeProjectAssign(issue, ctx.Doer, projectID); err != nil { + if err := issues_model.ChangeProjectAssign(ctx, issue, ctx.Doer, projectID); err != nil { ctx.ServerError("ChangeProjectAssign", err) return } diff --git a/routers/web/org/setting.go b/routers/web/org/setting.go index 0f082a70df..a8e1bc1c83 100644 --- a/routers/web/org/setting.go +++ b/routers/web/org/setting.go @@ -160,7 +160,7 @@ func SettingsAvatar(ctx *context.Context) { // SettingsDeleteAvatar response for delete avatar on settings page func SettingsDeleteAvatar(ctx *context.Context) { - if err := user_service.DeleteAvatar(ctx.Org.Organization.AsUser()); err != nil { + if err := user_service.DeleteAvatar(ctx, ctx.Org.Organization.AsUser()); err != nil { ctx.Flash.Error(err.Error()) } diff --git a/routers/web/org/teams.go b/routers/web/org/teams.go index 98014d99a6..183b7dd266 100644 --- a/routers/web/org/teams.go +++ b/routers/web/org/teams.go @@ -237,7 +237,7 @@ func TeamsRepoAction(ctx *context.Context) { case "add": repoName := path.Base(ctx.FormString("repo_name")) var repo *repo_model.Repository - repo, err = repo_model.GetRepositoryByName(ctx.Org.Organization.ID, repoName) + repo, err = repo_model.GetRepositoryByName(ctx, ctx.Org.Organization.ID, repoName) if err != nil { if repo_model.IsErrRepoNotExist(err) { ctx.Flash.Error(ctx.Tr("org.teams.add_nonexistent_repo")) diff --git a/routers/web/repo/branch.go b/routers/web/repo/branch.go index e0e27fd482..bc72d5f2ec 100644 --- a/routers/web/repo/branch.go +++ b/routers/web/repo/branch.go @@ -37,7 +37,7 @@ const ( func Branches(ctx *context.Context) { ctx.Data["Title"] = "Branches" ctx.Data["IsRepoToolbarBranches"] = true - ctx.Data["AllowsPulls"] = ctx.Repo.Repository.AllowsPulls() + ctx.Data["AllowsPulls"] = ctx.Repo.Repository.AllowsPulls(ctx) ctx.Data["IsWriter"] = ctx.Repo.CanWrite(unit.TypeCode) ctx.Data["IsMirror"] = ctx.Repo.Repository.IsMirror ctx.Data["CanPull"] = ctx.Repo.CanWrite(unit.TypeCode) || diff --git a/routers/web/repo/http.go b/routers/web/repo/http.go index 1fd784a40a..9e11d7a8c0 100644 --- a/routers/web/repo/http.go +++ b/routers/web/repo/http.go @@ -105,7 +105,7 @@ func httpBase(ctx *context.Context) *serviceHandler { } repoExist := true - repo, err := repo_model.GetRepositoryByName(owner.ID, reponame) + repo, err := repo_model.GetRepositoryByName(ctx, owner.ID, reponame) if err != nil { if repo_model.IsErrRepoNotExist(err) { if redirectRepoID, err := repo_model.LookupRedirect(owner.ID, reponame); err == nil { diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go index 5bee8c76a9..bb5f6e7ef5 100644 --- a/routers/web/repo/issue.go +++ b/routers/web/repo/issue.go @@ -495,7 +495,7 @@ func Issues(ctx *context.Context) { func renderMilestones(ctx *context.Context) { // Get milestones - milestones, _, err := issues_model.GetMilestones(issues_model.GetMilestonesOption{ + milestones, _, err := issues_model.GetMilestones(ctx, issues_model.GetMilestonesOption{ RepoID: ctx.Repo.Repository.ID, State: api.StateAll, }) @@ -519,7 +519,7 @@ func renderMilestones(ctx *context.Context) { // RetrieveRepoMilestonesAndAssignees find all the milestones and assignees of a repository func RetrieveRepoMilestonesAndAssignees(ctx *context.Context, repo *repo_model.Repository) { var err error - ctx.Data["OpenMilestones"], _, err = issues_model.GetMilestones(issues_model.GetMilestonesOption{ + ctx.Data["OpenMilestones"], _, err = issues_model.GetMilestones(ctx, issues_model.GetMilestonesOption{ RepoID: repo.ID, State: api.StateOpen, }) @@ -527,7 +527,7 @@ func RetrieveRepoMilestonesAndAssignees(ctx *context.Context, repo *repo_model.R ctx.ServerError("GetMilestones", err) return } - ctx.Data["ClosedMilestones"], _, err = issues_model.GetMilestones(issues_model.GetMilestonesOption{ + ctx.Data["ClosedMilestones"], _, err = issues_model.GetMilestones(ctx, issues_model.GetMilestonesOption{ RepoID: repo.ID, State: api.StateClosed, }) @@ -1229,7 +1229,7 @@ func NewIssuePost(ctx *context.Context) { ctx.Error(http.StatusBadRequest, "user hasn't permissions to read projects") return } - if err := issues_model.ChangeProjectAssign(issue, ctx.Doer, projectID); err != nil { + if err := issues_model.ChangeProjectAssign(ctx, issue, ctx.Doer, projectID); err != nil { ctx.ServerError("ChangeProjectAssign", err) return } @@ -1332,7 +1332,7 @@ func ViewIssue(ctx *context.Context) { extIssueUnit, err := ctx.Repo.Repository.GetUnit(ctx, unit.TypeExternalTracker) if err == nil && extIssueUnit != nil { if extIssueUnit.ExternalTrackerConfig().ExternalTrackerStyle == markup.IssueNameStyleNumeric || extIssueUnit.ExternalTrackerConfig().ExternalTrackerStyle == "" { - metas := ctx.Repo.Repository.ComposeMetas() + metas := ctx.Repo.Repository.ComposeMetas(ctx) metas["index"] = ctx.Params(":index") res, err := vars.Expand(extIssueUnit.ExternalTrackerConfig().ExternalTrackerFormat, metas) if err != nil { @@ -1425,7 +1425,7 @@ func ViewIssue(ctx *context.Context) { issue.RenderedContent, err = markdown.RenderString(&markup.RenderContext{ URLPrefix: ctx.Repo.RepoLink, - Metas: ctx.Repo.Repository.ComposeMetas(), + Metas: ctx.Repo.Repository.ComposeMetas(ctx), GitRepo: ctx.Repo.GitRepo, Ctx: ctx, }, issue.Content) @@ -1588,7 +1588,7 @@ func ViewIssue(ctx *context.Context) { comment.RenderedContent, err = markdown.RenderString(&markup.RenderContext{ URLPrefix: ctx.Repo.RepoLink, - Metas: ctx.Repo.Repository.ComposeMetas(), + Metas: ctx.Repo.Repository.ComposeMetas(ctx), GitRepo: ctx.Repo.GitRepo, Ctx: ctx, }, comment.Content) @@ -1665,7 +1665,7 @@ func ViewIssue(ctx *context.Context) { } else if comment.Type.HasContentSupport() { comment.RenderedContent, err = markdown.RenderString(&markup.RenderContext{ URLPrefix: ctx.Repo.RepoLink, - Metas: ctx.Repo.Repository.ComposeMetas(), + Metas: ctx.Repo.Repository.ComposeMetas(ctx), GitRepo: ctx.Repo.GitRepo, Ctx: ctx, }, comment.Content) @@ -1909,7 +1909,7 @@ func ViewIssue(ctx *context.Context) { if pull.HasMerged || issue.IsClosed || !ctx.IsSigned { return false } - if pull.CanAutoMerge() || pull.IsWorkInProgress() || pull.IsChecking() { + if pull.CanAutoMerge() || pull.IsWorkInProgress(ctx) || pull.IsChecking() { return false } if (ctx.Doer.IsAdmin || ctx.Repo.IsAdmin()) && prConfig.AllowManualMerge { @@ -2223,7 +2223,7 @@ func UpdateIssueContent(ctx *context.Context) { content, err := markdown.RenderString(&markup.RenderContext{ URLPrefix: ctx.FormString("context"), // FIXME: <- IS THIS SAFE ? - Metas: ctx.Repo.Repository.ComposeMetas(), + Metas: ctx.Repo.Repository.ComposeMetas(ctx), GitRepo: ctx.Repo.GitRepo, Ctx: ctx, }, issue.Content) @@ -2286,7 +2286,7 @@ func UpdateIssueMilestone(ctx *context.Context) { continue } issue.MilestoneID = milestoneID - if err := issue_service.ChangeMilestoneAssign(issue, ctx.Doer, oldMilestoneID); err != nil { + if err := issue_service.ChangeMilestoneAssign(ctx, issue, ctx.Doer, oldMilestoneID); err != nil { ctx.ServerError("ChangeMilestoneAssign", err) return } @@ -2536,7 +2536,7 @@ func SearchIssues(ctx *context.Context) { allPublic = true opts.AllPublic = false // set it false to avoid returning too many repos, we could filter by indexer } - repoIDs, _, err = repo_model.SearchRepositoryIDs(opts) + repoIDs, _, err = repo_model.SearchRepositoryIDs(ctx, opts) if err != nil { ctx.Error(http.StatusInternalServerError, "SearchRepositoryIDs", err.Error()) return @@ -3127,7 +3127,7 @@ func UpdateCommentContent(ctx *context.Context) { content, err := markdown.RenderString(&markup.RenderContext{ URLPrefix: ctx.FormString("context"), // FIXME: <- IS THIS SAFE ? - Metas: ctx.Repo.Repository.ComposeMetas(), + Metas: ctx.Repo.Repository.ComposeMetas(ctx), GitRepo: ctx.Repo.GitRepo, Ctx: ctx, }, comment.Content) diff --git a/routers/web/repo/issue_dependency.go b/routers/web/repo/issue_dependency.go index 5b9c570b74..716a02ab6c 100644 --- a/routers/web/repo/issue_dependency.go +++ b/routers/web/repo/issue_dependency.go @@ -72,7 +72,7 @@ func AddDependency(ctx *context.Context) { return } - err = issues_model.CreateIssueDependency(ctx.Doer, issue, dep) + err = issues_model.CreateIssueDependency(ctx, ctx.Doer, issue, dep) if err != nil { if issues_model.IsErrDependencyExists(err) { ctx.Flash.Error(ctx.Tr("repo.issues.dependency.add_error_dep_exists")) @@ -131,7 +131,7 @@ func RemoveDependency(ctx *context.Context) { return } - if err = issues_model.RemoveIssueDependency(ctx.Doer, issue, dep, depType); err != nil { + if err = issues_model.RemoveIssueDependency(ctx, ctx.Doer, issue, dep, depType); err != nil { if issues_model.IsErrDependencyNotExists(err) { ctx.Flash.Error(ctx.Tr("repo.issues.dependency.add_error_dep_not_exist")) return diff --git a/routers/web/repo/issue_lock.go b/routers/web/repo/issue_lock.go index 93f5a588d9..f83109d9b3 100644 --- a/routers/web/repo/issue_lock.go +++ b/routers/web/repo/issue_lock.go @@ -29,7 +29,7 @@ func LockIssue(ctx *context.Context) { return } - if err := issues_model.LockIssue(&issues_model.IssueLockOptions{ + if err := issues_model.LockIssue(ctx, &issues_model.IssueLockOptions{ Doer: ctx.Doer, Issue: issue, Reason: form.Reason, @@ -53,7 +53,7 @@ func UnlockIssue(ctx *context.Context) { return } - if err := issues_model.UnlockIssue(&issues_model.IssueLockOptions{ + if err := issues_model.UnlockIssue(ctx, &issues_model.IssueLockOptions{ Doer: ctx.Doer, Issue: issue, }); err != nil { diff --git a/routers/web/repo/milestone.go b/routers/web/repo/milestone.go index df52ca3528..32cbc29c67 100644 --- a/routers/web/repo/milestone.go +++ b/routers/web/repo/milestone.go @@ -50,7 +50,7 @@ func Milestones(ctx *context.Context) { state = structs.StateClosed } - miles, total, err := issues_model.GetMilestones(issues_model.GetMilestonesOption{ + miles, total, err := issues_model.GetMilestones(ctx, issues_model.GetMilestonesOption{ ListOptions: db.ListOptions{ Page: page, PageSize: setting.UI.IssuePagingNum, @@ -82,7 +82,7 @@ func Milestones(ctx *context.Context) { for _, m := range miles { m.RenderedContent, err = markdown.RenderString(&markup.RenderContext{ URLPrefix: ctx.Repo.RepoLink, - Metas: ctx.Repo.Repository.ComposeMetas(), + Metas: ctx.Repo.Repository.ComposeMetas(ctx), GitRepo: ctx.Repo.GitRepo, Ctx: ctx, }, m.Content) @@ -275,7 +275,7 @@ func MilestoneIssuesAndPulls(ctx *context.Context) { milestone.RenderedContent, err = markdown.RenderString(&markup.RenderContext{ URLPrefix: ctx.Repo.RepoLink, - Metas: ctx.Repo.Repository.ComposeMetas(), + Metas: ctx.Repo.Repository.ComposeMetas(ctx), GitRepo: ctx.Repo.GitRepo, Ctx: ctx, }, milestone.Content) diff --git a/routers/web/repo/projects.go b/routers/web/repo/projects.go index 33bc79d96d..ada398fdc8 100644 --- a/routers/web/repo/projects.go +++ b/routers/web/repo/projects.go @@ -87,7 +87,7 @@ func Projects(ctx *context.Context) { for i := range projects { projects[i].RenderedContent, err = markdown.RenderString(&markup.RenderContext{ URLPrefix: ctx.Repo.RepoLink, - Metas: ctx.Repo.Repository.ComposeMetas(), + Metas: ctx.Repo.Repository.ComposeMetas(ctx), GitRepo: ctx.Repo.GitRepo, Ctx: ctx, }, projects[i].Description) @@ -353,7 +353,7 @@ func ViewProject(ctx *context.Context) { project.RenderedContent, err = markdown.RenderString(&markup.RenderContext{ URLPrefix: ctx.Repo.RepoLink, - Metas: ctx.Repo.Repository.ComposeMetas(), + Metas: ctx.Repo.Repository.ComposeMetas(ctx), GitRepo: ctx.Repo.GitRepo, Ctx: ctx, }, project.Description) @@ -391,7 +391,7 @@ func UpdateIssueProject(ctx *context.Context) { } } - if err := issues_model.ChangeProjectAssign(issue, ctx.Doer, projectID); err != nil { + if err := issues_model.ChangeProjectAssign(ctx, issue, ctx.Doer, projectID); err != nil { ctx.ServerError("ChangeProjectAssign", err) return } diff --git a/routers/web/repo/pull.go b/routers/web/repo/pull.go index 639c0c74d0..c8a0a04fe5 100644 --- a/routers/web/repo/pull.go +++ b/routers/web/repo/pull.go @@ -371,8 +371,8 @@ func setMergeTarget(ctx *context.Context, pull *issues_model.PullRequest) { ctx.Data["HeadTarget"] = pull.MustHeadUserName(ctx) + "/" + pull.HeadRepo.Name + ":" + pull.HeadBranch } ctx.Data["BaseTarget"] = pull.BaseBranch - ctx.Data["HeadBranchLink"] = pull.GetHeadBranchLink() - ctx.Data["BaseBranchLink"] = pull.GetBaseBranchLink() + ctx.Data["HeadBranchLink"] = pull.GetHeadBranchLink(ctx) + ctx.Data["BaseBranchLink"] = pull.GetBaseBranchLink(ctx) } // GetPullDiffStats get Pull Requests diff stats @@ -696,7 +696,7 @@ func PrepareViewPullInfo(ctx *context.Context, issue *issues_model.Issue) *git.C ctx.Data["IsNothingToCompare"] = true } - if pull.IsWorkInProgress() { + if pull.IsWorkInProgress(ctx) { ctx.Data["IsPullWorkInProgress"] = true ctx.Data["WorkInProgressPrefix"] = pull.GetWorkInProgressPrefix(ctx) } diff --git a/routers/web/repo/release.go b/routers/web/repo/release.go index 61f1973125..5cbd6b3d51 100644 --- a/routers/web/repo/release.go +++ b/routers/web/repo/release.go @@ -136,7 +136,7 @@ func Releases(ctx *context.Context) { r.Note, err = markdown.RenderString(&markup.RenderContext{ URLPrefix: ctx.Repo.RepoLink, - Metas: ctx.Repo.Repository.ComposeMetas(), + Metas: ctx.Repo.Repository.ComposeMetas(ctx), GitRepo: ctx.Repo.GitRepo, Ctx: ctx, }, r.Note) @@ -285,7 +285,7 @@ func SingleRelease(ctx *context.Context) { } release.Note, err = markdown.RenderString(&markup.RenderContext{ URLPrefix: ctx.Repo.RepoLink, - Metas: ctx.Repo.Repository.ComposeMetas(), + Metas: ctx.Repo.Repository.ComposeMetas(ctx), GitRepo: ctx.Repo.GitRepo, Ctx: ctx, }, release.Note) diff --git a/routers/web/repo/render.go b/routers/web/repo/render.go index f07b4e8c11..33476c1d2c 100644 --- a/routers/web/repo/render.go +++ b/routers/web/repo/render.go @@ -67,7 +67,7 @@ func RenderFile(ctx *context.Context) { Ctx: ctx, RelativePath: ctx.Repo.TreePath, URLPrefix: path.Dir(treeLink), - Metas: ctx.Repo.Repository.ComposeDocumentMetas(), + Metas: ctx.Repo.Repository.ComposeDocumentMetas(ctx), GitRepo: ctx.Repo.GitRepo, InStandalonePage: true, }, rd, ctx.Resp) diff --git a/routers/web/repo/view.go b/routers/web/repo/view.go index 6571790627..4dfa01d8e2 100644 --- a/routers/web/repo/view.go +++ b/routers/web/repo/view.go @@ -312,7 +312,7 @@ func renderReadmeFile(ctx *context.Context, subfolder string, readmeFile *git.Tr Ctx: ctx, RelativePath: path.Join(ctx.Repo.TreePath, readmeFile.Name()), // ctx.Repo.TreePath is the directory not the Readme so we must append the Readme filename (and path). URLPrefix: path.Join(readmeTreelink, subfolder), - Metas: ctx.Repo.Repository.ComposeDocumentMetas(), + Metas: ctx.Repo.Repository.ComposeDocumentMetas(ctx), GitRepo: ctx.Repo.GitRepo, }, rd) if err != nil { @@ -469,7 +469,7 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st if !detected { markupType = "" } - metas := ctx.Repo.Repository.ComposeDocumentMetas() + metas := ctx.Repo.Repository.ComposeDocumentMetas(ctx) metas["BranchNameSubURL"] = ctx.Repo.BranchNameSubURL() ctx.Data["EscapeStatus"], ctx.Data["FileContent"], err = markupRender(ctx, &markup.RenderContext{ Ctx: ctx, @@ -582,7 +582,7 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st Ctx: ctx, RelativePath: ctx.Repo.TreePath, URLPrefix: path.Dir(treeLink), - Metas: ctx.Repo.Repository.ComposeDocumentMetas(), + Metas: ctx.Repo.Repository.ComposeDocumentMetas(ctx), GitRepo: ctx.Repo.GitRepo, }, rd) if err != nil { @@ -879,7 +879,7 @@ func renderDirectoryFiles(ctx *context.Context, timeout time.Duration) git.Entri } func renderLanguageStats(ctx *context.Context) { - langs, err := repo_model.GetTopLanguageStats(ctx.Repo.Repository, 5) + langs, err := repo_model.GetTopLanguageStats(ctx, ctx.Repo.Repository, 5) if err != nil { ctx.ServerError("Repo.GetTopLanguageStats", err) return diff --git a/routers/web/repo/wiki.go b/routers/web/repo/wiki.go index c9cec0313d..8ea18a186c 100644 --- a/routers/web/repo/wiki.go +++ b/routers/web/repo/wiki.go @@ -240,7 +240,7 @@ func renderViewPage(ctx *context.Context) (*git.Repository, *git.TreeEntry) { rctx := &markup.RenderContext{ Ctx: ctx, URLPrefix: ctx.Repo.RepoLink, - Metas: ctx.Repo.Repository.ComposeDocumentMetas(), + Metas: ctx.Repo.Repository.ComposeDocumentMetas(ctx), IsWiki: true, } buf := &strings.Builder{} diff --git a/routers/web/shared/user/header.go b/routers/web/shared/user/header.go index 355f2ddeff..6d1901dd2b 100644 --- a/routers/web/shared/user/header.go +++ b/routers/web/shared/user/header.go @@ -85,7 +85,7 @@ func PrepareContextForProfileBigAvatar(ctx *context.Context) { } func FindUserProfileReadme(ctx *context.Context) (profileGitRepo *git.Repository, profileReadmeBlob *git.Blob, profileClose func()) { - profileDbRepo, err := repo_model.GetRepositoryByName(ctx.ContextUser.ID, ".profile") + profileDbRepo, err := repo_model.GetRepositoryByName(ctx, ctx.ContextUser.ID, ".profile") if err == nil && !profileDbRepo.IsEmpty && !profileDbRepo.IsPrivate { if profileGitRepo, err = git.OpenRepository(ctx, profileDbRepo.RepoPath()); err != nil { log.Error("FindUserProfileReadme failed to OpenRepository: %v", err) diff --git a/routers/web/user/code.go b/routers/web/user/code.go index 42d7284189..ee514a7cfe 100644 --- a/routers/web/user/code.go +++ b/routers/web/user/code.go @@ -100,7 +100,7 @@ func CodeSearch(ctx *context.Context) { } } - repoMaps, err := repo_model.GetRepositoriesMapByIDs(loadRepoIDs) + repoMaps, err := repo_model.GetRepositoriesMapByIDs(ctx, loadRepoIDs) if err != nil { ctx.ServerError("GetRepositoriesMapByIDs", err) return diff --git a/routers/web/user/home.go b/routers/web/user/home.go index 76b9262ead..9364ce80dc 100644 --- a/routers/web/user/home.go +++ b/routers/web/user/home.go @@ -247,7 +247,7 @@ func Milestones(ctx *context.Context) { milestones[i].RenderedContent, err = markdown.RenderString(&markup.RenderContext{ URLPrefix: milestones[i].Repo.Link(), - Metas: milestones[i].Repo.ComposeMetas(), + Metas: milestones[i].Repo.ComposeMetas(ctx), Ctx: ctx, }, milestones[i].Content) if err != nil { @@ -463,7 +463,7 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) { } accessibleRepos := container.Set[int64]{} { - ids, _, err := repo_model.SearchRepositoryIDs(repoOpts) + ids, _, err := repo_model.SearchRepositoryIDs(ctx, repoOpts) if err != nil { ctx.ServerError("SearchRepositoryIDs", err) return @@ -576,7 +576,7 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) { } // showReposMap maps repository IDs to their Repository pointers. - showReposMap, err := loadRepoByIDs(ctxUser, issueCountByRepo, unitType) + showReposMap, err := loadRepoByIDs(ctx, ctxUser, issueCountByRepo, unitType) if err != nil { if repo_model.IsErrRepoNotExist(err) { ctx.NotFound("GetRepositoryByID", err) @@ -734,7 +734,7 @@ func getRepoIDs(reposQuery string) []int64 { return repoIDs } -func loadRepoByIDs(ctxUser *user_model.User, issueCountByRepo map[int64]int64, unitType unit.Type) (map[int64]*repo_model.Repository, error) { +func loadRepoByIDs(ctx *context.Context, ctxUser *user_model.User, issueCountByRepo map[int64]int64, unitType unit.Type) (map[int64]*repo_model.Repository, error) { totalRes := make(map[int64]*repo_model.Repository, len(issueCountByRepo)) repoIDs := make([]int64, 0, 500) for id := range issueCountByRepo { @@ -743,14 +743,14 @@ func loadRepoByIDs(ctxUser *user_model.User, issueCountByRepo map[int64]int64, u } repoIDs = append(repoIDs, id) if len(repoIDs) == 500 { - if err := repo_model.FindReposMapByIDs(repoIDs, totalRes); err != nil { + if err := repo_model.FindReposMapByIDs(ctx, repoIDs, totalRes); err != nil { return nil, err } repoIDs = repoIDs[:0] } } if len(repoIDs) > 0 { - if err := repo_model.FindReposMapByIDs(repoIDs, totalRes); err != nil { + if err := repo_model.FindReposMapByIDs(ctx, repoIDs, totalRes); err != nil { return nil, err } } @@ -759,7 +759,7 @@ func loadRepoByIDs(ctxUser *user_model.User, issueCountByRepo map[int64]int64, u // ShowSSHKeys output all the ssh keys of user by uid func ShowSSHKeys(ctx *context.Context) { - keys, err := asymkey_model.ListPublicKeys(ctx.ContextUser.ID, db.ListOptions{}) + keys, err := asymkey_model.ListPublicKeys(ctx, ctx.ContextUser.ID, db.ListOptions{}) if err != nil { ctx.ServerError("ListPublicKeys", err) return diff --git a/routers/web/user/setting/keys.go b/routers/web/user/setting/keys.go index 160c5ee0c0..227c1d3a75 100644 --- a/routers/web/user/setting/keys.go +++ b/routers/web/user/setting/keys.go @@ -168,7 +168,7 @@ func KeysPost(ctx *context.Context) { return } - if _, err = asymkey_model.AddPublicKey(ctx.Doer.ID, form.Title, content, 0); err != nil { + if _, err = asymkey_model.AddPublicKey(ctx, ctx.Doer.ID, form.Title, content, 0); err != nil { ctx.Data["HasSSHError"] = true switch { case asymkey_model.IsErrKeyAlreadyExist(err): @@ -231,7 +231,7 @@ func DeleteKey(ctx *context.Context) { } case "ssh": keyID := ctx.FormInt64("id") - external, err := asymkey_model.PublicKeyIsExternallyManaged(keyID) + external, err := asymkey_model.PublicKeyIsExternallyManaged(ctx, keyID) if err != nil { ctx.ServerError("sshKeysExternalManaged", err) return @@ -260,14 +260,14 @@ func DeleteKey(ctx *context.Context) { } func loadKeysData(ctx *context.Context) { - keys, err := asymkey_model.ListPublicKeys(ctx.Doer.ID, db.ListOptions{}) + keys, err := asymkey_model.ListPublicKeys(ctx, ctx.Doer.ID, db.ListOptions{}) if err != nil { ctx.ServerError("ListPublicKeys", err) return } ctx.Data["Keys"] = keys - externalKeys, err := asymkey_model.PublicKeysAreExternallyManaged(keys) + externalKeys, err := asymkey_model.PublicKeysAreExternallyManaged(ctx, keys) if err != nil { ctx.ServerError("ListPublicKeys", err) return diff --git a/routers/web/user/setting/profile.go b/routers/web/user/setting/profile.go index 72e60bda58..c97e66574e 100644 --- a/routers/web/user/setting/profile.go +++ b/routers/web/user/setting/profile.go @@ -157,7 +157,7 @@ func UpdateAvatarSetting(ctx *context.Context, form *forms.AvatarForm, ctxUser * if !(st.IsImage() && !st.IsSvgImage()) { return errors.New(ctx.Tr("settings.uploaded_avatar_not_a_image")) } - if err = user_service.UploadAvatar(ctxUser, data); err != nil { + if err = user_service.UploadAvatar(ctx, ctxUser, data); err != nil { return fmt.Errorf("UploadAvatar: %w", err) } } else if ctxUser.UseCustomAvatar && ctxUser.Avatar == "" { @@ -189,7 +189,7 @@ func AvatarPost(ctx *context.Context) { // DeleteAvatar render delete avatar page func DeleteAvatar(ctx *context.Context) { - if err := user_service.DeleteAvatar(ctx.Doer); err != nil { + if err := user_service.DeleteAvatar(ctx, ctx.Doer); err != nil { ctx.Flash.Error(err.Error()) } diff --git a/routers/web/user/setting/security/security.go b/routers/web/user/setting/security/security.go index 5a17c161fe..833940d928 100644 --- a/routers/web/user/setting/security/security.go +++ b/routers/web/user/setting/security/security.go @@ -82,7 +82,7 @@ func loadSecurityData(ctx *context.Context) { // map the provider display name with the AuthSource sources := make(map[*auth_model.Source]string) for _, externalAccount := range accountLinks { - if authSource, err := auth_model.GetSourceByID(externalAccount.LoginSourceID); err == nil { + if authSource, err := auth_model.GetSourceByID(ctx, externalAccount.LoginSourceID); err == nil { var providerDisplayName string type DisplayNamed interface { diff --git a/routers/web/web.go b/routers/web/web.go index 2154838726..d2179a0008 100644 --- a/routers/web/web.go +++ b/routers/web/web.go @@ -9,6 +9,7 @@ import ( "strings" auth_model "code.gitea.io/gitea/models/auth" + "code.gitea.io/gitea/models/db" "code.gitea.io/gitea/models/perm" "code.gitea.io/gitea/models/unit" "code.gitea.io/gitea/modules/context" @@ -94,7 +95,7 @@ func buildAuthGroup() *auth_service.Group { group.Add(&auth_service.ReverseProxy{}) } - if setting.IsWindows && auth_model.IsSSPIEnabled() { + if setting.IsWindows && auth_model.IsSSPIEnabled(db.DefaultContext) { group.Add(&auth_service.SSPI{}) // it MUST be the last, see the comment of SSPI } diff --git a/services/actions/schedule_tasks.go b/services/actions/schedule_tasks.go index 40b606c777..8eef2b67bd 100644 --- a/services/actions/schedule_tasks.go +++ b/services/actions/schedule_tasks.go @@ -45,7 +45,7 @@ func startTasks(ctx context.Context) error { return fmt.Errorf("find specs: %w", err) } - if err := specs.LoadRepos(); err != nil { + if err := specs.LoadRepos(ctx); err != nil { return fmt.Errorf("LoadRepos: %w", err) } diff --git a/services/agit/agit.go b/services/agit/agit.go index a39034b025..acfedf09d4 100644 --- a/services/agit/agit.go +++ b/services/agit/agit.go @@ -237,7 +237,7 @@ func UserNameChanged(ctx context.Context, user *user_model.User, newName string) for _, pull := range pulls { pull.HeadBranch = strings.TrimPrefix(pull.HeadBranch, user.LowerName+"/") pull.HeadBranch = newName + "/" + pull.HeadBranch - if err = pull.UpdateCols("head_branch"); err != nil { + if err = pull.UpdateCols(ctx, "head_branch"); err != nil { return err } } diff --git a/services/asymkey/ssh_key.go b/services/asymkey/ssh_key.go index 204d9c58f3..1c3bf09b08 100644 --- a/services/asymkey/ssh_key.go +++ b/services/asymkey/ssh_key.go @@ -13,7 +13,7 @@ import ( // DeletePublicKey deletes SSH key information both in database and authorized_keys file. func DeletePublicKey(ctx context.Context, doer *user_model.User, id int64) (err error) { - key, err := asymkey_model.GetPublicKeyByID(id) + key, err := asymkey_model.GetPublicKeyByID(ctx, id) if err != nil { return err } diff --git a/services/asymkey/ssh_key_test.go b/services/asymkey/ssh_key_test.go index 2395b2dadf..3a39a9a1db 100644 --- a/services/asymkey/ssh_key_test.go +++ b/services/asymkey/ssh_key_test.go @@ -66,8 +66,8 @@ ssh-dss AAAAB3NzaC1kc3MAAACBAOChCC7lf6Uo9n7BmZ6M8St19PZf4Tn59NriyboW2x/DZuYAz3ib for i, kase := range testCases { s.ID = int64(i) + 20 - asymkey_model.AddPublicKeysBySource(user, s, []string{kase.keyString}) - keys, err := asymkey_model.ListPublicKeysBySource(user.ID, s.ID) + asymkey_model.AddPublicKeysBySource(db.DefaultContext, user, s, []string{kase.keyString}) + keys, err := asymkey_model.ListPublicKeysBySource(db.DefaultContext, user.ID, s.ID) assert.NoError(t, err) if err != nil { continue diff --git a/services/auth/httpsign.go b/services/auth/httpsign.go index d6a64c6fc4..d5c8ea33aa 100644 --- a/services/auth/httpsign.go +++ b/services/auth/httpsign.go @@ -92,7 +92,7 @@ func VerifyPubKey(r *http.Request) (*asymkey_model.PublicKey, error) { keyID := verifier.KeyId() - publicKeys, err := asymkey_model.SearchPublicKey(0, keyID) + publicKeys, err := asymkey_model.SearchPublicKey(r.Context(), 0, keyID) if err != nil { return nil, err } diff --git a/services/auth/signin.go b/services/auth/signin.go index 6d515ac628..5fdf6d2bd7 100644 --- a/services/auth/signin.go +++ b/services/auth/signin.go @@ -56,7 +56,7 @@ func UserSignIn(ctx context.Context, username, password string) (*user_model.Use } if hasUser { - source, err := auth.GetSourceByID(user.LoginSource) + source, err := auth.GetSourceByID(ctx, user.LoginSource) if err != nil { return nil, nil, err } @@ -85,7 +85,7 @@ func UserSignIn(ctx context.Context, username, password string) (*user_model.Use } } - sources, err := auth.AllActiveSources() + sources, err := auth.AllActiveSources(ctx) if err != nil { return nil, nil, err } diff --git a/services/auth/source/ldap/source_authenticate.go b/services/auth/source/ldap/source_authenticate.go index 9f4d7ed68f..a7ea61b81c 100644 --- a/services/auth/source/ldap/source_authenticate.go +++ b/services/auth/source/ldap/source_authenticate.go @@ -70,7 +70,7 @@ func (source *Source) Authenticate(ctx context.Context, user *user_model.User, u } if user != nil { - if isAttributeSSHPublicKeySet && asymkey_model.SynchronizePublicKeys(user, source.authSource, sr.SSHPublicKey) { + if isAttributeSSHPublicKeySet && asymkey_model.SynchronizePublicKeys(ctx, user, source.authSource, sr.SSHPublicKey) { if err := asymkey_model.RewriteAllPublicKeys(ctx); err != nil { return user, err } @@ -96,13 +96,13 @@ func (source *Source) Authenticate(ctx context.Context, user *user_model.User, u return user, err } - if isAttributeSSHPublicKeySet && asymkey_model.AddPublicKeysBySource(user, source.authSource, sr.SSHPublicKey) { + if isAttributeSSHPublicKeySet && asymkey_model.AddPublicKeysBySource(ctx, user, source.authSource, sr.SSHPublicKey) { if err := asymkey_model.RewriteAllPublicKeys(ctx); err != nil { return user, err } } if len(source.AttributeAvatar) > 0 { - if err := user_service.UploadAvatar(user, sr.Avatar); err != nil { + if err := user_service.UploadAvatar(ctx, user, sr.Avatar); err != nil { return user, err } } diff --git a/services/auth/source/ldap/source_sync.go b/services/auth/source/ldap/source_sync.go index 261f2b8a95..5c65ca8dc2 100644 --- a/services/auth/source/ldap/source_sync.go +++ b/services/auth/source/ldap/source_sync.go @@ -135,17 +135,17 @@ func (source *Source) Sync(ctx context.Context, updateExisting bool) error { if err == nil && isAttributeSSHPublicKeySet { log.Trace("SyncExternalUsers[%s]: Adding LDAP Public SSH Keys for user %s", source.authSource.Name, usr.Name) - if asymkey_model.AddPublicKeysBySource(usr, source.authSource, su.SSHPublicKey) { + if asymkey_model.AddPublicKeysBySource(ctx, usr, source.authSource, su.SSHPublicKey) { sshKeysNeedUpdate = true } } if err == nil && len(source.AttributeAvatar) > 0 { - _ = user_service.UploadAvatar(usr, su.Avatar) + _ = user_service.UploadAvatar(ctx, usr, su.Avatar) } } else if updateExisting { // Synchronize SSH Public Key if that attribute is set - if isAttributeSSHPublicKeySet && asymkey_model.SynchronizePublicKeys(usr, source.authSource, su.SSHPublicKey) { + if isAttributeSSHPublicKeySet && asymkey_model.SynchronizePublicKeys(ctx, usr, source.authSource, su.SSHPublicKey) { sshKeysNeedUpdate = true } @@ -179,7 +179,7 @@ func (source *Source) Sync(ctx context.Context, updateExisting bool) error { if usr.IsUploadAvatarChanged(su.Avatar) { if err == nil && len(source.AttributeAvatar) > 0 { - _ = user_service.UploadAvatar(usr, su.Avatar) + _ = user_service.UploadAvatar(ctx, usr, su.Avatar) } } } diff --git a/services/auth/sspi.go b/services/auth/sspi.go index d4f7e3ec60..573d94b42c 100644 --- a/services/auth/sspi.go +++ b/services/auth/sspi.go @@ -67,7 +67,7 @@ func (s *SSPI) Verify(req *http.Request, w http.ResponseWriter, store DataStore, return nil, nil } - cfg, err := s.getConfig() + cfg, err := s.getConfig(req.Context()) if err != nil { log.Error("could not get SSPI config: %v", err) return nil, err @@ -129,8 +129,8 @@ func (s *SSPI) Verify(req *http.Request, w http.ResponseWriter, store DataStore, } // getConfig retrieves the SSPI configuration from login sources -func (s *SSPI) getConfig() (*sspi.Source, error) { - sources, err := auth.ActiveSources(auth.SSPI) +func (s *SSPI) getConfig(ctx context.Context) (*sspi.Source, error) { + sources, err := auth.ActiveSources(ctx, auth.SSPI) if err != nil { return nil, err } diff --git a/services/auth/sync.go b/services/auth/sync.go index e42e8a51a7..25b9460b99 100644 --- a/services/auth/sync.go +++ b/services/auth/sync.go @@ -15,7 +15,7 @@ import ( func SyncExternalUsers(ctx context.Context, updateExisting bool) error { log.Trace("Doing: SyncExternalUsers") - ls, err := auth.Sources() + ls, err := auth.Sources(ctx) if err != nil { log.Error("SyncExternalUsers: %v", err) return err diff --git a/services/convert/pull.go b/services/convert/pull.go index e4e3097056..7eebe20426 100644 --- a/services/convert/pull.go +++ b/services/convert/pull.go @@ -68,7 +68,7 @@ func ToAPIPullRequest(ctx context.Context, pr *issues_model.PullRequest, doer *u PatchURL: pr.Issue.PatchURL(), HasMerged: pr.HasMerged, MergeBase: pr.MergeBase, - Mergeable: pr.Mergeable(), + Mergeable: pr.Mergeable(ctx), Deadline: apiIssue.Deadline, Created: pr.Issue.CreatedUnix.AsTimePtr(), Updated: pr.Issue.UpdatedUnix.AsTimePtr(), diff --git a/services/issue/issue_test.go b/services/issue/issue_test.go index 1f6a77096e..8806cec0e7 100644 --- a/services/issue/issue_test.go +++ b/services/issue/issue_test.go @@ -72,7 +72,7 @@ func TestIssue_DeleteIssue(t *testing.T) { assert.NoError(t, err) issue2, err := issues_model.GetIssueByID(db.DefaultContext, 2) assert.NoError(t, err) - err = issues_model.CreateIssueDependency(user, issue1, issue2) + err = issues_model.CreateIssueDependency(db.DefaultContext, user, issue1, issue2) assert.NoError(t, err) left, err := issues_model.IssueNoDependenciesLeft(db.DefaultContext, issue1) assert.NoError(t, err) diff --git a/services/issue/label.go b/services/issue/label.go index 91f0308d9f..6b8070d8aa 100644 --- a/services/issue/label.go +++ b/services/issue/label.go @@ -15,7 +15,7 @@ import ( // ClearLabels clears all of an issue's labels func ClearLabels(ctx context.Context, issue *issues_model.Issue, doer *user_model.User) error { - if err := issues_model.ClearIssueLabels(issue, doer); err != nil { + if err := issues_model.ClearIssueLabels(ctx, issue, doer); err != nil { return err } @@ -26,7 +26,7 @@ func ClearLabels(ctx context.Context, issue *issues_model.Issue, doer *user_mode // AddLabel adds a new label to the issue. func AddLabel(ctx context.Context, issue *issues_model.Issue, doer *user_model.User, label *issues_model.Label) error { - if err := issues_model.NewIssueLabel(issue, label, doer); err != nil { + if err := issues_model.NewIssueLabel(ctx, issue, label, doer); err != nil { return err } @@ -36,7 +36,7 @@ func AddLabel(ctx context.Context, issue *issues_model.Issue, doer *user_model.U // AddLabels adds a list of new labels to the issue. func AddLabels(ctx context.Context, issue *issues_model.Issue, doer *user_model.User, labels []*issues_model.Label) error { - if err := issues_model.NewIssueLabels(issue, labels, doer); err != nil { + if err := issues_model.NewIssueLabels(ctx, issue, labels, doer); err != nil { return err } @@ -86,7 +86,7 @@ func ReplaceLabels(ctx context.Context, issue *issues_model.Issue, doer *user_mo return err } - if err := issues_model.ReplaceIssueLabels(issue, labels, doer); err != nil { + if err := issues_model.ReplaceIssueLabels(ctx, issue, labels, doer); err != nil { return err } diff --git a/services/issue/milestone.go b/services/issue/milestone.go index 5a07cfd2e5..ff645744a7 100644 --- a/services/issue/milestone.go +++ b/services/issue/milestone.go @@ -63,14 +63,14 @@ func changeMilestoneAssign(ctx context.Context, doer *user_model.User, issue *is } // ChangeMilestoneAssign changes assignment of milestone for issue. -func ChangeMilestoneAssign(issue *issues_model.Issue, doer *user_model.User, oldMilestoneID int64) (err error) { - ctx, committer, err := db.TxContext(db.DefaultContext) +func ChangeMilestoneAssign(ctx context.Context, issue *issues_model.Issue, doer *user_model.User, oldMilestoneID int64) (err error) { + dbCtx, committer, err := db.TxContext(ctx) if err != nil { return err } defer committer.Close() - if err = changeMilestoneAssign(ctx, doer, issue, oldMilestoneID); err != nil { + if err = changeMilestoneAssign(dbCtx, doer, issue, oldMilestoneID); err != nil { return err } @@ -78,7 +78,7 @@ func ChangeMilestoneAssign(issue *issues_model.Issue, doer *user_model.User, old return fmt.Errorf("Commit: %w", err) } - notify_service.IssueChangeMilestone(db.DefaultContext, doer, issue, oldMilestoneID) + notify_service.IssueChangeMilestone(ctx, doer, issue, oldMilestoneID) return nil } diff --git a/services/issue/milestone_test.go b/services/issue/milestone_test.go index 069117d1f1..42b910166f 100644 --- a/services/issue/milestone_test.go +++ b/services/issue/milestone_test.go @@ -6,6 +6,7 @@ package issue import ( "testing" + "code.gitea.io/gitea/models/db" issues_model "code.gitea.io/gitea/models/issues" "code.gitea.io/gitea/models/unittest" user_model "code.gitea.io/gitea/models/user" @@ -22,7 +23,7 @@ func TestChangeMilestoneAssign(t *testing.T) { oldMilestoneID := issue.MilestoneID issue.MilestoneID = 2 - assert.NoError(t, ChangeMilestoneAssign(issue, doer, oldMilestoneID)) + assert.NoError(t, ChangeMilestoneAssign(db.DefaultContext, issue, doer, oldMilestoneID)) unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{ IssueID: issue.ID, Type: issues_model.CommentTypeMilestone, diff --git a/services/mailer/mail.go b/services/mailer/mail.go index 50d59a4452..0210128046 100644 --- a/services/mailer/mail.go +++ b/services/mailer/mail.go @@ -235,7 +235,7 @@ func composeIssueCommentMessages(ctx *mailCommentContext, lang string, recipient body, err := markdown.RenderString(&markup.RenderContext{ Ctx: ctx, URLPrefix: ctx.Issue.Repo.HTMLURL(), - Metas: ctx.Issue.Repo.ComposeMetas(), + Metas: ctx.Issue.Repo.ComposeMetas(ctx), }, ctx.Content) if err != nil { return nil, err diff --git a/services/mailer/mail_issue.go b/services/mailer/mail_issue.go index be5279aac5..baa9f1d9ab 100644 --- a/services/mailer/mail_issue.go +++ b/services/mailer/mail_issue.go @@ -82,7 +82,7 @@ func mailIssueCommentToParticipants(ctx *mailCommentContext, mentions []*user_mo // =========== Repo watchers =========== // Make repo watchers last, since it's likely the list with the most users - if !(ctx.Issue.IsPull && ctx.Issue.PullRequest.IsWorkInProgress() && ctx.ActionType != activities_model.ActionCreatePullRequest) { + if !(ctx.Issue.IsPull && ctx.Issue.PullRequest.IsWorkInProgress(ctx) && ctx.ActionType != activities_model.ActionCreatePullRequest) { ids, err = repo_model.GetRepoWatchersIDs(ctx, ctx.Issue.RepoID) if err != nil { return fmt.Errorf("GetRepoWatchersIDs(%d): %w", ctx.Issue.RepoID, err) diff --git a/services/mailer/mail_release.go b/services/mailer/mail_release.go index fb638ebd42..7bc3db3fe6 100644 --- a/services/mailer/mail_release.go +++ b/services/mailer/mail_release.go @@ -60,7 +60,7 @@ func mailNewRelease(ctx context.Context, lang string, tos []string, rel *repo_mo rel.RenderedNote, err = markdown.RenderString(&markup.RenderContext{ Ctx: ctx, URLPrefix: rel.Repo.Link(), - Metas: rel.Repo.ComposeMetas(), + Metas: rel.Repo.ComposeMetas(ctx), }, rel.Note) if err != nil { log.Error("markdown.RenderString(%d): %v", rel.RepoID, err) diff --git a/services/mailer/notify.go b/services/mailer/notify.go index 9eaf268d0a..cc4e6baf0b 100644 --- a/services/mailer/notify.go +++ b/services/mailer/notify.go @@ -79,7 +79,7 @@ func (m *mailNotifier) IssueChangeTitle(ctx context.Context, doer *user_model.Us log.Error("issue.LoadPullRequest: %v", err) return } - if issue.IsPull && issues_model.HasWorkInProgressPrefix(oldTitle) && !issue.PullRequest.IsWorkInProgress() { + if issue.IsPull && issues_model.HasWorkInProgressPrefix(oldTitle) && !issue.PullRequest.IsWorkInProgress(ctx) { if err := MailParticipants(ctx, issue, doer, activities_model.ActionPullRequestReadyForReview, nil); err != nil { log.Error("MailParticipants: %v", err) } diff --git a/services/migrations/gitea_uploader.go b/services/migrations/gitea_uploader.go index ebf22e0e40..36b5e15298 100644 --- a/services/migrations/gitea_uploader.go +++ b/services/migrations/gitea_uploader.go @@ -840,7 +840,7 @@ func (g *GiteaLocalUploader) CreateReviews(reviews ...*base.Review) error { pr, ok := g.prCache[issue.ID] if !ok { var err error - pr, err = issues_model.GetPullRequestByIssueIDWithNoAttributes(issue.ID) + pr, err = issues_model.GetPullRequestByIssueIDWithNoAttributes(g.ctx, issue.ID) if err != nil { return err } diff --git a/services/migrations/gitea_uploader_test.go b/services/migrations/gitea_uploader_test.go index 4c6dfddc08..847e76d9b1 100644 --- a/services/migrations/gitea_uploader_test.go +++ b/services/migrations/gitea_uploader_test.go @@ -65,14 +65,14 @@ func TestGiteaUploadRepo(t *testing.T) { assert.True(t, repo.HasWiki()) assert.EqualValues(t, repo_model.RepositoryReady, repo.Status) - milestones, _, err := issues_model.GetMilestones(issues_model.GetMilestonesOption{ + milestones, _, err := issues_model.GetMilestones(db.DefaultContext, issues_model.GetMilestonesOption{ RepoID: repo.ID, State: structs.StateOpen, }) assert.NoError(t, err) assert.Len(t, milestones, 1) - milestones, _, err = issues_model.GetMilestones(issues_model.GetMilestonesOption{ + milestones, _, err = issues_model.GetMilestones(db.DefaultContext, issues_model.GetMilestonesOption{ RepoID: repo.ID, State: structs.StateClosed, }) diff --git a/services/pull/check.go b/services/pull/check.go index e4a0f6b27b..b51b58f480 100644 --- a/services/pull/check.go +++ b/services/pull/check.go @@ -91,7 +91,7 @@ func CheckPullMergable(stdCtx context.Context, doer *user_model.User, perm *acce return nil } - if pr.IsWorkInProgress() { + if pr.IsWorkInProgress(ctx) { return ErrIsWorkInProgress } @@ -360,7 +360,7 @@ func testPR(id int64) { if err := TestPatch(pr); err != nil { log.Error("testPatch[%-v]: %v", pr, err) pr.Status = issues_model.PullRequestStatusError - if err := pr.UpdateCols("status"); err != nil { + if err := pr.UpdateCols(ctx, "status"); err != nil { log.Error("update pr [%-v] status to PullRequestStatusError failed: %v", pr, err) } return diff --git a/services/pull/pull.go b/services/pull/pull.go index 8ef7499ad5..e4096f8ac4 100644 --- a/services/pull/pull.go +++ b/services/pull/pull.go @@ -125,7 +125,7 @@ func NewPullRequest(ctx context.Context, repo *repo_model.Repository, issue *iss return err } - if !pr.IsWorkInProgress() { + if !pr.IsWorkInProgress(ctx) { if err := issues_model.PullRequestCodeOwnersReview(ctx, issue, pr); err != nil { return err } diff --git a/services/repository/archiver/archiver.go b/services/repository/archiver/archiver.go index f6f03e75ae..9f1ea48dca 100644 --- a/services/repository/archiver/archiver.go +++ b/services/repository/archiver/archiver.go @@ -172,8 +172,8 @@ func (aReq *ArchiveRequest) Await(ctx context.Context) (*repo_model.RepoArchiver } } -func doArchive(r *ArchiveRequest) (*repo_model.RepoArchiver, error) { - txCtx, committer, err := db.TxContext(db.DefaultContext) +func doArchive(ctx context.Context, r *ArchiveRequest) (*repo_model.RepoArchiver, error) { + txCtx, committer, err := db.TxContext(ctx) if err != nil { return nil, err } @@ -291,18 +291,18 @@ func doArchive(r *ArchiveRequest) (*repo_model.RepoArchiver, error) { // anything. In all cases, the caller should be examining the *ArchiveRequest // being returned for completion, as it may be different than the one they passed // in. -func ArchiveRepository(request *ArchiveRequest) (*repo_model.RepoArchiver, error) { - return doArchive(request) +func ArchiveRepository(ctx context.Context, request *ArchiveRequest) (*repo_model.RepoArchiver, error) { + return doArchive(ctx, request) } var archiverQueue *queue.WorkerPoolQueue[*ArchiveRequest] // Init initializes archiver -func Init() error { +func Init(ctx context.Context) error { handler := func(items ...*ArchiveRequest) []*ArchiveRequest { for _, archiveReq := range items { log.Trace("ArchiverData Process: %#v", archiveReq) - if _, err := doArchive(archiveReq); err != nil { + if _, err := doArchive(ctx, archiveReq); err != nil { log.Error("Archive %v failed: %v", archiveReq, err) } } diff --git a/services/repository/archiver/archiver_test.go b/services/repository/archiver/archiver_test.go index ff8bb8ca7a..5deec259da 100644 --- a/services/repository/archiver/archiver_test.go +++ b/services/repository/archiver/archiver_test.go @@ -8,6 +8,7 @@ import ( "testing" "time" + "code.gitea.io/gitea/models/db" "code.gitea.io/gitea/models/unittest" "code.gitea.io/gitea/modules/contexttest" @@ -79,13 +80,13 @@ func TestArchive_Basic(t *testing.T) { inFlight[1] = tgzReq inFlight[2] = secondReq - ArchiveRepository(zipReq) - ArchiveRepository(tgzReq) - ArchiveRepository(secondReq) + ArchiveRepository(db.DefaultContext, zipReq) + ArchiveRepository(db.DefaultContext, tgzReq) + ArchiveRepository(db.DefaultContext, secondReq) // Make sure sending an unprocessed request through doesn't affect the queue // count. - ArchiveRepository(zipReq) + ArchiveRepository(db.DefaultContext, zipReq) // Sleep two seconds to make sure the queue doesn't change. time.Sleep(2 * time.Second) @@ -100,7 +101,7 @@ func TestArchive_Basic(t *testing.T) { // We still have the other three stalled at completion, waiting to remove // from archiveInProgress. Try to submit this new one before its // predecessor has cleared out of the queue. - ArchiveRepository(zipReq2) + ArchiveRepository(db.DefaultContext, zipReq2) // Now we'll submit a request and TimedWaitForCompletion twice, before and // after we release it. We should trigger both the timeout and non-timeout @@ -108,7 +109,7 @@ func TestArchive_Basic(t *testing.T) { timedReq, err := NewRequest(ctx.Repo.Repository.ID, ctx.Repo.GitRepo, secondCommit+".tar.gz") assert.NoError(t, err) assert.NotNil(t, timedReq) - ArchiveRepository(timedReq) + ArchiveRepository(db.DefaultContext, timedReq) zipReq2, err = NewRequest(ctx.Repo.Repository.ID, ctx.Repo.GitRepo, firstCommit+".zip") assert.NoError(t, err) diff --git a/services/repository/branch.go b/services/repository/branch.go index 3351252200..735fa1a756 100644 --- a/services/repository/branch.go +++ b/services/repository/branch.go @@ -161,7 +161,7 @@ func loadOneBranch(ctx context.Context, repo *repo_model.Repository, dbBranch *g } } - pr, err := issues_model.GetLatestPullRequestByHeadInfo(repo.ID, branchName) + pr, err := issues_model.GetLatestPullRequestByHeadInfo(ctx, repo.ID, branchName) if err != nil { return nil, fmt.Errorf("GetLatestPullRequestByHeadInfo: %v", err) } diff --git a/services/repository/fork.go b/services/repository/fork.go index d5ab42badd..851a69c80f 100644 --- a/services/repository/fork.go +++ b/services/repository/fork.go @@ -185,7 +185,7 @@ func ForkRepository(ctx context.Context, doer, owner *user_model.User, opts Fork if err := repo_module.UpdateRepoSize(ctx, repo); err != nil { log.Error("Failed to update size for repository: %v", err) } - if err := repo_model.CopyLanguageStat(opts.BaseRepo, repo); err != nil { + if err := repo_model.CopyLanguageStat(ctx, opts.BaseRepo, repo); err != nil { log.Error("Copy language stat from oldRepo failed: %v", err) } diff --git a/services/uinotification/notify.go b/services/uinotification/notify.go index 9230d1ee6c..be5f7019a2 100644 --- a/services/uinotification/notify.go +++ b/services/uinotification/notify.go @@ -114,7 +114,7 @@ func (ns *notificationService) IssueChangeTitle(ctx context.Context, doer *user_ log.Error("issue.LoadPullRequest: %v", err) return } - if issue.IsPull && issues_model.HasWorkInProgressPrefix(oldTitle) && !issue.PullRequest.IsWorkInProgress() { + if issue.IsPull && issues_model.HasWorkInProgressPrefix(oldTitle) && !issue.PullRequest.IsWorkInProgress(ctx) { _ = ns.issueQueue.Push(issueNotificationOpts{ IssueID: issue.ID, NotificationAuthorID: doer.ID, diff --git a/services/user/avatar.go b/services/user/avatar.go index 26c100abdb..4130d07c38 100644 --- a/services/user/avatar.go +++ b/services/user/avatar.go @@ -4,6 +4,7 @@ package user import ( + "context" "fmt" "io" @@ -15,13 +16,13 @@ import ( ) // UploadAvatar saves custom avatar for user. -func UploadAvatar(u *user_model.User, data []byte) error { +func UploadAvatar(ctx context.Context, u *user_model.User, data []byte) error { avatarData, err := avatar.ProcessAvatarImage(data) if err != nil { return err } - ctx, committer, err := db.TxContext(db.DefaultContext) + ctx, committer, err := db.TxContext(ctx) if err != nil { return err } @@ -44,7 +45,7 @@ func UploadAvatar(u *user_model.User, data []byte) error { } // DeleteAvatar deletes the user's custom avatar. -func DeleteAvatar(u *user_model.User) error { +func DeleteAvatar(ctx context.Context, u *user_model.User) error { aPath := u.CustomAvatarRelativePath() log.Trace("DeleteAvatar[%d]: %s", u.ID, aPath) if len(u.Avatar) > 0 { @@ -55,7 +56,7 @@ func DeleteAvatar(u *user_model.User) error { u.UseCustomAvatar = false u.Avatar = "" - if _, err := db.GetEngine(db.DefaultContext).ID(u.ID).Cols("avatar, use_custom_avatar").Update(u); err != nil { + if _, err := db.GetEngine(ctx).ID(u.ID).Cols("avatar, use_custom_avatar").Update(u); err != nil { return fmt.Errorf("UpdateUser: %w", err) } return nil diff --git a/services/user/user.go b/services/user/user.go index 53cc361107..b95a7e0639 100644 --- a/services/user/user.go +++ b/services/user/user.go @@ -223,7 +223,7 @@ func DeleteUser(ctx context.Context, u *user_model.User, purge bool) error { } } - ctx, committer, err := db.TxContext(db.DefaultContext) + ctx, committer, err := db.TxContext(ctx) if err != nil { return err } diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index 370a412efb..cec5b6fc3e 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -25,7 +25,7 @@ {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DefaultBranchBranch.DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DefaultBranchBranch.DBBranch.CommitID)}}
-

{{svg "octicon-git-commit" 16 "gt-mr-2"}}{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}} · {{RenderCommitMessage $.Context .DefaultBranchBranch.DBBranch.CommitMessage .RepoLink .Repository.ComposeMetas}} · {{ctx.Locale.Tr "org.repo_updated"}} {{TimeSince .DefaultBranchBranch.DBBranch.CommitTime.AsTime ctx.Locale}}{{if .DefaultBranchBranch.DBBranch.Pusher}}  {{template "shared/user/avatarlink" dict "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}

+

{{svg "octicon-git-commit" 16 "gt-mr-2"}}{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}} · {{RenderCommitMessage $.Context .DefaultBranchBranch.DBBranch.CommitMessage .RepoLink (.Repository.ComposeMetas ctx)}} · {{ctx.Locale.Tr "org.repo_updated"}} {{TimeSince .DefaultBranchBranch.DBBranch.CommitTime.AsTime ctx.Locale}}{{if .DefaultBranchBranch.DBBranch.Pusher}}  {{template "shared/user/avatarlink" dict "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}

{{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}} @@ -101,7 +101,7 @@ {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DBBranch.CommitID)}}
-

{{svg "octicon-git-commit" 16 "gt-mr-2"}}{{ShortSha .DBBranch.CommitID}} · {{RenderCommitMessage $.Context .DBBranch.CommitMessage $.RepoLink $.Repository.ComposeMetas}} · {{ctx.Locale.Tr "org.repo_updated"}} {{TimeSince .DBBranch.CommitTime.AsTime ctx.Locale}}{{if .DBBranch.Pusher}}  {{template "shared/user/avatarlink" dict "user" .DBBranch.Pusher}}  {{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}

+

{{svg "octicon-git-commit" 16 "gt-mr-2"}}{{ShortSha .DBBranch.CommitID}} · {{RenderCommitMessage $.Context .DBBranch.CommitMessage $.RepoLink ($.Repository.ComposeMetas ctx)}} · {{ctx.Locale.Tr "org.repo_updated"}} {{TimeSince .DBBranch.CommitTime.AsTime ctx.Locale}}{{if .DBBranch.Pusher}}  {{template "shared/user/avatarlink" dict "user" .DBBranch.Pusher}}  {{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}

{{end}} diff --git a/templates/repo/commit_page.tmpl b/templates/repo/commit_page.tmpl index e0a63f3041..c0dfc6e0ad 100644 --- a/templates/repo/commit_page.tmpl +++ b/templates/repo/commit_page.tmpl @@ -19,7 +19,7 @@ {{end}}
-

{{RenderCommitMessage $.Context .Commit.Message $.RepoLink $.Repository.ComposeMetas}}{{template "repo/commit_statuses" dict "Status" .CommitStatus "Statuses" .CommitStatuses "root" $}}

+

{{RenderCommitMessage $.Context .Commit.Message $.RepoLink ($.Repository.ComposeMetas ctx)}}{{template "repo/commit_statuses" dict "Status" .CommitStatus "Statuses" .CommitStatuses "root" $}}

{{if not $.PageIsWiki}} {{if IsMultilineCommitMessage .Commit.Message}} -
{{RenderCommitBody $.Context .Commit.Message $.RepoLink $.Repository.ComposeMetas}}
+
{{RenderCommitBody $.Context .Commit.Message $.RepoLink ($.Repository.ComposeMetas ctx)}}
{{end}} {{template "repo/commit_load_branches_and_tags" .}}
@@ -276,7 +276,7 @@ {{TimeSince .NoteCommit.Author.When ctx.Locale}}
-
{{RenderNote $.Context .Note $.RepoLink $.Repository.ComposeMetas}}
+
{{RenderNote $.Context .Note $.RepoLink ($.Repository.ComposeMetas ctx)}}
{{end}} {{template "repo/diff/box" .}} diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index d071fb90a1..cdb893f51f 100644 --- a/templates/repo/commits_list.tmpl +++ b/templates/repo/commits_list.tmpl @@ -60,7 +60,7 @@ {{.Summary | RenderEmoji $.Context}} {{else}} {{$commitLink:= printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String)}} - {{RenderCommitMessageLinkSubject $.Context .Message $commitRepoLink $commitLink $.Repository.ComposeMetas}} + {{RenderCommitMessageLinkSubject $.Context .Message $commitRepoLink $commitLink ($.Repository.ComposeMetas ctx)}} {{end}} {{if IsMultilineCommitMessage .Message}} @@ -68,7 +68,7 @@ {{end}} {{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses "root" $}} {{if IsMultilineCommitMessage .Message}} -
{{RenderCommitBody $.Context .Message $commitRepoLink $.Repository.ComposeMetas}}
+
{{RenderCommitBody $.Context .Message $commitRepoLink ($.Repository.ComposeMetas ctx)}}
{{end}} {{if .Committer}} diff --git a/templates/repo/commits_list_small.tmpl b/templates/repo/commits_list_small.tmpl index 645bd73bb8..5b715a71d4 100644 --- a/templates/repo/commits_list_small.tmpl +++ b/templates/repo/commits_list_small.tmpl @@ -38,12 +38,12 @@
- {{RenderCommitMessageLinkSubject $.root.Context .Message ($.comment.Issue.PullRequest.BaseRepo.Link|Escape) $commitLink $.comment.Issue.PullRequest.BaseRepo.ComposeMetas}} + {{RenderCommitMessageLinkSubject $.root.Context .Message ($.comment.Issue.PullRequest.BaseRepo.Link|Escape) $commitLink ($.comment.Issue.PullRequest.BaseRepo.ComposeMetas ctx)}} {{if IsMultilineCommitMessage .Message}} {{end}} {{if IsMultilineCommitMessage .Message}} -
{{RenderCommitBody $.root.Context .Message ($.comment.Issue.PullRequest.BaseRepo.Link|Escape) $.comment.Issue.PullRequest.BaseRepo.ComposeMetas}}
+
{{RenderCommitBody $.root.Context .Message ($.comment.Issue.PullRequest.BaseRepo.Link|Escape) ($.comment.Issue.PullRequest.BaseRepo.ComposeMetas ctx)}}
{{end}}
{{end}} diff --git a/templates/repo/diff/compare.tmpl b/templates/repo/diff/compare.tmpl index ebeae39222..4ebf34ea84 100644 --- a/templates/repo/diff/compare.tmpl +++ b/templates/repo/diff/compare.tmpl @@ -77,7 +77,7 @@
{{$OwnForkCompareName}}:{{.}}
{{end}} {{end}} - {{if and .RootRepo .RootRepo.AllowsPulls}} + {{if and .RootRepo (.RootRepo.AllowsPulls ctx)}} {{range .RootRepoBranches}}
{{$RootRepoCompareName}}:{{.}}
{{end}} @@ -194,7 +194,7 @@
{{ctx.Locale.Tr "repo.pulls.has_pull_request" (print (Escape $.RepoLink) "/pulls/" .PullRequest.Issue.Index) (Escape $.RepoRelPath) .PullRequest.Index | Safe}}

- {{RenderIssueTitle $.Context .PullRequest.Issue.Title $.RepoLink $.Repository.ComposeMetas}} + {{RenderIssueTitle $.Context .PullRequest.Issue.Title $.RepoLink ($.Repository.ComposeMetas ctx)}} #{{.PullRequest.Issue.Index}}

diff --git a/templates/repo/graph/commits.tmpl b/templates/repo/graph/commits.tmpl index b8817f5c88..3c63046c6c 100644 --- a/templates/repo/graph/commits.tmpl +++ b/templates/repo/graph/commits.tmpl @@ -29,7 +29,7 @@ - {{RenderCommitMessage $.Context $commit.Subject $.RepoLink $.Repository.ComposeMetas}} + {{RenderCommitMessage $.Context $commit.Subject $.RepoLink ($.Repository.ComposeMetas ctx)}} {{range $commit.Refs}} diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 5d4bc64734..2eb9014cdd 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -40,7 +40,7 @@
{{ctx.Locale.Tr "repo.mirror_from"}} {{$.PullMirror.RemoteAddress}}
{{end}} {{if .IsFork}}
{{ctx.Locale.Tr "repo.forked_from"}} {{.BaseRepo.FullName}}
{{end}} - {{if .IsGenerated}}
{{ctx.Locale.Tr "repo.generated_from"}} {{.TemplateRepo.FullName}}
{{end}} + {{if .IsGenerated}}
{{ctx.Locale.Tr "repo.generated_from"}} {{(.TemplateRepo ctx).FullName}}
{{end}}
{{if not (or .IsBeingCreated .IsBroken)}}
diff --git a/templates/repo/icon.tmpl b/templates/repo/icon.tmpl index 0568b74f63..8ad9a77b19 100644 --- a/templates/repo/icon.tmpl +++ b/templates/repo/icon.tmpl @@ -1,4 +1,4 @@ -{{$avatarLink := .RelAvatarLink}} +{{$avatarLink := (.RelAvatarLink ctx)}} {{if $avatarLink}} {{.FullName}} {{else if $.IsTemplate}} diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index 409af3a5d5..a4f7ede74d 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -189,7 +189,7 @@ {{if .AllowMerge}} {{/* user is allowed to merge */}} {{$prUnit := .Repository.MustGetUnit $.Context $.UnitTypePullRequests}} - {{$approvers := .Issue.PullRequest.GetApprovers}} + {{$approvers := (.Issue.PullRequest.GetApprovers ctx)}} {{if or $prUnit.PullRequestsConfig.AllowMerge $prUnit.PullRequestsConfig.AllowRebase $prUnit.PullRequestsConfig.AllowRebaseMerge $prUnit.PullRequestsConfig.AllowSquash}} {{$hasPendingPullRequestMergeTip := ""}} {{if .HasPendingPullRequestMerge}} diff --git a/templates/repo/issue/view_title.tmpl b/templates/repo/issue/view_title.tmpl index c18825f204..d2c48ff275 100644 --- a/templates/repo/issue/view_title.tmpl +++ b/templates/repo/issue/view_title.tmpl @@ -6,7 +6,7 @@

- {{RenderIssueTitle $.Context .Issue.Title $.RepoLink $.Repository.ComposeMetas | RenderCodeBlock}} #{{.Issue.Index}} + {{RenderIssueTitle $.Context .Issue.Title $.RepoLink ($.Repository.ComposeMetas ctx) | RenderCodeBlock}} #{{.Issue.Index}}
diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index bfd59839f5..7e60f27291 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -26,10 +26,10 @@ {{template "repo/commit_statuses" dict "Status" .LatestCommitStatus "Statuses" .LatestCommitStatuses "root" $}} {{$commitLink:= printf "%s/commit/%s" .RepoLink (PathEscape .LatestCommit.ID.String)}} - {{RenderCommitMessageLinkSubject $.Context .LatestCommit.Message $.RepoLink $commitLink $.Repository.ComposeMetas}} + {{RenderCommitMessageLinkSubject $.Context .LatestCommit.Message $.RepoLink $commitLink ($.Repository.ComposeMetas ctx)}} {{if IsMultilineCommitMessage .LatestCommit.Message}} -
{{RenderCommitBody $.Context .LatestCommit.Message $.RepoLink $.Repository.ComposeMetas}}
+
{{RenderCommitBody $.Context .LatestCommit.Message $.RepoLink ($.Repository.ComposeMetas ctx)}}
{{end}}
{{end}} @@ -83,7 +83,7 @@ {{if $commit}} {{$commitLink := printf "%s/commit/%s" $.RepoLink (PathEscape $commit.ID.String)}} - {{RenderCommitMessageLinkSubject $.Context $commit.Message $.RepoLink $commitLink $.Repository.ComposeMetas}} + {{RenderCommitMessageLinkSubject $.Context $commit.Message $.RepoLink $commitLink ($.Repository.ComposeMetas ctx)}} {{else}}
{{end}} diff --git a/templates/shared/issueicon.tmpl b/templates/shared/issueicon.tmpl index 6e1c654818..089e80bd8b 100644 --- a/templates/shared/issueicon.tmpl +++ b/templates/shared/issueicon.tmpl @@ -7,9 +7,9 @@ {{if .IsClosed}} {{svg "octicon-git-pull-request" 16 "text red"}} {{else}} - {{if and .PullRequest .PullRequest.IsWorkInProgress}} + {{if and .PullRequest (.PullRequest.IsWorkInProgress ctx)}} {{svg "octicon-git-pull-request-draft" 16 "text grey"}} - {{else if and (.GetPullRequest ctx) (.GetPullRequest ctx).IsWorkInProgress}} + {{else if and (.GetPullRequest ctx) ((.GetPullRequest ctx).IsWorkInProgress ctx)}} {{svg "octicon-git-pull-request-draft" 16 "text grey"}} {{else}} {{svg "octicon-git-pull-request" 16 "text green"}} diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index c986dcfb44..7a2c4c7815 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -90,7 +90,7 @@ {{ShortSha .Sha1}} - {{RenderCommitMessage $.Context .Message $repoLink $.ComposeMetas}} + {{RenderCommitMessage $.Context .Message $repoLink ($.ComposeMetas ctx)}}
{{end}} diff --git a/tests/integration/auth_ldap_test.go b/tests/integration/auth_ldap_test.go index ac4c41bf4d..dbd3bc9346 100644 --- a/tests/integration/auth_ldap_test.go +++ b/tests/integration/auth_ldap_test.go @@ -332,7 +332,7 @@ func TestLDAPUserSyncWithGroupFilter(t *testing.T) { }) ldapConfig := ldapSource.Cfg.(*ldap.Source) ldapConfig.GroupFilter = "(cn=ship_crew)" - auth_model.UpdateSource(ldapSource) + auth_model.UpdateSource(db.DefaultContext, ldapSource) auth.SyncExternalUsers(context.Background(), true) diff --git a/tests/integration/pull_merge_test.go b/tests/integration/pull_merge_test.go index adb0e982c0..f94809e4b3 100644 --- a/tests/integration/pull_merge_test.go +++ b/tests/integration/pull_merge_test.go @@ -425,6 +425,6 @@ func TestConflictChecking(t *testing.T) { // Check if status is correct. assert.Equal(t, issues_model.PullRequestStatusConflict, conflictingPR.Status) // Ensure that mergeable returns false - assert.False(t, conflictingPR.Mergeable()) + assert.False(t, conflictingPR.Mergeable(db.DefaultContext)) }) } From 248b7ee850ecdb538b22ddcfbe80b6f91be32b70 Mon Sep 17 00:00:00 2001 From: Nanguan Lin <70063547+lng2020@users.noreply.github.com> Date: Wed, 11 Oct 2023 13:25:31 +0800 Subject: [PATCH 34/45] Align ISSUE_TEMPLATE with the new label system (#27573) As title --- .github/ISSUE_TEMPLATE/bug-report.yaml | 2 +- .github/ISSUE_TEMPLATE/feature-request.yaml | 2 +- .github/ISSUE_TEMPLATE/ui.bug-report.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yaml b/.github/ISSUE_TEMPLATE/bug-report.yaml index c482affbbd..94c1bd0ab7 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yaml +++ b/.github/ISSUE_TEMPLATE/bug-report.yaml @@ -1,6 +1,6 @@ name: Bug Report description: Found something you weren't expecting? Report it here! -labels: ["kind/bug"] +labels: ["type/bug"] body: - type: markdown attributes: diff --git a/.github/ISSUE_TEMPLATE/feature-request.yaml b/.github/ISSUE_TEMPLATE/feature-request.yaml index 71aaa09423..3c9953019d 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yaml +++ b/.github/ISSUE_TEMPLATE/feature-request.yaml @@ -1,6 +1,6 @@ name: Feature Request description: Got an idea for a feature that Gitea doesn't have currently? Submit your idea here! -labels: ["kind/proposal"] +labels: ["type/proposal"] body: - type: markdown attributes: diff --git a/.github/ISSUE_TEMPLATE/ui.bug-report.yaml b/.github/ISSUE_TEMPLATE/ui.bug-report.yaml index ef0a1014e5..387aee897b 100644 --- a/.github/ISSUE_TEMPLATE/ui.bug-report.yaml +++ b/.github/ISSUE_TEMPLATE/ui.bug-report.yaml @@ -1,6 +1,6 @@ name: Web Interface Bug Report description: Something doesn't look quite as it should? Report it here! -labels: ["kind/bug", "kind/ui"] +labels: ["type/bug", "topic/ui"] body: - type: markdown attributes: From 4378f9dfff6a065dbf3204706392f03e69afa56e Mon Sep 17 00:00:00 2001 From: zeripath Date: Wed, 11 Oct 2023 06:55:17 +0100 Subject: [PATCH 35/45] Revert "Simplify `contrib/backport` (#27520)" (#27566) This reverts #27520 commit 79e8865aaed43de81816390ee616263bb2bee67f which breaks `--continue` functionality. --- contrib/backport/backport.go | 237 +++++++++++++++++++++++++++++++++-- 1 file changed, 225 insertions(+), 12 deletions(-) diff --git a/contrib/backport/backport.go b/contrib/backport/backport.go index 383a848007..5cd0fe0f6e 100644 --- a/contrib/backport/backport.go +++ b/contrib/backport/backport.go @@ -7,6 +7,7 @@ package main import ( "context" "fmt" + "log" "net/http" "os" "os/exec" @@ -18,8 +19,11 @@ import ( "github.com/google/go-github/v53/github" "github.com/urfave/cli/v2" + "gopkg.in/yaml.v3" ) +const defaultVersion = "v1.18" // to backport to + func main() { app := cli.NewApp() app.Name = "backport" @@ -50,6 +54,16 @@ func main() { Name: "backport-branch", Usage: "Backport branch to backport on to (default: backport--", }, + &cli.StringFlag{ + Name: "remote", + Value: "", + Usage: "Remote for your fork of the Gitea upstream", + }, + &cli.StringFlag{ + Name: "fork-user", + Value: "", + Usage: "Forked user name on Github", + }, &cli.BoolFlag{ Name: "no-fetch", Usage: "Set this flag to prevent fetch of remote branches", @@ -58,6 +72,18 @@ func main() { Name: "no-amend-message", Usage: "Set this flag to prevent automatic amendment of the commit message", }, + &cli.BoolFlag{ + Name: "no-push", + Usage: "Set this flag to prevent pushing the backport up to your fork", + }, + &cli.BoolFlag{ + Name: "no-xdg-open", + Usage: "Set this flag to not use xdg-open to open the PR URL", + }, + &cli.BoolFlag{ + Name: "continue", + Usage: "Set this flag to continue from a git cherry-pick that has broken", + }, } cli.AppHelpTemplate = `NAME: {{.Name}} - {{.Usage}} @@ -75,7 +101,7 @@ OPTIONS: app.Action = runBackport if err := app.Run(os.Args); err != nil { - fmt.Fprintf(os.Stderr, "%v\n", err) + fmt.Fprintf(os.Stderr, "Unable to backport: %v\n", err) } } @@ -83,9 +109,24 @@ func runBackport(c *cli.Context) error { ctx, cancel := installSignals() defer cancel() + continuing := c.Bool("continue") + + var pr string + version := c.String("version") + if version == "" && continuing { + // determine version from current branch name + var err error + pr, version, err = readCurrentBranch(ctx) + if err != nil { + return err + } + } if version == "" { - return fmt.Errorf("Provide a version to backport to") + version = readVersion() + } + if version == "" { + version = defaultVersion } upstream := c.String("upstream") @@ -93,6 +134,16 @@ func runBackport(c *cli.Context) error { upstream = "origin" } + forkUser := c.String("fork-user") + remote := c.String("remote") + if remote == "" && !c.Bool("--no-push") { + var err error + remote, forkUser, err = determineRemote(ctx, forkUser) + if err != nil { + return err + } + } + upstreamReleaseBranch := c.String("release-branch") if upstreamReleaseBranch == "" { upstreamReleaseBranch = path.Join("release", version) @@ -101,12 +152,14 @@ func runBackport(c *cli.Context) error { localReleaseBranch := path.Join(upstream, upstreamReleaseBranch) args := c.Args().Slice() - if len(args) == 0 { - return fmt.Errorf("Provide a PR number to backport") - } else if len(args) != 1 { - return fmt.Errorf("Only a single PR can be backported at a time") + if len(args) == 0 && pr == "" { + return fmt.Errorf("no PR number provided\nProvide a PR number to backport") + } else if len(args) != 1 && pr == "" { + return fmt.Errorf("multiple PRs provided %v\nOnly a single PR can be backported at a time", args) + } + if pr == "" { + pr = args[0] } - pr := args[0] backportBranch := c.String("backport-branch") if backportBranch == "" { @@ -133,8 +186,10 @@ func runBackport(c *cli.Context) error { } } - if err := checkoutBackportBranch(ctx, backportBranch, localReleaseBranch); err != nil { - return err + if !continuing { + if err := checkoutBackportBranch(ctx, backportBranch, localReleaseBranch); err != nil { + return err + } } if err := cherrypick(ctx, sha); err != nil { @@ -147,8 +202,41 @@ func runBackport(c *cli.Context) error { } } - fmt.Printf("Backport done! You can now push it with `git push %s`\n", backportBranch) + if !c.Bool("no-push") { + url := "https://github.com/go-gitea/gitea/compare/" + upstreamReleaseBranch + "..." + forkUser + ":" + backportBranch + if err := gitPushUp(ctx, remote, backportBranch); err != nil { + return err + } + + if !c.Bool("no-xdg-open") { + if err := xdgOpen(ctx, url); err != nil { + return err + } + } else { + fmt.Printf("* Navigate to %s to open PR\n", url) + } + } + return nil +} + +func xdgOpen(ctx context.Context, url string) error { + fmt.Printf("* `xdg-open %s`\n", url) + out, err := exec.CommandContext(ctx, "xdg-open", url).Output() + if err != nil { + fmt.Fprintf(os.Stderr, "%s", string(out)) + return fmt.Errorf("unable to xdg-open to %s: %w", url, err) + } + return nil +} + +func gitPushUp(ctx context.Context, remote, backportBranch string) error { + fmt.Printf("* `git push -u %s %s`\n", remote, backportBranch) + out, err := exec.CommandContext(ctx, "git", "push", "-u", remote, backportBranch).Output() + if err != nil { + fmt.Fprintf(os.Stderr, "%s", string(out)) + return fmt.Errorf("unable to push up to %s: %w", remote, err) + } return nil } @@ -179,6 +267,18 @@ func amendCommit(ctx context.Context, pr string) error { } func cherrypick(ctx context.Context, sha string) error { + // Check if a CHERRY_PICK_HEAD exists + if _, err := os.Stat(".git/CHERRY_PICK_HEAD"); err == nil { + // Assume that we are in the middle of cherry-pick - continue it + fmt.Println("* Attempting git cherry-pick --continue") + out, err := exec.CommandContext(ctx, "git", "cherry-pick", "--continue").Output() + if err != nil { + fmt.Fprintf(os.Stderr, "git cherry-pick --continue failed:\n%s\n", string(out)) + return fmt.Errorf("unable to continue cherry-pick: %w", err) + } + return nil + } + fmt.Printf("* Attempting git cherry-pick %s\n", sha) out, err := exec.CommandContext(ctx, "git", "cherry-pick", sha).Output() if err != nil { @@ -189,8 +289,22 @@ func cherrypick(ctx context.Context, sha string) error { } func checkoutBackportBranch(ctx context.Context, backportBranch, releaseBranch string) error { - fmt.Printf("* `git branch -D %s`\n", backportBranch) - _ = exec.CommandContext(ctx, "git", "branch", "-D", backportBranch).Run() + out, err := exec.CommandContext(ctx, "git", "branch", "--show-current").Output() + if err != nil { + return fmt.Errorf("unable to check current branch %w", err) + } + + currentBranch := strings.TrimSpace(string(out)) + fmt.Printf("* Current branch is %s\n", currentBranch) + if currentBranch == backportBranch { + fmt.Printf("* Current branch is %s - not checking out\n", currentBranch) + return nil + } + + if _, err := exec.CommandContext(ctx, "git", "rev-list", "-1", backportBranch).Output(); err == nil { + fmt.Printf("* Branch %s already exists. Checking it out...\n", backportBranch) + return exec.CommandContext(ctx, "git", "checkout", "-f", backportBranch).Run() + } fmt.Printf("* `git checkout -b %s %s`\n", backportBranch, releaseBranch) return exec.CommandContext(ctx, "git", "checkout", "-b", backportBranch, releaseBranch).Run() @@ -203,6 +317,7 @@ func fetchRemoteAndMain(ctx context.Context, remote, releaseBranch string) error fmt.Println(string(out)) return fmt.Errorf("unable to fetch %s from %s: %w", "main", remote, err) } + fmt.Println(string(out)) fmt.Printf("* `git fetch %s %s`\n", remote, releaseBranch) out, err = exec.CommandContext(ctx, "git", "fetch", remote, releaseBranch).Output() @@ -210,10 +325,108 @@ func fetchRemoteAndMain(ctx context.Context, remote, releaseBranch string) error fmt.Println(string(out)) return fmt.Errorf("unable to fetch %s from %s: %w", releaseBranch, remote, err) } + fmt.Println(string(out)) return nil } +func determineRemote(ctx context.Context, forkUser string) (string, string, error) { + out, err := exec.CommandContext(ctx, "git", "remote", "-v").Output() + if err != nil { + fmt.Fprintf(os.Stderr, "Unable to list git remotes:\n%s\n", string(out)) + return "", "", fmt.Errorf("unable to determine forked remote: %w", err) + } + lines := strings.Split(string(out), "\n") + for _, line := range lines { + fields := strings.Split(line, "\t") + name, remote := fields[0], fields[1] + // only look at pushers + if !strings.HasSuffix(remote, " (push)") { + continue + } + // only look at github.com pushes + if !strings.Contains(remote, "github.com") { + continue + } + // ignore go-gitea/gitea + if strings.Contains(remote, "go-gitea/gitea") { + continue + } + if !strings.Contains(remote, forkUser) { + continue + } + if strings.HasPrefix(remote, "git@github.com:") { + forkUser = strings.TrimPrefix(remote, "git@github.com:") + } else if strings.HasPrefix(remote, "https://github.com/") { + forkUser = strings.TrimPrefix(remote, "https://github.com/") + } else if strings.HasPrefix(remote, "https://www.github.com/") { + forkUser = strings.TrimPrefix(remote, "https://www.github.com/") + } else if forkUser == "" { + return "", "", fmt.Errorf("unable to extract forkUser from remote %s: %s", name, remote) + } + idx := strings.Index(forkUser, "/") + if idx >= 0 { + forkUser = forkUser[:idx] + } + return name, forkUser, nil + } + return "", "", fmt.Errorf("unable to find appropriate remote in:\n%s", string(out)) +} + +func readCurrentBranch(ctx context.Context) (pr, version string, err error) { + out, err := exec.CommandContext(ctx, "git", "branch", "--show-current").Output() + if err != nil { + fmt.Fprintf(os.Stderr, "Unable to read current git branch:\n%s\n", string(out)) + return "", "", fmt.Errorf("unable to read current git branch: %w", err) + } + parts := strings.Split(strings.TrimSpace(string(out)), "-") + + if len(parts) != 3 || parts[0] != "backport" { + fmt.Fprintf(os.Stderr, "Unable to continue from git branch:\n%s\n", string(out)) + return "", "", fmt.Errorf("unable to continue from git branch:\n%s", string(out)) + } + + return parts[1], parts[2], nil +} + +func readVersion() string { + bs, err := os.ReadFile("docs/config.yaml") + if err != nil { + if err == os.ErrNotExist { + log.Println("`docs/config.yaml` not present") + return "" + } + fmt.Fprintf(os.Stderr, "Unable to read `docs/config.yaml`: %v\n", err) + return "" + } + + type params struct { + Version string + } + type docConfig struct { + Params params + } + dc := &docConfig{} + if err := yaml.Unmarshal(bs, dc); err != nil { + fmt.Fprintf(os.Stderr, "Unable to read `docs/config.yaml`: %v\n", err) + return "" + } + + if dc.Params.Version == "" { + fmt.Fprintf(os.Stderr, "No version in `docs/config.yaml`") + return "" + } + + version := dc.Params.Version + if version[0] != 'v' { + version = "v" + version + } + + split := strings.SplitN(version, ".", 3) + + return strings.Join(split[:2], ".") +} + func determineSHAforPR(ctx context.Context, prStr string) (string, error) { prNum, err := strconv.Atoi(prStr) if err != nil { From dc7cf7a984f9490fb65a137a73bfbda4b58979bb Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Wed, 11 Oct 2023 02:39:32 -0400 Subject: [PATCH 36/45] fully replace drone with actions (#27556) this builds binaries and docker images for tags --- .drone.yml | 428 ---------------------- .github/workflows/release-nightly.yml | 2 +- .github/workflows/release-tag-rc.yml | 125 +++++++ .github/workflows/release-tag-version.yml | 141 +++++++ .yamllint.yaml | 2 - 5 files changed, 267 insertions(+), 431 deletions(-) delete mode 100644 .drone.yml create mode 100644 .github/workflows/release-tag-rc.yml create mode 100644 .github/workflows/release-tag-version.yml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 1989b6760e..0000000000 --- a/.drone.yml +++ /dev/null @@ -1,428 +0,0 @@ ---- -kind: pipeline -name: release-version - -platform: - os: linux - arch: amd64 - -workspace: - base: /source - path: / - -trigger: - event: - - tag - -volumes: - - name: deps - temp: {} - -steps: - - name: fetch-tags - image: docker:git - pull: always - commands: - - git fetch --tags --force - - - name: deps-frontend - image: node:20 - pull: always - commands: - - make deps-frontend - - - name: deps-backend - image: gitea/test_env:linux-1.20-amd64 - pull: always - commands: - - make deps-backend - volumes: - - name: deps - path: /go - - - name: static - image: techknowlogick/xgo:go-1.21.x - pull: always - commands: - - apt-get update && apt-get -qqy install ca-certificates curl gnupg - - mkdir -p /etc/apt/keyrings && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg - - echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" > /etc/apt/sources.list.d/nodesource.list - - apt-get update && apt-get -qqy install nodejs - - export PATH=$PATH:$GOPATH/bin - - make release - environment: - GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not - TAGS: bindata sqlite sqlite_unlock_notify - DEBIAN_FRONTEND: noninteractive - depends_on: [fetch-tags] - volumes: - - name: deps - path: /go - - - name: gpg-sign - image: plugins/gpgsign:1 - pull: always - settings: - detach_sign: true - excludes: - - "dist/release/*.sha256" - files: - - "dist/release/*" - environment: - GPGSIGN_KEY: - from_secret: gpgsign_key - GPGSIGN_PASSPHRASE: - from_secret: gpgsign_passphrase - depends_on: [static] - - - name: release-tag - image: woodpeckerci/plugin-s3:latest - pull: always - settings: - acl: - from_secret: aws_s3_acl - region: - from_secret: aws_s3_region - bucket: - from_secret: aws_s3_bucket - endpoint: - from_secret: aws_s3_endpoint - path_style: - from_secret: aws_s3_path_style - source: "dist/release/*" - strip_prefix: dist/release/ - target: "/gitea/${DRONE_TAG##v}" - environment: - AWS_ACCESS_KEY_ID: - from_secret: aws_access_key_id - AWS_SECRET_ACCESS_KEY: - from_secret: aws_secret_access_key - depends_on: [gpg-sign] - - - name: github - image: plugins/github-release:latest - pull: always - settings: - files: - - "dist/release/*" - file_exists: overwrite - environment: - GITHUB_TOKEN: - from_secret: github_token - depends_on: [gpg-sign] - ---- -kind: pipeline -type: docker -name: docker-linux-amd64-release-version - -platform: - os: linux - arch: amd64 - -trigger: - ref: - include: - - "refs/tags/**" - exclude: - - "refs/tags/**-rc*" - paths: - exclude: - - "docs/**" - -steps: - - name: fetch-tags - image: docker:git - pull: always - commands: - - git fetch --tags --force - - - name: publish - image: plugins/docker:latest - pull: always - settings: - auto_tag: true - auto_tag_suffix: linux-amd64 - repo: gitea/gitea - build_args: - - GOPROXY=https://goproxy.io - password: - from_secret: docker_password - username: - from_secret: docker_username - environment: - PLUGIN_MIRROR: - from_secret: plugin_mirror - DOCKER_BUILDKIT: 1 - when: - event: - exclude: - - pull_request - - - name: publish-rootless - image: plugins/docker:latest - settings: - dockerfile: Dockerfile.rootless - auto_tag: true - auto_tag_suffix: linux-amd64-rootless - repo: gitea/gitea - build_args: - - GOPROXY=https://goproxy.io - password: - from_secret: docker_password - username: - from_secret: docker_username - environment: - PLUGIN_MIRROR: - from_secret: plugin_mirror - DOCKER_BUILDKIT: 1 - when: - event: - exclude: - - pull_request ---- - -kind: pipeline -type: docker -name: docker-linux-amd64-release-candidate-version - -platform: - os: linux - arch: amd64 - -trigger: - ref: - - "refs/tags/**-rc*" - paths: - exclude: - - "docs/**" - -steps: - - name: fetch-tags - image: docker:git - pull: always - commands: - - git fetch --tags --force - - - name: publish - image: plugins/docker:latest - pull: always - settings: - tags: ${DRONE_TAG##v}-linux-amd64 - repo: gitea/gitea - build_args: - - GOPROXY=https://goproxy.io - password: - from_secret: docker_password - username: - from_secret: docker_username - environment: - PLUGIN_MIRROR: - from_secret: plugin_mirror - DOCKER_BUILDKIT: 1 - when: - event: - exclude: - - pull_request - - - name: publish-rootless - image: plugins/docker:latest - settings: - dockerfile: Dockerfile.rootless - tags: ${DRONE_TAG##v}-linux-amd64-rootless - repo: gitea/gitea - build_args: - - GOPROXY=https://goproxy.io - password: - from_secret: docker_password - username: - from_secret: docker_username - environment: - PLUGIN_MIRROR: - from_secret: plugin_mirror - DOCKER_BUILDKIT: 1 - when: - event: - exclude: - - pull_request - ---- -kind: pipeline -type: docker -name: docker-linux-arm64-release-version - -platform: - os: linux - arch: arm64 - -trigger: - ref: - include: - - "refs/tags/**" - exclude: - - "refs/tags/**-rc*" - paths: - exclude: - - "docs/**" - -steps: - - name: fetch-tags - image: docker:git - pull: always - commands: - - git fetch --tags --force - - - name: publish - image: plugins/docker:latest - pull: always - settings: - auto_tag: true - auto_tag_suffix: linux-arm64 - repo: gitea/gitea - build_args: - - GOPROXY=https://goproxy.io - password: - from_secret: docker_password - username: - from_secret: docker_username - environment: - PLUGIN_MIRROR: - from_secret: plugin_mirror - DOCKER_BUILDKIT: 1 - when: - event: - exclude: - - pull_request - - - name: publish-rootless - image: plugins/docker:latest - settings: - dockerfile: Dockerfile.rootless - auto_tag: true - auto_tag_suffix: linux-arm64-rootless - repo: gitea/gitea - build_args: - - GOPROXY=https://goproxy.io - password: - from_secret: docker_password - username: - from_secret: docker_username - environment: - PLUGIN_MIRROR: - from_secret: plugin_mirror - DOCKER_BUILDKIT: 1 - when: - event: - exclude: - - pull_request - ---- -kind: pipeline -type: docker -name: docker-linux-arm64-release-candidate-version - -platform: - os: linux - arch: arm64 - -trigger: - ref: - - "refs/tags/**-rc*" - paths: - exclude: - - "docs/**" - -steps: - - name: fetch-tags - image: docker:git - pull: always - commands: - - git fetch --tags --force - - - name: publish - image: plugins/docker:latest - pull: always - settings: - tags: ${DRONE_TAG##v}-linux-arm64 - repo: gitea/gitea - build_args: - - GOPROXY=https://goproxy.io - password: - from_secret: docker_password - username: - from_secret: docker_username - environment: - PLUGIN_MIRROR: - from_secret: plugin_mirror - DOCKER_BUILDKIT: 1 - when: - event: - exclude: - - pull_request - - - name: publish-rootless - image: plugins/docker:latest - settings: - dockerfile: Dockerfile.rootless - tags: ${DRONE_TAG##v}-linux-arm64-rootless - repo: gitea/gitea - build_args: - - GOPROXY=https://goproxy.io - password: - from_secret: docker_password - username: - from_secret: docker_username - environment: - PLUGIN_MIRROR: - from_secret: plugin_mirror - DOCKER_BUILDKIT: 1 - when: - event: - exclude: - - pull_request - ---- -kind: pipeline -type: docker -name: docker-manifest-version - -platform: - os: linux - arch: amd64 - -steps: - - name: manifest-rootless - image: plugins/manifest - pull: always - settings: - auto_tag: true - ignore_missing: true - spec: docker/manifest.rootless.tmpl - password: - from_secret: docker_password - username: - from_secret: docker_username - - - name: manifest - image: plugins/manifest - settings: - auto_tag: true - ignore_missing: true - spec: docker/manifest.tmpl - password: - from_secret: docker_password - username: - from_secret: docker_username - -trigger: - ref: - - "refs/tags/**" - paths: - exclude: - - "docs/**" - -depends_on: - - docker-linux-amd64-release-version - - docker-linux-amd64-release-candidate-version - - docker-linux-arm64-release-version - - docker-linux-arm64-release-candidate-version diff --git a/.github/workflows/release-nightly.yml b/.github/workflows/release-nightly.yml index 09198c3161..cc2afca5dd 100644 --- a/.github/workflows/release-nightly.yml +++ b/.github/workflows/release-nightly.yml @@ -1,4 +1,4 @@ -name: release-nightly-assets +name: release-nightly on: push: diff --git a/.github/workflows/release-tag-rc.yml b/.github/workflows/release-tag-rc.yml new file mode 100644 index 0000000000..9019fc9a3a --- /dev/null +++ b/.github/workflows/release-tag-rc.yml @@ -0,0 +1,125 @@ +name: release-tag-rc + +on: + push: + tags: + - 'v1*-rc*' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +jobs: + binary: + runs-on: nscloud + steps: + - uses: actions/checkout@v4 + # fetch all commits instead of only the last as some branches are long lived and could have many between versions + # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 + - run: git fetch --unshallow --quiet --tags --force + - uses: actions/setup-go@v4 + with: + go-version: "~1.21" + check-latest: true + - uses: actions/setup-node@v3 + with: + node-version: 20 + - run: make deps-frontend deps-backend + # xgo build + - run: make release + env: + TAGS: bindata sqlite sqlite_unlock_notify + - name: import gpg key + id: import_gpg + uses: crazy-max/ghaction-import-gpg@v5 + with: + gpg_private_key: ${{ secrets.GPGSIGN_KEY }} + passphrase: ${{ secrets.GPGSIGN_PASSPHRASE }} + - name: sign binaries + run: | + for f in dist/release/*; do + echo '${{ secrets.GPGSIGN_PASSPHRASE }}' | gpg --pinentry-mode loopback --passphrase-fd 0 --batch --yes --detach-sign -u ${{ steps.import_gpg.outputs.fingerprint }} --output "$f.asc" "$f" + done + # clean branch name to get the folder name in S3 + - name: Get cleaned branch name + id: clean_name + run: | + REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//') + echo "Cleaned name is ${REF_NAME}" + echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT" + - name: configure aws + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-region: ${{ secrets.AWS_REGION }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + - name: upload binaries to s3 + run: | + aws s3 sync dist/release s3://${{ secrets.AWS_S3_BUCKET }}/gitea/${{ steps.clean_name.outputs.branch }} --no-progress + - name: create github release + run: | + gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --draft --notes-from-tag dist/release/* + env: + GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} + docker-rootful: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + # fetch all commits instead of only the last as some branches are long lived and could have many between versions + # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 + - run: git fetch --unshallow --quiet --tags --force + - uses: docker/setup-qemu-action@v2 + - uses: docker/setup-buildx-action@v2 + - uses: docker/metadata-action@v5 + id: meta + with: + images: gitea/gitea + # 1.2.3-rc0 + tags: | + type=semver,pattern={{version}} + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: build rootful docker image + uses: docker/build-push-action@v4 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + docker-rootless: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + # fetch all commits instead of only the last as some branches are long lived and could have many between versions + # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 + - run: git fetch --unshallow --quiet --tags --force + - uses: docker/setup-qemu-action@v2 + - uses: docker/setup-buildx-action@v2 + - uses: docker/metadata-action@v5 + id: meta + with: + images: gitea/gitea + # each tag below will have the suffix of -rootless + flavor: | + suffix=-rootless + # 1.2.3-rc0 + tags: | + type=semver,pattern={{version}} + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: build rootless docker image + uses: docker/build-push-action@v4 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + file: Dockerfile.rootless + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/release-tag-version.yml b/.github/workflows/release-tag-version.yml new file mode 100644 index 0000000000..c643166666 --- /dev/null +++ b/.github/workflows/release-tag-version.yml @@ -0,0 +1,141 @@ +name: release-tag-version + +on: + push: + tags: + - 'v1.*' + - '!v1*-rc*' + - '!v1*-dev' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +jobs: + binary: + runs-on: nscloud + steps: + - uses: actions/checkout@v4 + # fetch all commits instead of only the last as some branches are long lived and could have many between versions + # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 + - run: git fetch --unshallow --quiet --tags --force + - uses: actions/setup-go@v4 + with: + go-version: "~1.21" + check-latest: true + - uses: actions/setup-node@v3 + with: + node-version: 20 + - run: make deps-frontend deps-backend + # xgo build + - run: make release + env: + TAGS: bindata sqlite sqlite_unlock_notify + - name: import gpg key + id: import_gpg + uses: crazy-max/ghaction-import-gpg@v5 + with: + gpg_private_key: ${{ secrets.GPGSIGN_KEY }} + passphrase: ${{ secrets.GPGSIGN_PASSPHRASE }} + - name: sign binaries + run: | + for f in dist/release/*; do + echo '${{ secrets.GPGSIGN_PASSPHRASE }}' | gpg --pinentry-mode loopback --passphrase-fd 0 --batch --yes --detach-sign -u ${{ steps.import_gpg.outputs.fingerprint }} --output "$f.asc" "$f" + done + # clean branch name to get the folder name in S3 + - name: Get cleaned branch name + id: clean_name + run: | + REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//') + echo "Cleaned name is ${REF_NAME}" + echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT" + - name: configure aws + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-region: ${{ secrets.AWS_REGION }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + - name: upload binaries to s3 + run: | + aws s3 sync dist/release s3://${{ secrets.AWS_S3_BUCKET }}/gitea/${{ steps.clean_name.outputs.branch }} --no-progress + - name: create github release + run: | + gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --draft --notes-from-tag dist/release/* + env: + GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} + docker-rootful: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + # fetch all commits instead of only the last as some branches are long lived and could have many between versions + # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 + - run: git fetch --unshallow --quiet --tags --force + - uses: docker/setup-qemu-action@v2 + - uses: docker/setup-buildx-action@v2 + - uses: docker/metadata-action@v5 + id: meta + with: + images: gitea/gitea + # this will generate tags in the following format: + # latest + # 1 + # 1.2 + # 1.2.3 + tags: | + type=raw,value=latest + type=semver,pattern={{major}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{version}} + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: build rootful docker image + uses: docker/build-push-action@v4 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + docker-rootless: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + # fetch all commits instead of only the last as some branches are long lived and could have many between versions + # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 + - run: git fetch --unshallow --quiet --tags --force + - uses: docker/setup-qemu-action@v2 + - uses: docker/setup-buildx-action@v2 + - uses: docker/metadata-action@v5 + id: meta + with: + images: gitea/gitea + # each tag below will have the suffix of -rootless + flavor: | + suffix=-rootless + # this will generate tags in the following format (with -rootless suffix added): + # latest + # 1 + # 1.2 + # 1.2.3 + tags: | + type=raw,value=latest + type=semver,pattern={{major}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{version}} + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: build rootless docker image + uses: docker/build-push-action@v4 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + file: Dockerfile.rootless + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.yamllint.yaml b/.yamllint.yaml index 7f0517fb7e..5a1e1e8751 100644 --- a/.yamllint.yaml +++ b/.yamllint.yaml @@ -24,8 +24,6 @@ rules: document-start: level: error present: false - ignore: | - /.drone.yml document-end: present: false From 1050d7a78fa905a7b518bb0ff968cb771392ee1e Mon Sep 17 00:00:00 2001 From: Earl Warren <109468362+earl-warren@users.noreply.github.com> Date: Wed, 11 Oct 2023 09:28:16 +0200 Subject: [PATCH 37/45] show manual cron run's last time (#27544) - Currently in the cron tasks, the 'Previous Time' only displays the previous time of when the cron library executes the function, but not any of the manual executions of the task. - Store the last run's time in memory in the Task struct and use that, when that time is later than time that the cron library has executed this task. - This ensures that if an instance admin manually starts a task, there's feedback that this task is/has been run, because the task might be run that quick, that the status icon already has been changed to an checkmark, - Tasks that are executed at startup now reflect this as well, as the time of the execution of that task on startup is now being shown as 'Previous Time'. - Added integration tests for the API part, which is easier to test because querying the HTML table of cron tasks is non-trivial. - Resolves https://codeberg.org/forgejo/forgejo/issues/949 (cherry picked from commit fd34fdac1408ece6b7d9fe6a76501ed9a45d06fa) --------- Co-authored-by: Gusted Co-authored-by: KN4CK3R Co-authored-by: silverwind --- services/cron/cron.go | 6 ++++ services/cron/tasks.go | 9 ++++++ tests/integration/api_admin_test.go | 50 +++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+) diff --git a/services/cron/cron.go b/services/cron/cron.go index e3f31d08f0..63db75ab3b 100644 --- a/services/cron/cron.go +++ b/services/cron/cron.go @@ -106,6 +106,12 @@ func ListTasks() TaskTable { next = e.NextRun() prev = e.PreviousRun() } + + // If the manual run is after the cron run, use that instead. + if prev.Before(task.LastRun) { + prev = task.LastRun + } + task.lock.Lock() tTable = append(tTable, &TaskTableRow{ Name: task.Name, diff --git a/services/cron/tasks.go b/services/cron/tasks.go index ea1925c26c..d2c3d1d812 100644 --- a/services/cron/tasks.go +++ b/services/cron/tasks.go @@ -9,6 +9,7 @@ import ( "reflect" "strings" "sync" + "time" "code.gitea.io/gitea/models/db" system_model "code.gitea.io/gitea/models/system" @@ -37,6 +38,8 @@ type Task struct { LastMessage string LastDoer string ExecTimes int64 + // This stores the time of the last manual run of this task. + LastRun time.Time } // DoRunAtStart returns if this task should run at the start @@ -88,6 +91,12 @@ func (t *Task) RunWithUser(doer *user_model.User, config Config) { } }() graceful.GetManager().RunWithShutdownContext(func(baseCtx context.Context) { + // Store the time of this run, before the function is executed, so it + // matches the behavior of what the cron library does. + t.lock.Lock() + t.LastRun = time.Now() + t.lock.Unlock() + pm := process.GetManager() doerName := "" if doer != nil && doer.ID != -1 { diff --git a/tests/integration/api_admin_test.go b/tests/integration/api_admin_test.go index 6613d4b715..aae9ec4a24 100644 --- a/tests/integration/api_admin_test.go +++ b/tests/integration/api_admin_test.go @@ -7,6 +7,7 @@ import ( "fmt" "net/http" "testing" + "time" asymkey_model "code.gitea.io/gitea/models/asymkey" auth_model "code.gitea.io/gitea/models/auth" @@ -282,3 +283,52 @@ func TestAPIRenameUser(t *testing.T) { }) MakeRequest(t, req, http.StatusOK) } + +func TestAPICron(t *testing.T) { + defer tests.PrepareTestEnv(t)() + + // user1 is an admin user + session := loginUser(t, "user1") + + t.Run("List", func(t *testing.T) { + defer tests.PrintCurrentTest(t)() + + token := getTokenForLoggedInUser(t, session, auth_model.AccessTokenScopeReadAdmin) + urlStr := fmt.Sprintf("/api/v1/admin/cron?token=%s", token) + req := NewRequest(t, "GET", urlStr) + resp := MakeRequest(t, req, http.StatusOK) + + assert.Equal(t, "28", resp.Header().Get("X-Total-Count")) + + var crons []api.Cron + DecodeJSON(t, resp, &crons) + assert.Len(t, crons, 28) + }) + + t.Run("Execute", func(t *testing.T) { + defer tests.PrintCurrentTest(t)() + + now := time.Now() + token := getTokenForLoggedInUser(t, session, auth_model.AccessTokenScopeWriteAdmin) + // Archive cleanup is harmless, because in the test environment there are none + // and is thus an NOOP operation and therefore doesn't interfere with any other + // tests. + urlStr := fmt.Sprintf("/api/v1/admin/cron/archive_cleanup?token=%s", token) + req := NewRequest(t, "POST", urlStr) + MakeRequest(t, req, http.StatusNoContent) + + // Check for the latest run time for this cron, to ensure it has been run. + urlStr = fmt.Sprintf("/api/v1/admin/cron?token=%s", token) + req = NewRequest(t, "GET", urlStr) + resp := MakeRequest(t, req, http.StatusOK) + + var crons []api.Cron + DecodeJSON(t, resp, &crons) + + for _, cron := range crons { + if cron.Name == "archive_cleanup" { + assert.True(t, now.Before(cron.Prev)) + } + } + }) +} From dca195e9bd0d14a5cf888524e51175da8ab24588 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 11 Oct 2023 18:01:52 +0800 Subject: [PATCH 38/45] Fix the robots.txt path --- docs/content/administration/search-engines-indexation.en-us.md | 2 +- docs/content/administration/search-engines-indexation.zh-cn.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/administration/search-engines-indexation.en-us.md b/docs/content/administration/search-engines-indexation.en-us.md index 7898e8146e..664940697d 100644 --- a/docs/content/administration/search-engines-indexation.en-us.md +++ b/docs/content/administration/search-engines-indexation.en-us.md @@ -23,7 +23,7 @@ If you don't want your repository to be visible for search engines read further. ## Block search engines indexation using robots.txt To make Gitea serve a custom `robots.txt` (default: empty 404) for top level installations, -create a file called `robots.txt` in the [`custom` folder or `CustomPath`](administration/customizing-gitea.md) +create a file with path `public/robots.txt` in the [`custom` folder or `CustomPath`](administration/customizing-gitea.md) Examples on how to configure the `robots.txt` can be found at [https://moz.com/learn/seo/robotstxt](https://moz.com/learn/seo/robotstxt). diff --git a/docs/content/administration/search-engines-indexation.zh-cn.md b/docs/content/administration/search-engines-indexation.zh-cn.md index 77ad5eca2c..904e6de11b 100644 --- a/docs/content/administration/search-engines-indexation.zh-cn.md +++ b/docs/content/administration/search-engines-indexation.zh-cn.md @@ -22,7 +22,7 @@ menu: ## 使用 robots.txt 阻止搜索引擎索引 -为了使 Gitea 为顶级安装提供自定义的`robots.txt`(默认为空的 404),请在[`custom`文件夹或`CustomPath`](administration/customizing-gitea.md)中创建一个名为 `robots.txt` 的文件。 +为了使 Gitea 为顶级安装提供自定义的`robots.txt`(默认为空的 404),请在 [`custom`文件夹或`CustomPath`](administration/customizing-gitea.md)中创建一个名为 `public/robots.txt` 的文件。 有关如何配置 `robots.txt` 的示例,请参考 [https://moz.com/learn/seo/robotstxt](https://moz.com/learn/seo/robotstxt)。 From dc04044716088e3786497e200abe1fdfb3a943b6 Mon Sep 17 00:00:00 2001 From: Nanguan Lin <70063547+lng2020@users.noreply.github.com> Date: Wed, 11 Oct 2023 19:02:24 +0800 Subject: [PATCH 39/45] Replace assert.Fail with assert.FailNow (#27578) assert.Fail() will continue to execute the code while assert.FailNow() not. I thought those uses of assert.Fail() should exit immediately. PS: perhaps it's a good idea to use [require](https://pkg.go.dev/github.com/stretchr/testify/require) somewhere because the assert package's default behavior does not exit when an error occurs, which makes it difficult to find the root error reason. --- models/asymkey/ssh_key_test.go | 4 ++-- models/unittest/consistency.go | 3 +-- modules/contexttest/context_tests.go | 9 +++------ modules/git/repo_attribute_test.go | 8 ++++---- modules/git/repo_tag_test.go | 2 -- modules/indexer/code/indexer_test.go | 6 ++---- modules/process/manager_test.go | 4 ++-- services/pull/check_test.go | 2 +- tests/integration/api_packages_conan_test.go | 2 +- tests/integration/api_packages_container_test.go | 2 +- tests/integration/api_packages_nuget_test.go | 2 +- tests/integration/api_repo_test.go | 2 +- tests/integration/api_token_test.go | 3 +-- tests/integration/gpg_git_test.go | 9 --------- 14 files changed, 20 insertions(+), 38 deletions(-) diff --git a/models/asymkey/ssh_key_test.go b/models/asymkey/ssh_key_test.go index 5378ef66ba..d3e886b97f 100644 --- a/models/asymkey/ssh_key_test.go +++ b/models/asymkey/ssh_key_test.go @@ -51,7 +51,7 @@ func Test_SSHParsePublicKey(t *testing.T) { if err != nil { // Some servers do not support ecdsa format. if !strings.Contains(err.Error(), "line 1 too long:") { - assert.Fail(t, "%v", err) + assert.FailNow(t, "%v", err) } } assert.Equal(t, tc.keyType, keyTypeK) @@ -60,7 +60,7 @@ func Test_SSHParsePublicKey(t *testing.T) { t.Run("SSHParseKeyNative", func(t *testing.T) { keyTypeK, lengthK, err := SSHNativeParsePublicKey(tc.content) if err != nil { - assert.Fail(t, "%v", err) + assert.FailNow(t, "%v", err) } assert.Equal(t, tc.keyType, keyTypeK) assert.EqualValues(t, tc.length, lengthK) diff --git a/models/unittest/consistency.go b/models/unittest/consistency.go index faa02589aa..71839001be 100644 --- a/models/unittest/consistency.go +++ b/models/unittest/consistency.go @@ -47,8 +47,7 @@ func checkForConsistency(t assert.TestingT, bean any) { assert.NoError(t, err) f := consistencyCheckMap[tb.Name] if f == nil { - assert.Fail(t, "unknown bean type: %#v", bean) - return + assert.FailNow(t, "unknown bean type: %#v", bean) } f(t, bean) } diff --git a/modules/contexttest/context_tests.go b/modules/contexttest/context_tests.go index ea91bc5001..8994c1e451 100644 --- a/modules/contexttest/context_tests.go +++ b/modules/contexttest/context_tests.go @@ -83,8 +83,7 @@ func LoadRepo(t *testing.T, ctx gocontext.Context, repoID int64) { ctx.Repo = repo doer = ctx.Doer default: - assert.Fail(t, "context is not *context.Context or *context.APIContext") - return + assert.FailNow(t, "context is not *context.Context or *context.APIContext") } repo.Repository = unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: repoID}) @@ -105,8 +104,7 @@ func LoadRepoCommit(t *testing.T, ctx gocontext.Context) { case *context.APIContext: repo = ctx.Repo default: - assert.Fail(t, "context is not *context.Context or *context.APIContext") - return + assert.FailNow(t, "context is not *context.Context or *context.APIContext") } gitRepo, err := git.OpenRepository(ctx, repo.Repository.RepoPath()) @@ -130,8 +128,7 @@ func LoadUser(t *testing.T, ctx gocontext.Context, userID int64) { case *context.APIContext: ctx.Doer = doer default: - assert.Fail(t, "context is not *context.Context or *context.APIContext") - return + assert.FailNow(t, "context is not *context.Context or *context.APIContext") } } diff --git a/modules/git/repo_attribute_test.go b/modules/git/repo_attribute_test.go index 350b69dd25..ed16dccbe4 100644 --- a/modules/git/repo_attribute_test.go +++ b/modules/git/repo_attribute_test.go @@ -27,7 +27,7 @@ func Test_nulSeparatedAttributeWriter_ReadAttribute(t *testing.T) { assert.Equal(t, "linguist-vendored", attr.Attribute) assert.Equal(t, "unspecified", attr.Value) case <-time.After(100 * time.Millisecond): - assert.Fail(t, "took too long to read an attribute from the list") + assert.FailNow(t, "took too long to read an attribute from the list") } // Write a second attribute again n, err = wr.Write([]byte(testStr)) @@ -41,7 +41,7 @@ func Test_nulSeparatedAttributeWriter_ReadAttribute(t *testing.T) { assert.Equal(t, "linguist-vendored", attr.Attribute) assert.Equal(t, "unspecified", attr.Value) case <-time.After(100 * time.Millisecond): - assert.Fail(t, "took too long to read an attribute from the list") + assert.FailNow(t, "took too long to read an attribute from the list") } // Write a partial attribute @@ -52,14 +52,14 @@ func Test_nulSeparatedAttributeWriter_ReadAttribute(t *testing.T) { select { case <-wr.ReadAttribute(): - assert.Fail(t, "There should not be an attribute ready to read") + assert.FailNow(t, "There should not be an attribute ready to read") case <-time.After(100 * time.Millisecond): } _, err = wr.Write([]byte("attribute\x00")) assert.NoError(t, err) select { case <-wr.ReadAttribute(): - assert.Fail(t, "There should not be an attribute ready to read") + assert.FailNow(t, "There should not be an attribute ready to read") case <-time.After(100 * time.Millisecond): } diff --git a/modules/git/repo_tag_test.go b/modules/git/repo_tag_test.go index fb6a7cdd1a..4d94efd1ac 100644 --- a/modules/git/repo_tag_test.go +++ b/modules/git/repo_tag_test.go @@ -71,7 +71,6 @@ func TestRepository_GetTag(t *testing.T) { if lTag == nil { assert.NotNil(t, lTag) assert.FailNow(t, "nil lTag: %s", lTagName) - return } assert.EqualValues(t, lTagName, lTag.Name) assert.EqualValues(t, lTagCommitID, lTag.ID.String()) @@ -105,7 +104,6 @@ func TestRepository_GetTag(t *testing.T) { if aTag == nil { assert.NotNil(t, aTag) assert.FailNow(t, "nil aTag: %s", aTagName) - return } assert.EqualValues(t, aTagName, aTag.Name) assert.EqualValues(t, aTagID, aTag.ID.String()) diff --git a/modules/indexer/code/indexer_test.go b/modules/indexer/code/indexer_test.go index 5b2a97d3d5..5eb8e61e3d 100644 --- a/modules/indexer/code/indexer_test.go +++ b/modules/indexer/code/indexer_test.go @@ -96,11 +96,10 @@ func TestBleveIndexAndSearch(t *testing.T) { idx := bleve.NewIndexer(dir) _, err := idx.Init(context.Background()) if err != nil { - assert.Fail(t, "Unable to create bleve indexer Error: %v", err) if idx != nil { idx.Close() } - return + assert.FailNow(t, "Unable to create bleve indexer Error: %v", err) } defer idx.Close() @@ -118,11 +117,10 @@ func TestESIndexAndSearch(t *testing.T) { indexer := elasticsearch.NewIndexer(u, "gitea_codes") if _, err := indexer.Init(context.Background()); err != nil { - assert.Fail(t, "Unable to init ES indexer Error: %v", err) if indexer != nil { indexer.Close() } - return + assert.FailNow(t, "Unable to init ES indexer Error: %v", err) } defer indexer.Close() diff --git a/modules/process/manager_test.go b/modules/process/manager_test.go index 2e2e35d24a..36b2a912ea 100644 --- a/modules/process/manager_test.go +++ b/modules/process/manager_test.go @@ -50,7 +50,7 @@ func TestManager_Cancel(t *testing.T) { select { case <-ctx.Done(): default: - assert.Fail(t, "Cancel should cancel the provided context") + assert.FailNow(t, "Cancel should cancel the provided context") } finished() @@ -62,7 +62,7 @@ func TestManager_Cancel(t *testing.T) { select { case <-ctx.Done(): default: - assert.Fail(t, "Cancel should cancel the provided context") + assert.FailNow(t, "Cancel should cancel the provided context") } finished() } diff --git a/services/pull/check_test.go b/services/pull/check_test.go index 4a99859f5a..dcf5f7b93a 100644 --- a/services/pull/check_test.go +++ b/services/pull/check_test.go @@ -54,7 +54,7 @@ func TestPullRequest_AddToTaskQueue(t *testing.T) { case id := <-idChan: assert.EqualValues(t, pr.ID, id) case <-time.After(time.Second): - assert.Fail(t, "Timeout: nothing was added to pullRequestQueue") + assert.FailNow(t, "Timeout: nothing was added to pullRequestQueue") } has, err = prPatchCheckerQueue.Has(strconv.FormatInt(pr.ID, 10)) diff --git a/tests/integration/api_packages_conan_test.go b/tests/integration/api_packages_conan_test.go index 1f7890f3c0..ab128bf4a5 100644 --- a/tests/integration/api_packages_conan_test.go +++ b/tests/integration/api_packages_conan_test.go @@ -296,7 +296,7 @@ func TestPackageConan(t *testing.T) { assert.Equal(t, int64(len(contentConaninfo)), pb.Size) } else { - assert.Fail(t, "unknown file: %s", pf.Name) + assert.FailNow(t, "unknown file: %s", pf.Name) } } }) diff --git a/tests/integration/api_packages_container_test.go b/tests/integration/api_packages_container_test.go index 01002a4413..93b4ff4624 100644 --- a/tests/integration/api_packages_container_test.go +++ b/tests/integration/api_packages_container_test.go @@ -349,7 +349,7 @@ func TestPackageContainer(t *testing.T) { assert.Equal(t, "application/vnd.docker.image.rootfs.diff.tar.gzip", pfd.Properties.GetByName(container_module.PropertyMediaType)) assert.Equal(t, blobDigest, pfd.Properties.GetByName(container_module.PropertyDigest)) default: - assert.Fail(t, "unknown file: %s", pfd.File.Name) + assert.FailNow(t, "unknown file: %s", pfd.File.Name) } } diff --git a/tests/integration/api_packages_nuget_test.go b/tests/integration/api_packages_nuget_test.go index 520d1dd0a7..04c2fbce0e 100644 --- a/tests/integration/api_packages_nuget_test.go +++ b/tests/integration/api_packages_nuget_test.go @@ -326,7 +326,7 @@ AAAjQmxvYgAAAGm7ENm9SGxMtAFVvPUsPJTF6PbtAAAAAFcVogEJAAAAAQAAAA==`) assert.Equal(t, nuget_module.PropertySymbolID, pps[0].Name) assert.Equal(t, symbolID, pps[0].Value) default: - assert.Fail(t, "unexpected file: %v", pf.Name) + assert.FailNow(t, "unexpected file: %v", pf.Name) } } diff --git a/tests/integration/api_repo_test.go b/tests/integration/api_repo_test.go index a6d32a89ea..d1d6696164 100644 --- a/tests/integration/api_repo_test.go +++ b/tests/integration/api_repo_test.go @@ -368,7 +368,7 @@ func TestAPIRepoMigrate(t *testing.T) { case "You can not import from disallowed hosts.": assert.EqualValues(t, "private-ip", testCase.repoName) default: - assert.Failf(t, "unexpected error '%v' on url '%s'", respJSON["message"], testCase.cloneURL) + assert.FailNow(t, "unexpected error '%v' on url '%s'", respJSON["message"], testCase.cloneURL) } } else { assert.EqualValues(t, testCase.expectedStatus, resp.Code) diff --git a/tests/integration/api_token_test.go b/tests/integration/api_token_test.go index a713922982..fe0e44d97f 100644 --- a/tests/integration/api_token_test.go +++ b/tests/integration/api_token_test.go @@ -483,8 +483,7 @@ func runTestCase(t *testing.T, testCase *requiredScopeTestCase, user *user_model } else if minRequiredLevel == auth_model.Write { unauthorizedLevel = auth_model.Read } else { - assert.Failf(t, "Invalid test case", "Unknown access token scope level: %v", minRequiredLevel) - return + assert.FailNow(t, "Invalid test case: Unknown access token scope level: %v", minRequiredLevel) } } diff --git a/tests/integration/gpg_git_test.go b/tests/integration/gpg_git_test.go index 6d67bec09b..00890cfb38 100644 --- a/tests/integration/gpg_git_test.go +++ b/tests/integration/gpg_git_test.go @@ -106,12 +106,10 @@ func TestGPGGit(t *testing.T) { assert.NotNil(t, response.Verification) if response.Verification == nil { assert.FailNow(t, "no verification provided with response! %v", response) - return } assert.True(t, response.Verification.Verified) if !response.Verification.Verified { t.FailNow() - return } assert.Equal(t, "gitea@fake.local", response.Verification.Signer.Email) })) @@ -120,12 +118,10 @@ func TestGPGGit(t *testing.T) { assert.NotNil(t, response.Verification) if response.Verification == nil { assert.FailNow(t, "no verification provided with response! %v", response) - return } assert.True(t, response.Verification.Verified) if !response.Verification.Verified { t.FailNow() - return } assert.Equal(t, "gitea@fake.local", response.Verification.Signer.Email) })) @@ -140,12 +136,10 @@ func TestGPGGit(t *testing.T) { assert.NotNil(t, response.Verification) if response.Verification == nil { assert.FailNow(t, "no verification provided with response! %v", response) - return } assert.True(t, response.Verification.Verified) if !response.Verification.Verified { t.FailNow() - return } assert.Equal(t, "gitea@fake.local", response.Verification.Signer.Email) })) @@ -160,17 +154,14 @@ func TestGPGGit(t *testing.T) { assert.NotNil(t, branch.Commit) if branch.Commit == nil { assert.FailNow(t, "no commit provided with branch! %v", branch) - return } assert.NotNil(t, branch.Commit.Verification) if branch.Commit.Verification == nil { assert.FailNow(t, "no verification provided with branch commit! %v", branch.Commit) - return } assert.True(t, branch.Commit.Verification.Verified) if !branch.Commit.Verification.Verified { t.FailNow() - return } assert.Equal(t, "gitea@fake.local", branch.Commit.Verification.Signer.Email) })) From 73b63d93117db36feda11e53099baa8995a38df0 Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 11 Oct 2023 14:34:21 +0200 Subject: [PATCH 40/45] Replace ajax with fetch, improve image diff (#27267) 1. Dropzone attachment removal, pretty simple replacement 2. Image diff: The previous code fetched every image twice, once via `img[src]` and once via `$.ajax`. Now it's only fetched once and a second time only when necessary. The image diff code was partially rewritten. --------- Co-authored-by: Giteabot --- routers/web/repo/compare.go | 27 +++++--- templates/repo/diff/box.tmpl | 8 ++- templates/repo/diff/image_diff.tmpl | 7 ++- web_src/js/features/common-global.js | 7 +-- web_src/js/features/imagediff.js | 93 ++++++++++++---------------- web_src/js/modules/fetch.js | 4 +- web_src/js/svg.js | 10 ++- web_src/js/utils.js | 11 ++++ web_src/js/utils/dom.js | 11 ++++ 9 files changed, 96 insertions(+), 82 deletions(-) diff --git a/routers/web/repo/compare.go b/routers/web/repo/compare.go index d66dd582a1..b69af3c61c 100644 --- a/routers/web/repo/compare.go +++ b/routers/web/repo/compare.go @@ -32,6 +32,7 @@ import ( "code.gitea.io/gitea/modules/markup" "code.gitea.io/gitea/modules/setting" api "code.gitea.io/gitea/modules/structs" + "code.gitea.io/gitea/modules/typesniffer" "code.gitea.io/gitea/modules/upload" "code.gitea.io/gitea/modules/util" "code.gitea.io/gitea/services/gitdiff" @@ -60,6 +61,21 @@ func setCompareContext(ctx *context.Context, before, head *git.Commit, headOwner return blob } + ctx.Data["GetSniffedTypeForBlob"] = func(blob *git.Blob) typesniffer.SniffedType { + st := typesniffer.SniffedType{} + + if blob == nil { + return st + } + + st, err := blob.GuessContentType() + if err != nil { + log.Error("GuessContentType failed: %v", err) + return st + } + return st + } + setPathsCompareContext(ctx, before, head, headOwner, headName) setImageCompareContext(ctx) setCsvCompareContext(ctx) @@ -87,16 +103,7 @@ func setPathsCompareContext(ctx *context.Context, base, head *git.Commit, headOw // setImageCompareContext sets context data that is required by image compare template func setImageCompareContext(ctx *context.Context) { - ctx.Data["IsBlobAnImage"] = func(blob *git.Blob) bool { - if blob == nil { - return false - } - - st, err := blob.GuessContentType() - if err != nil { - log.Error("GuessContentType failed: %v", err) - return false - } + ctx.Data["IsSniffedTypeAnImage"] = func(st typesniffer.SniffedType) bool { return st.IsImage() && (setting.UI.SVG.Enabled || !st.IsSvgImage()) } } diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index 94a5a9a295..289ed90d3f 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -97,7 +97,9 @@ {{/*notice: the index of Diff.Files should not be used for element ID, because the index will be restarted from 0 when doing load-more for PRs with a lot of files*/}} {{$blobBase := call $.GetBlobByPathForCommit $.BeforeCommit $file.OldName}} {{$blobHead := call $.GetBlobByPathForCommit $.HeadCommit $file.Name}} - {{$isImage := or (call $.IsBlobAnImage $blobBase) (call $.IsBlobAnImage $blobHead)}} + {{$sniffedTypeBase := call $.GetSniffedTypeForBlob $blobBase}} + {{$sniffedTypeHead := call $.GetSniffedTypeForBlob $blobHead}} + {{$isImage:= or (call $.IsSniffedTypeAnImage $sniffedTypeBase) (call $.IsSniffedTypeAnImage $sniffedTypeHead)}} {{$isCsv := (call $.IsCsvFile $file)}} {{$showFileViewToggle := or $isImage (and (not $file.IsIncomplete) $isCsv)}} {{$isExpandable := or (gt $file.Addition 0) (gt $file.Deletion 0) $file.IsBin}} @@ -198,9 +200,9 @@
{{if $isImage}} - {{template "repo/diff/image_diff" dict "file" . "root" $ "blobBase" $blobBase "blobHead" $blobHead}} + {{template "repo/diff/image_diff" dict "file" . "root" $ "blobBase" $blobBase "blobHead" $blobHead "sniffedTypeBase" $sniffedTypeBase "sniffedTypeHead" $sniffedTypeHead}} {{else}} - {{template "repo/diff/csv_diff" dict "file" . "root" $ "blobBase" $blobBase "blobHead" $blobHead}} + {{template "repo/diff/csv_diff" dict "file" . "root" $ "blobBase" $blobBase "blobHead" $blobHead "sniffedTypeBase" $sniffedTypeBase "sniffedTypeHead" $sniffedTypeHead}} {{end}}
diff --git a/templates/repo/diff/image_diff.tmpl b/templates/repo/diff/image_diff.tmpl index 8abce9479e..02cca784f6 100644 --- a/templates/repo/diff/image_diff.tmpl +++ b/templates/repo/diff/image_diff.tmpl @@ -1,7 +1,12 @@ {{if or .blobBase .blobHead}} -
+
From bf24852b204a0933855f8f7c3babd12080e6467f Mon Sep 17 00:00:00 2001 From: JakobDev Date: Thu, 12 Oct 2023 00:10:51 +0200 Subject: [PATCH 44/45] Keep filter when showing unfiltered results on explore page (#27192) Fixes https://codeberg.org/Codeberg/Community/issues/1302 --------- Co-authored-by: wxiaoguang --- templates/explore/repo_search.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/explore/repo_search.tmpl b/templates/explore/repo_search.tmpl index 1d7030c566..31b00d29e3 100644 --- a/templates/explore/repo_search.tmpl +++ b/templates/explore/repo_search.tmpl @@ -36,7 +36,7 @@

{{if and .PageIsExploreRepositories .OnlyShowRelevant}}
- {{ctx.Locale.Tr "explore.relevant_repositories" ((print $.Link "?only_show_relevant=0")|Escape) | Safe}} + {{ctx.Locale.Tr "explore.relevant_repositories" ((printf "?only_show_relevant=0&sort=%s&q=%s&language=%s" $.SortType (QueryEscape $.Keyword) (QueryEscape $.Language))|Escape) | Safe}}
{{end}}
From d020343269eaa136abd0c4893f1373560c6cf433 Mon Sep 17 00:00:00 2001 From: GiteaBot Date: Thu, 12 Oct 2023 00:21:30 +0000 Subject: [PATCH 45/45] [skip ci] Updated translations via Crowdin --- options/locale/locale_de-DE.ini | 38 +++++++++++++++++++++++++++++++++ options/locale/locale_ja-JP.ini | 14 ++++++++++++ 2 files changed, 52 insertions(+) diff --git a/options/locale/locale_de-DE.ini b/options/locale/locale_de-DE.ini index 4f6a5cb961..99de5b6770 100644 --- a/options/locale/locale_de-DE.ini +++ b/options/locale/locale_de-DE.ini @@ -1777,6 +1777,7 @@ pulls.rebase_conflict_summary=Fehlermeldung pulls.unrelated_histories=Merge fehlgeschlagen: Der Head des Merges und die Basis haben keinen gemeinsamen Verlauf. Hinweis: Versuche eine andere Strategie pulls.merge_out_of_date=Merge fehlgeschlagen: Während des Mergens wurde die Basis aktualisiert. Hinweis: Versuche es erneut. pulls.head_out_of_date=Mergen fehlgeschlagen: Der Head wurde aktualisiert während der Merge erstellt wurde. Tipp: Versuche es erneut. +pulls.has_merged=Fehler: Der Pull-Request wurde gemerged, du kannst den Zielbranch nicht wieder mergen oder ändern. pulls.push_rejected=Mergen fehlgeschlagen: Der Push wurde abgelehnt. Überprüfe die Git Hooks für dieses Repository. pulls.push_rejected_summary=Vollständige Ablehnungsmeldung pulls.push_rejected_no_message=Mergen fehlgeschlagen: Der Push wurde abgelehnt, aber es gab keine Fehlermeldung.
Überprüfe die Git Hooks für dieses Repository @@ -1817,6 +1818,7 @@ pulls.auto_merge_canceled_schedule_comment=`hat den Automerge für diesen Pull-R pulls.delete.title=Diesen Pull-Request löschen? pulls.delete.text=Willst du diesen Pull-Request wirklich löschen? (Dies wird den Inhalt unwiderruflich löschen. Überlege, ob du ihn nicht lieber schließen willst, um ihn zu archivieren) +pulls.recently_pushed_new_branches=Du hast auf den Branch %[1]s %[2]s gepusht pull.deleted_branch=(gelöscht):%s @@ -1826,6 +1828,7 @@ milestones.update_ago=%s aktualisiert milestones.no_due_date=Kein Fälligkeitsdatum milestones.open=Öffnen milestones.close=Schließen +milestones.new_subheader=Benutze Meilensteine, um Issues zu organisieren und den Fortschritt darzustellen. milestones.completeness=%d%% abgeschlossen milestones.create=Meilenstein erstellen milestones.title=Titel @@ -1856,6 +1859,11 @@ signing.wont_sign.never=Commits werden nie signiert. signing.wont_sign.always=Commits werden immer signiert. signing.wont_sign.pubkey=Der Commit wird nicht signiert, da du keinen öffentlichen Schlüssel mit deinem Account verknüpft hast. signing.wont_sign.twofa=Du musst Zwei-Faktor-Authentifizierung aktivieren, damit Commits signiert werden. +signing.wont_sign.parentsigned=Der Commit wird nicht signiert werden, da der vorherige Commit nicht signiert ist. +signing.wont_sign.basesigned=Der Merge Commit wird nicht signiert werden, da der Basis-Commit nicht signiert ist. +signing.wont_sign.headsigned=Der Merge Commit wird nicht signiert werden, da der Head-Commit nicht signiert ist. +signing.wont_sign.commitssigned=Der Merge Commit wird nicht signiert werden, da alle zugehörigen Commits nicht signiert sind. +signing.wont_sign.approved=Der Merge Commit wird nicht signiert werden, da der Pull Request nicht genehmigt wurde. signing.wont_sign.not_signed_in=Du bist nicht eingeloggt. ext_wiki=Zugriff auf externes Wiki @@ -1988,6 +1996,7 @@ settings.mirror_settings.docs.can_still_use=Obwohl du existierende Mirrors gerad settings.mirror_settings.docs.pull_mirror_instructions=Um einen Pull-Mirror einzurichten, konsultiere bitte: settings.mirror_settings.docs.more_information_if_disabled=Hier kannst du mehr über Push- und Pull-Mirrors erfahren: settings.mirror_settings.docs.doc_link_title=Wie spiegele ich Repositories? +settings.mirror_settings.docs.doc_link_pull_section=den Abschnitt "Von einem entfernten Repository pullen" in der Dokumentation. settings.mirror_settings.docs.pulling_remote_title=Aus einem Remote-Repository pullen settings.mirror_settings.mirrored_repository=Gespiegeltes Repository settings.mirror_settings.direction=Richtung @@ -1997,6 +2006,7 @@ settings.mirror_settings.last_update=Letzte Aktualisierung settings.mirror_settings.push_mirror.none=Keine Push-Mirrors konfiguriert settings.mirror_settings.push_mirror.remote_url=URL zum Git-Remote-Repository settings.mirror_settings.push_mirror.add=Push-Mirror hinzufügen +settings.mirror_settings.push_mirror.edit_sync_time=Mirror-Sync-Intervall anpassen settings.sync_mirror=Jetzt synchronisieren settings.pull_mirror_sync_in_progress=Aktuell werden Änderungen von %s gepullt. @@ -2338,6 +2348,7 @@ settings.tags.protection.allowed.teams=Erlaubte Teams settings.tags.protection.allowed.noone=Niemand settings.tags.protection.create=Tag schützen settings.tags.protection.none=Es gibt keine geschützten Tags. +settings.tags.protection.pattern.description=Du kannst einen einzigen Namen oder ein globales Schema oder einen regulären Ausdruck verwenden, um mehrere Tags zu schützen. Mehr dazu im Guide für geschützte Tags (Englisch). settings.bot_token=Bot-Token settings.chat_id=Chat-ID settings.thread_id=Thread-ID @@ -2346,6 +2357,7 @@ settings.matrix.room_id=Raum-ID settings.matrix.message_type=Nachrichtentyp settings.archive.button=Repo archivieren settings.archive.header=Dieses Repo archivieren +settings.archive.text=Durch das Archivieren wird ein Repo vollständig schreibgeschützt. Es wird vom Dashboard versteckt. Niemand (nicht einmal du!) wird in der Lage sein, neue Commits zu erstellen oder Issues oder Pull-Requests zu öffnen. settings.archive.success=Das Repo wurde erfolgreich archiviert. settings.archive.error=Beim Versuch, das Repository zu archivieren, ist ein Fehler aufgetreten. Weitere Details finden sich im Log. settings.archive.error_ismirror=Du kannst keinen Repo-Mirror archivieren. @@ -2353,6 +2365,9 @@ settings.archive.branchsettings_unavailable=Branch-Einstellungen sind nicht verf settings.archive.tagsettings_unavailable=Tag Einstellungen sind nicht verfügbar, wenn das Repo archiviert wurde. settings.unarchive.button=Archivieren rückgängig machen settings.unarchive.header=Archivieren dieses Repositories rückgängig machen +settings.unarchive.text=Durch das Aufheben der Archivierung kann das Repo wieder Commits und Pushes sowie neue Issues und Pull-Requests empfangen. +settings.unarchive.success=Die Archivierung des Repos wurde erfolgreich wieder rückgängig gemacht. +settings.unarchive.error=Beim Versuch, die Archivierung des Repos aufzuheben, ist ein Fehler aufgetreten. Weitere Details finden sich im Log. settings.update_avatar_success=Der Repository-Avatar wurde aktualisiert. settings.lfs=LFS settings.lfs_filelist=LFS-Dateien, die in diesem Repository gespeichert sind @@ -2419,6 +2434,7 @@ diff.show_more=Mehr anzeigen diff.load=Diff laden diff.generated=generiert diff.vendored=vendored +diff.comment.add_line_comment=Einzelnen Kommentar hinzufügen diff.comment.placeholder=Kommentieren... diff.comment.markdown_info=Styling mit Markdown wird unterstützt. diff.comment.add_single_comment=Einzelnen Kommentar hinzufügen @@ -2475,6 +2491,7 @@ release.edit_release=Release aktualisieren release.delete_release=Release löschen release.delete_tag=Tag löschen release.deletion=Release löschen +release.deletion_desc=Beim Entfernen wird ein Release nur von Gitea gelöscht. Es betrifft weder den Git-Tag, noch den Inhalt des Repos oder seinen Änderungsverlauf. Fortfahren? release.deletion_success=Das Release wurde gelöscht. release.deletion_tag_desc=Löscht dieses Tag aus dem Projektarchiv. Repository-Inhalt und Verlauf bleiben unverändert. Fortfahren? release.deletion_tag_success=Der Tag wurde gelöscht. @@ -2495,6 +2512,7 @@ branch.already_exists=Ein Branch mit dem Namen "%s" existiert bereits. branch.delete_head=Löschen branch.delete=Branch "%s" löschen branch.delete_html=Branch löschen +branch.delete_desc=Das Löschen eines Branches ist permanent. Obwohl der Branch für eine kurze Zeit weiter existieren könnte, kann diese Aktion in den meisten Fällen NICHT rückgängig gemacht werden. Fortfahren? branch.deletion_success=Branch "%s" wurde gelöscht. branch.deletion_failed=Branch "%s" konnte nicht gelöscht werden. branch.delete_branch_has_new_commits=Der Branch "%s" kann nicht gelöscht werden, da seit dem letzten Merge neue Commits hinzugefügt wurden. @@ -2534,6 +2552,7 @@ tag.create_success=Tag "%s" wurde erstellt. topic.manage_topics=Themen verwalten topic.done=Fertig topic.count_prompt=Du kannst nicht mehr als 25 Themen auswählen +topic.format_prompt=Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) und Punkte ('.') enthalten und bis zu 35 Zeichen lang sein. Nur Kleinbuchstaben sind zulässig. find_file.go_to_file=Datei suchen find_file.no_matching=Keine passende Datei gefunden @@ -2586,6 +2605,7 @@ settings.visibility.private_shortname=Privat settings.update_settings=Einstellungen speichern settings.update_setting_success=Organisationseinstellungen wurden aktualisiert. +settings.change_orgname_prompt=Hinweis: Das Ändern des Organisationsnamens wird auch die URL deiner Organisation ändern und den alten Namen freigeben. settings.change_orgname_redirect_prompt=Der alte Name wird weiterleiten, bis er wieder beansprucht wird. settings.update_avatar_success=Der Organisationsavatar wurde aktualisiert. settings.delete=Organisation löschen @@ -2661,13 +2681,16 @@ teams.all_repositories_helper=Team hat Zugriff auf alle Repositories. Wenn dies teams.all_repositories_read_permission_desc=Dieses Team gewährt Lese-Zugriff auf Repositories: Mitglieder können Repositories ansehen und klonen. teams.all_repositories_write_permission_desc=Dieses Team gewährt Schreib-Zugriff auf alle Repositories: Mitglieder können Repositories lesen und auf sie pushen. teams.all_repositories_admin_permission_desc=Dieses Team gewährt Administrator-Zugriff auf alle Repositories: Mitglieder können Repositories lesen, auf sie pushen und Mitwirkende zu Repositorys hinzufügen. +teams.invite.title=Du wurdest eingeladen, dem Team %s in der Organisation %s beizutreten. teams.invite.by=Von %s eingeladen teams.invite.description=Bitte klicke auf die folgende Schaltfläche, um dem Team beizutreten. [admin] dashboard=Dashboard +identity_access=Identität & Zugriff users=Benutzerkonten organizations=Organisationen +assets=Code-Assets repositories=Repositories hooks=Webhooks integrations=Integrationen @@ -2708,6 +2731,7 @@ dashboard.delete_repo_archives.started=Löschen aller Repository-Archive gestart dashboard.delete_missing_repos=Alle Repository-Datensätze mit verloren gegangenen Git-Dateien löschen dashboard.delete_missing_repos.started=Alle Repositories löschen, die den Git-File-Task nicht gestartet haben. dashboard.delete_generated_repository_avatars=Generierte Repository-Avatare löschen +dashboard.sync_repo_branches=Fehlende Branches aus den Git-Daten in die Datenbank synchronisieren dashboard.update_mirrors=Mirrors aktualisieren dashboard.repo_health_check=Healthchecks für alle Repositories ausführen dashboard.check_repo_stats=Überprüfe alle Repository-Statistiken @@ -2724,6 +2748,7 @@ dashboard.reinit_missing_repos=Alle Git-Repositories neu einlesen, für die Eint dashboard.sync_external_users=Externe Benutzerdaten synchronisieren dashboard.cleanup_hook_task_table=Hook-Task-Tabelle bereinigen dashboard.cleanup_packages=Veraltete Pakete löschen +dashboard.cleanup_actions=Abgelaufene Logs und Artefakte von Actions bereinigen dashboard.server_uptime=Server-Uptime dashboard.current_goroutine=Aktuelle Goroutinen dashboard.current_memory_usage=Aktuelle Speichernutzung @@ -2761,6 +2786,9 @@ dashboard.gc_lfs=Garbage-Collection für LFS Meta-Objekte ausführen dashboard.stop_zombie_tasks=Zombie-Aufgaben stoppen dashboard.stop_endless_tasks=Endlose Aufgaben stoppen dashboard.cancel_abandoned_jobs=Aufgegebene Jobs abbrechen +dashboard.start_schedule_tasks=Terminierte Aufgaben starten +dashboard.sync_branch.started=Synchronisierung der Branches gestartet +dashboard.rebuild_issue_indexer=Issue-Indexer neu bauen users.user_manage_panel=Benutzerkontenverwaltung users.new_account=Benutzerkonto erstellen @@ -2866,10 +2894,12 @@ packages.size=Größe packages.published=Veröffentlicht defaulthooks=Standard-Webhooks +defaulthooks.desc=Webhooks senden automatisch eine HTTP-POST-Anfrage an einen Server, wenn bestimmte Gitea-Events ausgelöst werden. Hier definierte Webhooks sind die Standardwerte, die in alle neuen Repositories kopiert werden. Mehr Infos findest du in der Webhooks-Anleitung (auf Englisch). defaulthooks.add_webhook=Standard-Webhook hinzufügen defaulthooks.update_webhook=Standard-Webhook aktualisieren systemhooks=System-Webhooks +systemhooks.desc=Webhooks senden automatisch HTTP-POST-Anfragen an einen Server, wenn bestimmte Gitea-Events ausgelöst werden. Hier definierte Webhooks werden auf alle Repositories des Systems übertragen, beachte daher mögliche Performance-Einbrüche. Mehr Infos findest du in der Webhooks-Anleitung (auf Englisch). systemhooks.add_webhook=System-Webhook hinzufügen systemhooks.update_webhook=System-Webhook aktualisieren @@ -2962,6 +2992,7 @@ auths.sspi_default_language=Standardsprache für Benutzer auths.sspi_default_language_helper=Standardsprache für Benutzer, die automatisch mit der SSPI Authentifizierungsmethode erstellt wurden. Leer lassen, wenn du es bevorzugst, dass eine Sprache automatisch erkannt wird. auths.tips=Tipps auths.tips.oauth2.general=OAuth2-Authentifizierung +auths.tips.oauth2.general.tip=Beim Registrieren einer OAuth2-Anwendung sollte die Callback-URL folgendermaßen lauten: auths.tip.oauth2_provider=OAuth2-Anbieter auths.tip.bitbucket=Registriere einen neuen OAuth-Consumer unter https://bitbucket.org/account/user//oauth-consumers/new und füge die Berechtigung „Account“ – „Read“ hinzu. auths.tip.nextcloud=Registriere über das "Settings -> Security -> OAuth 2.0 client"-Menü einen neuen "OAuth consumer" auf der Nextcloud-Instanz @@ -2973,6 +3004,7 @@ auths.tip.google_plus=Du erhältst die OAuth2-Client-Zugangsdaten in der Google- auths.tip.openid_connect=Benutze die OpenID-Connect-Discovery-URL (/.well-known/openid-configuration), um die Endpunkte zu spezifizieren auths.tip.twitter=Gehe auf https://dev.twitter.com/apps, erstelle eine Anwendung und stelle sicher, dass die Option „Allow this application to be used to Sign in with Twitter“ aktiviert ist auths.tip.discord=Erstelle unter https://discordapp.com/developers/applications/me eine neue Anwendung. +auths.tip.gitea=Registriere eine neue OAuth2-Anwendung. Eine Anleitung findest du unter https://docs.gitea.com/development/oauth2-provider/ auths.tip.yandex=`Erstelle eine neue Anwendung auf https://oauth.yandex.com/client/new. Wähle folgende Berechtigungen aus dem "Yandex.Passport API" Bereich: "Zugriff auf E-Mail-Adresse", "Zugriff auf Benutzeravatar" und "Zugriff auf Benutzername, Vor- und Nachname, Geschlecht"` auths.tip.mastodon=Gebe eine benutzerdefinierte URL für die Mastodon-Instanz ein, mit der du dich authentifizieren möchtest (oder benutze die standardmäßige) auths.edit=Authentifikationsquelle bearbeiten @@ -3154,8 +3186,10 @@ monitor.queue.name=Name monitor.queue.type=Typ monitor.queue.exemplar=Beispieltyp monitor.queue.numberworkers=Anzahl der Worker +monitor.queue.activeworkers=Aktive Worker monitor.queue.maxnumberworkers=Maximale Anzahl der Worker monitor.queue.numberinqueue=Nummer in der Warteschlange +monitor.queue.review_add=Worker hinzufügen / prüfen monitor.queue.settings.title=Pool-Einstellungen monitor.queue.settings.desc=Pools wachsen dynamisch basierend auf der Blockierung der Arbeitswarteschlange. monitor.queue.settings.maxnumberworkers=Maximale Anzahl an Workern @@ -3392,14 +3426,17 @@ settings.delete.success=Das Paket wurde gelöscht. settings.delete.error=Löschen des Pakets fehlgeschlagen. owner.settings.cargo.title=Cargo-Registry-Index owner.settings.cargo.initialize=Index initialisieren +owner.settings.cargo.initialize.description=Ein spezielles Index-Repository wird benötigt, um die Cargo-Registry zu nutzen. Diese Option wird dieses Repository (neu) erstellen und automatisch konfigurieren. owner.settings.cargo.initialize.error=Cargo-Index konnte nicht initialisiert werden: %v owner.settings.cargo.initialize.success=Der Cargo-Index wurde erfolgreich erstellt. owner.settings.cargo.rebuild=Index neu erstellen +owner.settings.cargo.rebuild.description=Neubauen kann hilfreich sein, wenn der Index nicht mit den gespeicherten Cargo-Paketen synchronisiert ist. owner.settings.cargo.rebuild.error=Cargo-Index konnte nicht neu erstellt werden: %v owner.settings.cargo.rebuild.success=Der Cargo-Index wurde erfolgreich neu erstellt. owner.settings.cleanuprules.title=Bereinigungsregeln verwalten owner.settings.cleanuprules.add=Bereinigungsregel hinzufügen owner.settings.cleanuprules.edit=Bereinigungsregel bearbeiten +owner.settings.cleanuprules.none=Keine Bereinigungs-Regeln verfügbar. Bitte konsultiere die Dokumentation. owner.settings.cleanuprules.preview=Vorschau der Bereinigungsregel owner.settings.cleanuprules.preview.overview=%d Pakete sollen entfernt werden. owner.settings.cleanuprules.preview.none=Bereinigungsregel stimmt mit keinem Paket überein. @@ -3418,6 +3455,7 @@ owner.settings.cleanuprules.success.update=Bereinigungsregel wurde aktualisiert. owner.settings.cleanuprules.success.delete=Bereinigungsregel wurde gelöscht. owner.settings.chef.title=Chef-Registry owner.settings.chef.keypair=Schlüsselpaar generieren +owner.settings.chef.keypair.description=Ein Schlüsselpaar ist notwendig, um mit der Chef-Registry zu authentifizieren. Wenn du bereits eins erstellt hast, wird dieses durch eine Neuerstellung verworfen. [secrets] secrets=Secrets diff --git a/options/locale/locale_ja-JP.ini b/options/locale/locale_ja-JP.ini index 1ea9c4ebb2..b224e4470d 100644 --- a/options/locale/locale_ja-JP.ini +++ b/options/locale/locale_ja-JP.ini @@ -97,6 +97,7 @@ locked=ロック済み copy=コピー copy_url=URLをコピー +copy_hash=ハッシュをコピー copy_content=内容をコピー copy_branch=ブランチ名をコピー copy_success=コピーされました! @@ -112,6 +113,7 @@ step2=ステップ 2: error=エラー error404=アクセスしようとしたページは存在しないか、閲覧が許可されていません。 +go_back=戻る never=無し unknown=不明 @@ -943,6 +945,8 @@ fork_from=フォーク元 already_forked=%s はフォーク済み fork_to_different_account=別のアカウントにフォークする fork_visibility_helper=フォークしたリポジトリの公開/非公開は変更できません。 +fork_branch=フォークにクローンされるブランチ +all_branches=すべてのブランチ fork_no_valid_owners=このリポジトリには有効なオーナーがいないため、フォークできません。 use_template=このテンプレートを使用 clone_in_vsc=VSCodeでクローン @@ -1008,8 +1012,13 @@ delete_preexisting=既存のファイルを削除 delete_preexisting_content=%s のファイルを削除します delete_preexisting_success=%s の未登録ファイルを削除しました blame_prior=この変更より前のBlameを表示 +blame.ignore_revs=.git-blame-ignore-revs で指定されたリビジョンは除外しています。 これを迂回して通常のBlame表示を見るには ここをクリック。 +blame.ignore_revs.failed=.git-blame-ignore-revs によるリビジョンの無視は失敗しました。 author_search_tooltip=最大30人までのユーザーを表示 +tree_path_not_found_commit=パス %[1]s はコミット %[2]s に存在しません +tree_path_not_found_branch=パス %[1]s はブランチ %[2]s に存在しません +tree_path_not_found_tag=パス %[1]s はタグ %[2]s に存在しません transfer.accept=移転を承認 transfer.accept_desc=`"%s" に移転` @@ -1275,6 +1284,7 @@ commits.signed_by_untrusted_user=信頼できないユーザーによる署名 commits.signed_by_untrusted_user_unmatched=コミッターと一致しない信頼できないユーザーによる署名 commits.gpg_key_id=GPGキーID commits.ssh_key_fingerprint=SSH鍵のフィンガープリント +commits.view_path=この時点を表示 commit.operations=操作 commit.revert=リバート @@ -1511,6 +1521,8 @@ issues.label_description=説明 issues.label_color=カラー issues.label_exclusive=排他 issues.label_archive=アーカイブ ラベル +issues.label_archived_filter=アーカイブされたラベルを表示 +issues.label_archive_tooltip=アーカイブされたラベルは、ラベルによる検索時のサジェストからデフォルトで除外されます。 issues.label_exclusive_desc=ラベル名を スコープ/アイテム の形にすることで、他の スコープ/ ラベルと排他的になります。 issues.label_exclusive_warning=イシューやプルリクエストのラベル編集では、競合するスコープ付きラベルは解除されます。 issues.label_count=ラベル %d件 @@ -1997,6 +2009,8 @@ settings.mirror_settings.push_mirror.add=プッシュミラーを追加 settings.mirror_settings.push_mirror.edit_sync_time=ミラー同期の間隔を編集 settings.sync_mirror=今すぐ同期 +settings.pull_mirror_sync_in_progress=現在、リモート %s から変更をプルしています。 +settings.push_mirror_sync_in_progress=現在、リモート %s へ変更をプッシュしています。 settings.site=Webサイト settings.update_settings=設定を更新 settings.update_mirror_settings=ミラーリング設定を更新