From cf86e97ace3f6f6db95f79350a8ca107276e17db Mon Sep 17 00:00:00 2001 From: Helen Koike Date: Fri, 20 Oct 2023 19:14:22 -0300 Subject: [PATCH] ci/ci_gantt_chart: add timeout vertical line Add pipeline total duration and add a timeout vertical line to indicate the 1h Timeout mark. Signed-off-by: Helen Koike Part-of: --- bin/ci/ci_gantt_chart.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bin/ci/ci_gantt_chart.py b/bin/ci/ci_gantt_chart.py index d8d133877c7..0cd40dde85d 100755 --- a/bin/ci/ci_gantt_chart.py +++ b/bin/ci/ci_gantt_chart.py @@ -91,6 +91,21 @@ def generate_gantt_chart(pipeline): # Calculate the height dynamically fig.update_layout(height=len(tasks) * 10, yaxis_tickfont_size=14) + # Add a deadline line to the chart + created_at = datetime.fromisoformat(pipeline.created_at.replace("Z", "+00:00")) + timeout_at = created_at + timedelta(hours=1) + fig.add_vrect( + x0=timeout_at, + x1=timeout_at, + annotation_text="1h Timeout", + fillcolor="gray", + line_width=2, + line_color="gray", + line_dash="dash", + annotation_position="top left", + annotation_textangle=90, + ) + return fig