From 52f2b1e381f583f23cade1abb2650bb348375227 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 5 Aug 2024 15:18:19 +0200 Subject: [PATCH] [FIX] runbot_merge: don't show details of merged PR on GH Detailed statuses are useful in the actual PR dashboard as that allows direct access to the builds, however in the PR where it's only a picture it's useless, so fold that information. Also fold it when a PR is staged. And while at it add a note / sub-title that the PR is staged. Fixes #919 --- runbot_merge/controllers/dashboard.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/runbot_merge/controllers/dashboard.py b/runbot_merge/controllers/dashboard.py index 2db8def1..9cdc55d8 100644 --- a/runbot_merge/controllers/dashboard.py +++ b/runbot_merge/controllers/dashboard.py @@ -355,7 +355,14 @@ def render_full_table(pr, branches, repos, batches): for p in ps['prs']: pr = p['pr'] attached = attached and p['attached'] - sub = ": staging failed" if pr.error else "" + + if pr.staging_id: + sub = ": is staged" + elif pr.error: + sub = ": staging failed" + else: + sub = "" + lines = [ Line([Text( f"#{p['number']}{sub}", @@ -366,7 +373,7 @@ def render_full_table(pr, branches, repos, batches): ] # no need for details if closed or in error - if not (p['closed'] or pr.error): + if pr.state not in ('merged', 'closed', 'error') and not pr.staging_id: if pr.draft: lines.append(Line([boxes[False], Text("is in draft", font, error)])) lines.extend([