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. 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) 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) }