From 49c5fc565c326a7b8be190e5109fffefc2cf5ec1 Mon Sep 17 00:00:00 2001 From: Gusted Date: Sun, 20 Mar 2022 21:04:51 +0000 Subject: [PATCH 1/5] Fix NPE `/repos/issues/search` when not signed in (#19154) - Don't panic when on `/repos/issues/search?{created,assigned,mentioned,review_requested}=true` when client didn't pass any authentication. - Resolves #19115 --- routers/api/v1/repo/issue.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/routers/api/v1/repo/issue.go b/routers/api/v1/repo/issue.go index 9e550c4c4759..c96eb348557f 100644 --- a/routers/api/v1/repo/issue.go +++ b/routers/api/v1/repo/issue.go @@ -245,18 +245,23 @@ func SearchIssues(ctx *context.APIContext) { UpdatedAfterUnix: since, } + ctxUserID := int64(0) + if ctx.IsSigned { + ctxUserID = ctx.User.ID + } + // Filter for: Created by User, Assigned to User, Mentioning User, Review of User Requested if ctx.FormBool("created") { - issuesOpt.PosterID = ctx.User.ID + issuesOpt.PosterID = ctxUserID } if ctx.FormBool("assigned") { - issuesOpt.AssigneeID = ctx.User.ID + issuesOpt.AssigneeID = ctxUserID } if ctx.FormBool("mentioned") { - issuesOpt.MentionedID = ctx.User.ID + issuesOpt.MentionedID = ctxUserID } if ctx.FormBool("review_requested") { - issuesOpt.ReviewRequestedID = ctx.User.ID + issuesOpt.ReviewRequestedID = ctxUserID } if issues, err = models.Issues(issuesOpt); err != nil { From 572c63d237e17d73098d9cafcfa913fcae1cfda4 Mon Sep 17 00:00:00 2001 From: GiteaBot Date: Mon, 21 Mar 2022 00:24:03 +0000 Subject: [PATCH 2/5] [skip ci] Updated translations via Crowdin --- options/locale/locale_es-ES.ini | 3 +++ options/locale/locale_ja-JP.ini | 4 ++++ options/locale/locale_pt-PT.ini | 1 + options/locale/locale_zh-TW.ini | 6 ++++++ 4 files changed, 14 insertions(+) diff --git a/options/locale/locale_es-ES.ini b/options/locale/locale_es-ES.ini index 2d80d8cb810b..7d268275e568 100644 --- a/options/locale/locale_es-ES.ini +++ b/options/locale/locale_es-ES.ini @@ -282,6 +282,7 @@ register_helper_msg=¿Ya tienes una cuenta? ¡Inicia sesión! social_register_helper_msg=¿Ya tienes una cuenta? ¡Enlázala! disable_register_prompt=Registro deshabilitado. Por favor, póngase en contacto con el administrador del sitio. disable_register_mail=Correo electrónico de confirmación de registro deshabilitado. +manual_activation_only=Póngase en contacto con el administrador del sitio para completar la activación. remember_me=Recordar este Dispositivo forgot_password_title=He olvidado mi contraseña forgot_password=¿Has olvidado tu contraseña? @@ -558,6 +559,8 @@ comment_type_group_assignee=Asignado comment_type_group_title=Título comment_type_group_branch=Rama comment_type_group_time_tracking=Seguimiento de Tiempo +comment_type_group_deadline=Fecha límite +comment_type_group_dependency=Dependencia privacy=Privacidad keep_activity_private=Ocultar la actividad de la página del perfil keep_activity_private_popup=Hace la actividad visible sólo para ti y los administradores diff --git a/options/locale/locale_ja-JP.ini b/options/locale/locale_ja-JP.ini index 91d1de1ca34d..a15e4aef3650 100644 --- a/options/locale/locale_ja-JP.ini +++ b/options/locale/locale_ja-JP.ini @@ -282,6 +282,7 @@ register_helper_msg=既にアカウントをお持ちですか? 今すぐサ social_register_helper_msg=既にアカウントをお持ちですか? 今すぐ連携しましょう! disable_register_prompt=登録は無効になっています。 サイト管理者にお問い合わせください。 disable_register_mail=登録でのメール確認は無効になっています。 +manual_activation_only=アクティベーションを完了するにはサイト管理者に連絡してください。 remember_me=このデバイスで自動サインイン forgot_password_title=パスワードを忘れた forgot_password=パスワードをお忘れですか? @@ -1374,6 +1375,9 @@ issues.lock.reason=ロックする理由 issues.lock.title=このイシューの会話をロックします。 issues.unlock.title=このイシューの会話をアンロックします。 issues.comment_on_locked=ロックされているイシューにコメントはできません。 +issues.delete=削除 +issues.delete.title=このイシューを削除しますか? +issues.delete.text=本当にこのイシューを削除しますか? (これはすべてのコンテンツを完全に削除します。 保存しておきたい場合は、代わりにクローズすることを検討してください) issues.tracker=タイムトラッカー issues.start_tracking_short=タイマー 開始 issues.start_tracking=タイムトラッキングを開始 diff --git a/options/locale/locale_pt-PT.ini b/options/locale/locale_pt-PT.ini index 7db700195a0f..aa2c81406a86 100644 --- a/options/locale/locale_pt-PT.ini +++ b/options/locale/locale_pt-PT.ini @@ -282,6 +282,7 @@ register_helper_msg=Já tem uma conta? Inicie a sessão agora! social_register_helper_msg=Já tem uma conta? Associe-a agora! disable_register_prompt=As inscrições estão desabilitadas. Entre em contacto com o administrador do sítio. disable_register_mail=A confirmação por email da inscrição está desabilitada. +manual_activation_only=Contacte o administrador para completar a habilitação. remember_me=Memorizar este dispositivo forgot_password_title=Esqueci-me da senha forgot_password=Esqueceu a sua senha? diff --git a/options/locale/locale_zh-TW.ini b/options/locale/locale_zh-TW.ini index 926d6c0875d9..d10dd0f980ce 100644 --- a/options/locale/locale_zh-TW.ini +++ b/options/locale/locale_zh-TW.ini @@ -282,6 +282,7 @@ register_helper_msg=已經有帳戶了?立即登入! social_register_helper_msg=已經有帳戶了?立即連結! disable_register_prompt=註冊功能已停用。 請聯繫您的網站管理員。 disable_register_mail=已停用註冊確認電子郵件。 +manual_activation_only=請聯絡您的網站管理員以完成啟用程序。 remember_me=記得這個裝置 forgot_password_title=忘記密碼 forgot_password=忘記密碼? @@ -1181,6 +1182,7 @@ projects.board.deletion_desc=刪除專案看板會將所有相關的問題移動 projects.board.color=顏色 projects.open=開啟 projects.close=關閉 +projects.board.assigned_to=指派給 issues.desc=管理錯誤報告、任務和里程碑。 issues.filter_assignees=篩選負責人 @@ -1373,6 +1375,9 @@ issues.lock.reason=鎖定原因 issues.lock.title=鎖定此問題的對話。 issues.unlock.title=解鎖此問題的對話。 issues.comment_on_locked=您無法在已鎖定的問題上留言。 +issues.delete=刪除 +issues.delete.title=刪除此問題? +issues.delete.text=您真的要刪除此問題嗎?(這將會永久移除所有內容。若您還想保留,請考慮改為關閉它。) issues.tracker=時間追蹤 issues.start_tracking_short=開始計時 issues.start_tracking=開始時間追蹤 @@ -1786,6 +1791,7 @@ settings.pulls.allow_rebase_merge_commit=啟用 Rebase 顯式合併提交(--no-f settings.pulls.allow_squash_commits=啟用 Squash 合併提交 settings.pulls.allow_manual_merge=允許將合併請求標記為手動合併 settings.pulls.enable_autodetect_manual_merge=啟用自動偵測手動合併(注意:在某些特殊情況下可能發生誤判) +settings.pulls.allow_rebase_update=啟用透過 Rebase 更新合併請求分支 settings.pulls.default_delete_branch_after_merge=預設在合併後刪除合併請求分支 settings.projects_desc=啟用儲存庫專案 settings.admin_settings=管理員設定 From c604c9ae66696539174b04a33f9f3bb73b7a09c2 Mon Sep 17 00:00:00 2001 From: Sasha Melentyev Date: Mon, 21 Mar 2022 06:22:34 +0300 Subject: [PATCH 3/5] Add 1.18 (#19151) Co-authored-by: 6543 <6543@obermui.de> --- .golangci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index 143359bcf093..1794b4594dea 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -13,7 +13,7 @@ linters: #- gocyclo # The cyclomatic complexety of a lot of functions is too high, we should refactor those another time. - gofmt - misspell - #- gocritic # TODO: disabled until fixed with go 1.18 + - gocritic - bidichk - ineffassign - revive @@ -23,6 +23,7 @@ linters: fast: false run: + go: 1.18 timeout: 10m skip-dirs: - node_modules From b05b40180f41b440d18a6d6abafd2d6187979bfe Mon Sep 17 00:00:00 2001 From: zeripath Date: Mon, 21 Mar 2022 08:09:42 +0000 Subject: [PATCH 4/5] Use IterateBufferSize whilst querying repositories during adoption check (#19140) The adoption page checks directories to see if they are repositories by querying the db on a per user basis. This can lead to problems if a user has a large number of repositories or putative repositories. This PR changes the buffering to check the db in IterataeBufferSize batches instead. Fix #19137 Signed-off-by: Andrew Thornton --- services/repository/adopt.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/repository/adopt.go b/services/repository/adopt.go index 72fe284ad375..2af01e973aeb 100644 --- a/services/repository/adopt.go +++ b/services/repository/adopt.go @@ -339,6 +339,13 @@ func ListUnadoptedRepositories(query string, opts *db.ListOptions) ([]string, in } repoNamesToCheck = append(repoNamesToCheck, name) + if len(repoNamesToCheck) > setting.Database.IterateBufferSize { + if err = checkUnadoptedRepositories(userName, repoNamesToCheck, unadopted); err != nil { + return err + } + repoNamesToCheck = repoNamesToCheck[:0] + + } return filepath.SkipDir }); err != nil { return nil, 0, err From bfe2e3d562307eb8b6659d71d2c10bf3c1284e77 Mon Sep 17 00:00:00 2001 From: delvh Date: Mon, 21 Mar 2022 13:00:25 +0100 Subject: [PATCH 5/5] Reorder issue templates and automatically add labels (#18875) * Reorder bug-report.yaml * Add bug label on bug-report.yaml * Add feature label on feature-request.yaml * Reorder ui.bug-report.yaml * Apply suggestions Co-authored-by: Lunny Xiao Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: zeripath --- .github/ISSUE_TEMPLATE/bug-report.yaml | 71 +++++++++++---------- .github/ISSUE_TEMPLATE/feature-request.yaml | 1 + .github/ISSUE_TEMPLATE/ui.bug-report.yaml | 45 ++++++------- 3 files changed, 60 insertions(+), 57 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yaml b/.github/ISSUE_TEMPLATE/bug-report.yaml index 286bfec3e487..9dacad0d5fb8 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yaml +++ b/.github/ISSUE_TEMPLATE/bug-report.yaml @@ -1,5 +1,6 @@ name: Bug Report description: Found something you weren't expecting? Report it here! +labels: kind/bug body: - type: markdown attributes: @@ -19,6 +20,13 @@ body: 6. In particular it's really important to provide pertinent logs. You must give us DEBUG level logs. Please read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini +- type: textarea + id: description + attributes: + label: Description + description: | + Please provide a description of your issue here, with a URL if you were able to reproduce the issue (see below) + If you are using a proxy or a CDN (e.g. Cloudflare) in front of Gitea, please disable the proxy/CDN fully and access Gitea directly to confirm the issue still persists without those services. - type: input id: gitea-ver attributes: @@ -26,6 +34,34 @@ body: description: Gitea version (or commit reference) of your instance validations: required: true +- type: dropdown + id: can-reproduce + attributes: + label: Can you reproduce the bug on the Gitea demo site? + description: | + If so, please provide a URL in the Description field + URL of Gitea demo: https://try.gitea.io + options: + - "Yes" + - "No" + validations: + required: true +- type: markdown + attributes: + value: | + It's really important to provide pertinent logs + Please read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems + In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini +- type: input + id: logs + attributes: + label: Log Gist + description: Please provide a gist URL of your logs, with any sensitive information (e.g. API keys) removed/hidden +- type: textarea + id: screenshots + attributes: + label: Screenshots + description: If this issue involves the Web Interface, please provide one or more screenshots - type: input id: git-ver attributes: @@ -56,38 +92,3 @@ body: - MySQL - MSSQL - SQLite -- type: dropdown - id: can-reproduce - attributes: - label: Can you reproduce the bug on the Gitea demo site? - description: | - If so, please provide a URL in the Description field - URL of Gitea demo: https://try.gitea.io - options: - - "Yes" - - "No" - validations: - required: true -- type: markdown - attributes: - value: | - It's really important to provide pertinent logs - Please read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems - In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini -- type: input - id: logs - attributes: - label: Log Gist - description: Please provide a gist URL of your logs, with any sensitive information (e.g. API keys) removed/hidden -- type: textarea - id: description - attributes: - label: Description - description: | - Please provide a description of your issue here, with a URL if you were able to reproduce the issue (see above) - If you are using a proxy or a CDN (e.g. Cloudflare) in front of Gitea, please disable the proxy/CDN fully and access Gitea directly to confirm the issue still persists without those services. -- type: textarea - id: screenshots - attributes: - label: Screenshots - description: If this issue involves the Web Interface, please provide one or more screenshots diff --git a/.github/ISSUE_TEMPLATE/feature-request.yaml b/.github/ISSUE_TEMPLATE/feature-request.yaml index 69b338ddf8d0..37f57c8f23df 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yaml +++ b/.github/ISSUE_TEMPLATE/feature-request.yaml @@ -1,5 +1,6 @@ name: Feature Request description: Got an idea for a feature that Gitea doesn't have currently? Submit your idea here! +labels: ["kind/feature", "kind/proposal"] body: - type: markdown attributes: diff --git a/.github/ISSUE_TEMPLATE/ui.bug-report.yaml b/.github/ISSUE_TEMPLATE/ui.bug-report.yaml index 2c8edafaf893..80db52d7f119 100644 --- a/.github/ISSUE_TEMPLATE/ui.bug-report.yaml +++ b/.github/ISSUE_TEMPLATE/ui.bug-report.yaml @@ -1,5 +1,6 @@ name: Web Interface Bug Report description: Something doesn't look quite as it should? Report it here! +labels: ["kind/bug", "kind/ui"] body: - type: markdown attributes: @@ -18,23 +19,25 @@ body: 6. In particular it's really important to provide pertinent logs. If you are certain that this is a javascript error, show us the javascript console. If the error appears to relate to Gitea the server you must also give us DEBUG level logs. (See https://docs.gitea.io/en-us/logging-configuration/#debugging-problems) -- type: input - id: gitea-ver +- type: textarea + id: description attributes: - label: Gitea Version - description: Gitea version (or commit reference) your instance is running + label: Description + description: | + Please provide a description of your issue here, with a URL if you were able to reproduce the issue (see below) + If using a proxy or a CDN (e.g. CloudFlare) in front of gitea, please disable the proxy/CDN fully and connect to gitea directly to confirm the issue still persists without those services. +- type: textarea + id: screenshots + attributes: + label: Screenshots + description: Please provide at least 1 screenshot showing the issue. validations: required: true - type: input - id: os-ver - attributes: - label: Operating System - description: The operating system you are using to access Gitea -- type: input - id: browser-ver + id: gitea-ver attributes: - label: Browser Version - description: The browser and version that you are using to access Gitea + label: Gitea Version + description: Gitea version (or commit reference) your instance is running validations: required: true - type: dropdown @@ -49,17 +52,15 @@ body: - "No" validations: required: true -- type: textarea - id: description +- type: input + id: os-ver attributes: - label: Description - description: | - Please provide a description of your issue here, with a URL if you were able to reproduce the issue (see above) - If using a proxy or a CDN (e.g. CloudFlare) in front of gitea, please disable the proxy/CDN fully and connect to gitea directly to confirm the issue still persists without those services. -- type: textarea - id: screenshots + label: Operating System + description: The operating system you are using to access Gitea +- type: input + id: browser-ver attributes: - label: Screenshots - description: Please provide at least 1 screenshot showing the issue. + label: Browser Version + description: The browser and version that you are using to access Gitea validations: required: true