From 9621ac2a0bb4e429c36e54b4ef28ac7e0420bf42 Mon Sep 17 00:00:00 2001
From: Emanuele Aina <emanuele.aina@collabora.com>
Date: Mon, 9 May 2022 14:18:53 +0200
Subject: [PATCH] dashboard: Add link to retrigger failed pipelines

GitLab makes retrying failed jobs easy, but sometimes it's preferable to
retrigger the whole pipeline from scratch for consistency, so let's make
it more convenient by adding a dedicated button to each failure report.

Signed-off-by: Emanuele Aina <emanuele.aina@collabora.com>
---
 templates/index.html.jinja2 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/templates/index.html.jinja2 b/templates/index.html.jinja2
index b69d6d9..513da35 100644
--- a/templates/index.html.jinja2
+++ b/templates/index.html.jinja2
@@ -295,6 +295,9 @@
           Upstream branch {{branch(package, report.branch)}} dropped
           {%- elif report.kind == "git-branch-pipeline-failed" -%}
           Pipeline failed on {{ branch(package, report.branch) }}: {{ pipeline(package, report.pipeline_web_url) }}
+            <a href="{{ package.git.web_url }}/pipelines/new?ref={{ report.branch.name|urlencode }}">
+              retrigger 🔁
+            </a>
           {%- elif report.kind == "git-branch-licensing-report-missing" -%}
           Missing licensing report on {{branch(package, report.branch)}}
           {%- elif report.kind == "git-branch-licensing-override" -%}
-- 
GitLab