From d4c067fd49797b6af5d36f7547894627a34ab326 Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Mon, 26 Jan 2026 06:37:02 +0000 Subject: [PATCH] appview/pages: redirect RepoSinglePull to active round /pull/ID is redirected to /pull/ID/round/N. this makes links to lines in a diff stable. Signed-off-by: oppiliappan --- appview/pulls/pulls.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/appview/pulls/pulls.go b/appview/pulls/pulls.go index 25c06632..feef02bb 100644 --- a/appview/pulls/pulls.go +++ b/appview/pulls/pulls.go @@ -297,7 +297,14 @@ func (s *Pulls) repoPullHelper(w http.ResponseWriter, r *http.Request, interdiff } func (s *Pulls) RepoSinglePull(w http.ResponseWriter, r *http.Request) { - s.repoPullHelper(w, r, false) + pull, ok := r.Context().Value("pull").(*models.Pull) + if !ok { + log.Println("failed to get pull") + s.pages.Notice(w, "pull-error", "Failed to edit patch. Try again later.") + return + } + + http.Redirect(w, r, r.URL.String()+fmt.Sprintf("/round/%d", pull.LastRoundNumber()), http.StatusFound) } func (s *Pulls) mergeCheck(r *http.Request, f *models.Repo, pull *models.Pull, stack models.Stack) types.MergeCheckResponse { -- 2.51.2