From 175182525625beb2a156cee6a0e2acc8fcaa4605 Mon Sep 17 00:00:00 2001 From: Zettat123 Date: Mon, 26 Aug 2024 01:18:19 +0800 Subject: [PATCH 1/3] Handle "close" actionable references for manual merges (#31879) Fix #31743 (cherry picked from commit 725a3ed9ad110f8354303140f527326c64f42dc8) --- services/pull/merge.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/services/pull/merge.go b/services/pull/merge.go index 57f3b1e377..a1585e64ab 100644 --- a/services/pull/merge.go +++ b/services/pull/merge.go @@ -229,6 +229,10 @@ func Merge(ctx context.Context, pr *issues_model.PullRequest, doer *user_model.U // Reset cached commit count cache.Remove(pr.Issue.Repo.GetCommitsCountCacheKey(pr.BaseBranch, true)) + return handleCloseCrossReferences(ctx, pr, doer) +} + +func handleCloseCrossReferences(ctx context.Context, pr *issues_model.PullRequest, doer *user_model.User) error { // Resolve cross references refs, err := pr.ResolveCrossReferences(ctx) if err != nil { @@ -553,5 +557,6 @@ func MergedManually(ctx context.Context, pr *issues_model.PullRequest, doer *use notify_service.MergePullRequest(baseGitRepo.Ctx, doer, pr) log.Info("manuallyMerged[%d]: Marked as manually merged into %s/%s by commit id: %s", pr.ID, pr.BaseRepo.Name, pr.BaseBranch, commitID) - return nil + + return handleCloseCrossReferences(ctx, pr, doer) } From 4ee3a150a3899fe9b43aa0f10b0b958d773405d4 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 29 Aug 2024 21:26:25 +0800 Subject: [PATCH 2/3] Fix search team (#31923) Fix #20658 (cherry picked from commit 06c67c6d5a91176fe4b87fc884c96afc7c3597fa) --- routers/web/web.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/routers/web/web.go b/routers/web/web.go index a1499c7645..d174b4e251 100644 --- a/routers/web/web.go +++ b/routers/web/web.go @@ -855,10 +855,15 @@ func registerRoutes(m *web.Route) { m.Post("/teams/{team}/action/repo/{action}", org.TeamsRepoAction) }, context.OrgAssignment(true, false, true)) + // require admin permission + m.Group("/{org}", func() { + m.Get("/teams/-/search", org.SearchTeam) + }, context.OrgAssignment(true, false, false, true)) + + // require owner permission m.Group("/{org}", func() { m.Get("/teams/new", org.NewTeam) m.Post("/teams/new", web.Bind(forms.CreateTeamForm{}), org.NewTeamPost) - m.Get("/teams/-/search", org.SearchTeam) m.Get("/teams/{team}/edit", org.EditTeam) m.Post("/teams/{team}/edit", web.Bind(forms.CreateTeamForm{}), org.EditTeamPost) m.Post("/teams/{team}/delete", org.DeleteTeam) From db268c5ee7252b71046b84df8c09185c1a796518 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 1 Sep 2024 07:54:38 +0200 Subject: [PATCH 3/3] chore(release-notes): weekly cherry-pick week 2024-36 --- release-notes/5195.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 release-notes/5195.md diff --git a/release-notes/5195.md b/release-notes/5195.md new file mode 100644 index 0000000000..3c4990ccfa --- /dev/null +++ b/release-notes/5195.md @@ -0,0 +1,2 @@ +fix: [commit](https://codeberg.org/forgejo/forgejo/commit/196907e359420f63003f884d1cf827b4a4d7a4e5) Handle "close" actionable references for manual merges. +fix: [commit](https://codeberg.org/forgejo/forgejo/commit/46b1f2e7e4e795331f28f74666094c9416499e03) Team admins are allowed to search team members via the API.