From 76e892317b22cad38ce73d41483467699a16a76d Mon Sep 17 00:00:00 2001 From: Giteabot Date: Wed, 29 Nov 2023 10:49:33 +0800 Subject: [PATCH 1/3] Fix issue will be detected as pull request when checking `First-time contributor` (#28237) (#28271) Backport #28237 by @yp05327 Fix #28224 Co-authored-by: yp05327 <576951401@qq.com> --- routers/web/repo/issue.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go index 76bb67ceaaa1..76152c912187 100644 --- a/routers/web/repo/issue.go +++ b/routers/web/repo/issue.go @@ -1306,7 +1306,7 @@ func roleDescriptor(ctx stdCtx.Context, repo *repo_model.Repository, poster *use return roleDescriptor, err } else if hasMergedPR { roleDescriptor.RoleInRepo = issues_model.RoleRepoContributor - } else { + } else if issue.IsPull { // only display first time contributor in the first opening pull request roleDescriptor.RoleInRepo = issues_model.RoleRepoFirstTimeContributor } From 24e03a125d3ebeec93a8b39f656cb69529819e1b Mon Sep 17 00:00:00 2001 From: Giteabot Date: Wed, 29 Nov 2023 23:00:32 +0800 Subject: [PATCH 2/3] Fix required error for token name (#28267) (#28284) Backport #28267 by @earl-warren - Say to the binding middleware which locale should be used for the required error. - Resolves https://codeberg.org/forgejo/forgejo/issues/1683 (cherry picked from commit 5a2d7966127b5639332038e9925d858ab54fc360) Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com> Co-authored-by: Gusted --- services/forms/user_form.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/forms/user_form.go b/services/forms/user_form.go index c0eb03f55476..cbab27423889 100644 --- a/services/forms/user_form.go +++ b/services/forms/user_form.go @@ -365,7 +365,7 @@ func (f *EditVariableForm) Validate(req *http.Request, errs binding.Errors) bind // NewAccessTokenForm form for creating access token type NewAccessTokenForm struct { - Name string `binding:"Required;MaxSize(255)"` + Name string `binding:"Required;MaxSize(255)" locale:"settings.token_name"` Scope []string } From d2908b27940fdc829a8bff96570972cd628d65a0 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Wed, 29 Nov 2023 23:38:04 +0800 Subject: [PATCH 3/3] Meilisearch: require all query terms to be matched (#28293) (#28296) Co-authored-by: Brecht Van Lommel --- modules/indexer/issues/meilisearch/meilisearch.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/indexer/issues/meilisearch/meilisearch.go b/modules/indexer/issues/meilisearch/meilisearch.go index 335395f2f671..ab8dcd0af45a 100644 --- a/modules/indexer/issues/meilisearch/meilisearch.go +++ b/modules/indexer/issues/meilisearch/meilisearch.go @@ -211,10 +211,11 @@ func (b *Indexer) Search(ctx context.Context, options *internal.SearchOptions) ( skip, limit := indexer_internal.ParsePaginator(options.Paginator, maxTotalHits) searchRes, err := b.inner.Client.Index(b.inner.VersionedIndexName()).Search(options.Keyword, &meilisearch.SearchRequest{ - Filter: query.Statement(), - Limit: int64(limit), - Offset: int64(skip), - Sort: sortBy, + Filter: query.Statement(), + Limit: int64(limit), + Offset: int64(skip), + Sort: sortBy, + MatchingStrategy: "all", }) if err != nil { return nil, err