From 9d2638e6533dad29b05a177c7414af64094572cf Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 27 Feb 2025 14:14:33 +0100 Subject: [PATCH] [FIX] runbot_merge: don't show unreceive optional statuses ... by default. Optional statuses we haven't at least received a `pending` for are irrelevant to the PR's state, so should remain hidden. This subtetly was missed when fixing #1062 Fixes #1066 --- runbot_merge/controllers/dashboard.py | 20 ++++++++++++-------- runbot_merge/views/templates.xml | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/runbot_merge/controllers/dashboard.py b/runbot_merge/controllers/dashboard.py index 8756d76f..b3f1e867 100644 --- a/runbot_merge/controllers/dashboard.py +++ b/runbot_merge/controllers/dashboard.py @@ -402,15 +402,19 @@ def render_full_table(pr, branches, repos, batches): if not pr.batch_id.skipchecks: statuses = json.loads(pr.statuses_full) for ci in pr.repository.status_ids._for_pr(pr): - st = (statuses.get(ci.context.strip()) or {'state': 'pending'})['state'] + if (status := statuses.get(ci.context.strip())) is None: + if ci.prs != 'required': + continue + status = {'state': 'pending'} color = foreground - if st in ('error', 'failure'): - color = error - box = boxes[False] - elif st == 'success': - box = boxes[True] - else: - box = boxes[None] + match status['state']: + case 'error' | 'failure': + color = error + box = boxes[False] + case 'success': + box = boxes[True] + case _: + box = boxes[None] lines.append(Line([ Text(" - ", font, color), diff --git a/runbot_merge/views/templates.xml b/runbot_merge/views/templates.xml index ab6717c9..ca1694f9 100644 --- a/runbot_merge/views/templates.xml +++ b/runbot_merge/views/templates.xml @@ -409,7 +409,7 @@ fail ok -
  • +
  • :