Skip to content

Commit

Permalink
Merge remote-tracking branch 'giteaofficial/main'
Browse files Browse the repository at this point in the history
* giteaofficial/main:
  [skip ci] Updated translations via Crowdin
  Mock queue backoff duration (go-gitea#30553)
  Improve "Reference in new issue" modal (go-gitea#30547)
  Add a few root files to lint-spell (go-gitea#30530)
  Refactor and fix archive link bug (go-gitea#30535)
  Fixup app.example.ini for task section, which is now queue.task (go-gitea#30555)
  Some following up changes for routes (go-gitea#30550)
  Add form field id generation, remove duplicated ids (go-gitea#30546)
  Fix border-radius on view, blame and code search (go-gitea#30545)
  Disable enter key for accepting code completion in Monaco (go-gitea#30548)
  • Loading branch information
zjjhot committed Apr 19, 2024
2 parents 119dd5e + ba9b124 commit f3b81c7
Show file tree
Hide file tree
Showing 26 changed files with 314 additions and 155 deletions.
72 changes: 36 additions & 36 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ TAR_EXCLUDES := .git data indexers queues log node_modules $(EXECUTABLE) $(FOMAN
GO_DIRS := build cmd models modules routers services tests
WEB_DIRS := web_src/js web_src/css

ESLINT_FILES := web_src/js tools *.config.js tests/e2e
ESLINT_FILES := web_src/js tools *.js tests/e2e
STYLELINT_FILES := web_src/css web_src/js/components/*.vue
SPELLCHECK_FILES := $(GO_DIRS) $(WEB_DIRS) docs/content templates options/locale/locale_en-US.ini .github
SPELLCHECK_FILES := $(GO_DIRS) $(WEB_DIRS) docs/content templates options/locale/locale_en-US.ini .github $(filter-out CHANGELOG.md, $(wildcard *.go *.js *.md *.yml *.yaml *.toml))
EDITORCONFIG_FILES := templates .github/workflows options/locale/locale_en-US.ini

GO_SOURCES := $(wildcard *.go)
Expand Down
16 changes: 0 additions & 16 deletions custom/conf/app.example.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2377,22 +2377,6 @@ LEVEL = Info
;; Enable issue by repository metrics; default is false
;ENABLED_ISSUE_BY_REPOSITORY = false

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;[task]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Task queue type, could be `channel` or `redis`.
;QUEUE_TYPE = channel
;;
;; Task queue length, available only when `QUEUE_TYPE` is `channel`.
;QUEUE_LENGTH = 1000
;;
;; Task queue connection string, available only when `QUEUE_TYPE` is `redis`.
;; If there is a password of redis, use `redis://127.0.0.1:6379/0?pool_size=100&idle_timeout=180s` or `redis+cluster://127.0.0.1:6379/0?pool_size=100&idle_timeout=180s` for `redis-clsuter`.
;QUEUE_CONN_STR = "redis://127.0.0.1:6379/0?pool_size=100&idle_timeout=180s"

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;[migrations]
Expand Down
8 changes: 0 additions & 8 deletions docs/content/administration/config-cheat-sheet.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -1198,14 +1198,6 @@ in this mapping or the filetype using heuristics.

- `DEFAULT_UI_LOCATION`: Default location of time on the UI, so that we can display correct user's time on UI. i.e. Asia/Shanghai

## Task (`task`)

Task queue configuration has been moved to `queue.task`. However, the below configuration values are kept for backwards compatibility:

- `QUEUE_TYPE`: **channel**: Task queue type, could be `channel` or `redis`.
- `QUEUE_LENGTH`: **1000**: Task queue length, available only when `QUEUE_TYPE` is `channel`.
- `QUEUE_CONN_STR`: **redis://127.0.0.1:6379/0**: Task queue connection string, available only when `QUEUE_TYPE` is `redis`. If redis needs a password, use `redis://[email protected]:6379/0` or `redis+cluster://[email protected]:6379/0`.

## Migrations (`migrations`)

- `MAX_ATTEMPTS`: **3**: Max attempts per http/https request on migrations.
Expand Down
9 changes: 0 additions & 9 deletions docs/content/administration/config-cheat-sheet.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -1128,15 +1128,6 @@ ALLOW_DATA_URI_IMAGES = true

- `DEFAULT_UI_LOCATION`:在 UI 上的默认时间位置,以便我们可以在 UI 上显示正确的用户时间。例如:Asia/Shanghai

## 任务 (`task`)

任务队列配置已移动到 `queue.task`。然而,以下配置值仍保留以确保向后兼容:

- `QUEUE_TYPE`**channel**:任务队列类型,可以是 `channel``redis`
- `QUEUE_LENGTH`**1000**:任务队列长度,仅在 `QUEUE_TYPE``channel` 时可用。
- `QUEUE_CONN_STR`**redis://127.0.0.1:6379/0**:任务队列连接字符串,仅在 `QUEUE_TYPE``redis` 时可用。
如果 redis 需要密码,使用 `redis://[email protected]:6379/0``redis+cluster://[email protected]:6379/0`

## 迁移 (`migrations`)

- `MAX_ATTEMPTS`**3**:每次 http/https 请求的最大尝试次数(用于迁移)。
Expand Down
10 changes: 9 additions & 1 deletion modules/queue/backoff.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"time"
)

const (
var (
backoffBegin = 50 * time.Millisecond
backoffUpper = 2 * time.Second
)
Expand All @@ -18,6 +18,14 @@ type (
backoffFuncErr func() (retry bool, err error)
)

func mockBackoffDuration(d time.Duration) func() {
oldBegin, oldUpper := backoffBegin, backoffUpper
backoffBegin, backoffUpper = d, d
return func() {
backoffBegin, backoffUpper = oldBegin, oldUpper
}
}

func backoffRetErr[T any](ctx context.Context, begin, upper time.Duration, end <-chan time.Time, fn backoffFuncRetErr[T]) (ret T, err error) {
d := begin
for {
Expand Down
1 change: 1 addition & 0 deletions modules/queue/workerqueue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ func TestWorkerPoolQueueShutdown(t *testing.T) {

func TestWorkerPoolQueueWorkerIdleReset(t *testing.T) {
defer test.MockVariableValue(&workerIdleDuration, 10*time.Millisecond)()
defer mockBackoffDuration(10 * time.Millisecond)()

handler := func(items ...int) (unhandled []int) {
time.Sleep(50 * time.Millisecond)
Expand Down
6 changes: 6 additions & 0 deletions options/locale/locale_fr-FR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ filter.private=Privé


[search]
exact=Exact
exact_tooltip=Inclure uniquement les résultats qui correspondent exactement au terme de recherche
issue_kind=Recherche de tickets…
pull_kind=Recherche de demandes d’ajouts…

[aria]
navbar=Barre de navigation
Expand Down Expand Up @@ -824,6 +828,7 @@ repo_and_org_access=Accès aux Organisations et Dépôts
permissions_public_only=Publique uniquement
permissions_access_all=Tout (public, privé et limité)
select_permissions=Sélectionner les autorisations
permission_not_set=Non défini
permission_no_access=Aucun accès
permission_read=Lecture
permission_write=Lecture et écriture
Expand Down Expand Up @@ -2016,6 +2021,7 @@ settings.branches.add_new_rule=Ajouter une nouvelle règle
settings.advanced_settings=Paramètres avancés
settings.wiki_desc=Activer le wiki du dépôt
settings.use_internal_wiki=Utiliser le wiki interne
settings.default_wiki_everyone_access=Autorisation d’accès par défaut pour les utilisateurs connectés :
settings.use_external_wiki=Utiliser un wiki externe
settings.external_wiki_url=URL Wiki externe
settings.external_wiki_url_error=L’URL du wiki externe n’est pas une URL valide.
Expand Down
10 changes: 10 additions & 0 deletions options/locale/locale_pt-PT.ini
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ search=Pesquisar...
type_tooltip=Tipo de pesquisa
fuzzy=Aproximada
fuzzy_tooltip=Incluir também os resultados que estejam próximos do termo de pesquisa
exact=Fiel
exact_tooltip=Incluir somente os resultados que correspondam rigorosamente ao termo de pesquisa
repo_kind=Pesquisar repositórios...
user_kind=Pesquisar utilizadores...
org_kind=Pesquisar organizações...
Expand All @@ -177,6 +179,8 @@ branch_kind=Pesquisar ramos...
commit_kind=Pesquisar cometimentos...
runner_kind=Pesquisar executores...
no_results=Não foram encontrados resultados correspondentes.
issue_kind=Pesquisar questões...
pull_kind=Pesquisar puxadas...
keyword_search_unavailable=Pesquisar por palavra-chave não está disponível, neste momento. Entre em contacto com o administrador.

[aria]
Expand Down Expand Up @@ -712,6 +716,7 @@ cancel=Cancelar
language=Idioma
ui=Tema
hidden_comment_types=Tipos de comentários ocultos
hidden_comment_types_description=Os tipos de comentário marcados aqui não serão mostrados dentro das páginas das questões. Marcar "Rótulo", por exemplo, remove todos os comentários "{user} adicionou/removeu {label}".
hidden_comment_types.ref_tooltip=Comentários onde esta questão foi referenciada a partir de outra questão/cometimento/…
hidden_comment_types.issue_ref_tooltip=Comentários onde o utilizador altera o ramo/etiqueta associado à questão
comment_type_group_reference=Referência
Expand Down Expand Up @@ -882,6 +887,7 @@ repo_and_org_access=Acesso aos repositórios e às organizações
permissions_public_only=Apenas público
permissions_access_all=Tudo (público, privado e limitado)
select_permissions=Escolher permissões
permission_not_set=Não definido
permission_no_access=Sem acesso
permission_read=Lidas
permission_write=Leitura e escrita
Expand Down Expand Up @@ -1286,6 +1292,7 @@ editor.or=ou
editor.cancel_lower=Cancelar
editor.commit_signed_changes=Cometer modificações assinadas
editor.commit_changes=Cometer modificações
editor.add_tmpl=Adicionar '{filename}'
editor.add=Adicionar %s
editor.update=Modificar %s
editor.delete=Eliminar %s
Expand Down Expand Up @@ -2092,6 +2099,7 @@ settings.advanced_settings=Configurações avançadas
settings.wiki_desc=Habilitar wiki do repositório
settings.use_internal_wiki=Usar o wiki nativo
settings.default_wiki_branch_name=Nome do ramo predefinido do wiki
settings.default_wiki_everyone_access=Permissão de acesso predefinida para utilizadores registados:
settings.failed_to_change_default_wiki_branch=Falhou ao mudar o nome do ramo predefinido do wiki.
settings.use_external_wiki=Usar um wiki externo
settings.external_wiki_url=URL do wiki externo
Expand Down Expand Up @@ -3083,12 +3091,14 @@ auths.tips=Dicas
auths.tips.oauth2.general=Autenticação OAuth2
auths.tips.oauth2.general.tip=Ao registar uma nova autenticação OAuth2, o URL da ligação de retorno ou do reencaminhamento deve ser:
auths.tip.oauth2_provider=Fornecedor OAuth2
auths.tip.bitbucket=Registe um novo consumidor de OAuth em https://bitbucket.org/account/user/{your-username}/oauth-consumers/new e adicione a permissão 'Account' - 'Read'
auths.tip.nextcloud=`Registe um novo consumidor OAuth na sua instância usando o seguinte menu "Configurações → Segurança → Cliente OAuth 2.0"`
auths.tip.dropbox=Crie uma nova aplicação em https://www.dropbox.com/developers/apps
auths.tip.facebook=`Registe uma nova aplicação em https://developers.facebook.com/apps e adicione o produto "Facebook Login"`
auths.tip.github=Registe uma nova aplicação OAuth em https://github.com/settings/applications/new
auths.tip.gitlab_new=Registe uma nova aplicação em https://gitlab.com/-/profile/applications
auths.tip.google_plus=Obtenha credenciais de cliente OAuth2 a partir da consola do Google API em https://console.developers.google.com/
auths.tip.openid_connect=Use o URL da descoberta de conexão OpenID "https://{server}/.well-known/openid-configuration" para especificar os extremos
auths.tip.twitter=`Vá a https://dev.twitter.com/apps, crie uma aplicação e certifique-se de que está habilitada a opção "Allow this application to be used to Sign in with Twitter"`
auths.tip.discord=Registe uma nova aplicação em https://discordapp.com/developers/applications/me
auths.tip.gitea=Registe uma nova aplicação OAuth2. O guia pode ser encontrado em https://docs.gitea.com/development/oauth2-provider
Expand Down
Loading

0 comments on commit f3b81c7

Please sign in to comment.