summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorHelen Koike <helen.koike@collabora.com>2023-12-21 18:12:31 -0300
committerMarge Bot <emma+marge@anholt.net>2024-01-17 13:10:07 +0000
commitffaa247b4fff72cd2045f37be526904c7ebd200c (patch)
tree01bd7cd8ce65c81c5674cbb6191f76e4f038d9b6 /bin
parentcf86e97ace3f6f6db95f79350a8ca107276e17db (diff)
ci/ci_gantt_chart: add option to save output to a file
Allow saving in html and in image formats. Signed-off-by: Helen Koike <helen.koike@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25793>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ci/ci_gantt_chart.py14
-rw-r--r--bin/ci/requirements.txt1
2 files changed, 14 insertions, 1 deletions
diff --git a/bin/ci/ci_gantt_chart.py b/bin/ci/ci_gantt_chart.py
index 0cd40dde85d..882ab5424b3 100755
--- a/bin/ci/ci_gantt_chart.py
+++ b/bin/ci/ci_gantt_chart.py
@@ -115,6 +115,12 @@ def parse_args() -> None:
)
parser.add_argument("pipeline_url", type=str, help="URLs to the pipeline.")
parser.add_argument(
+ "-o",
+ "--output",
+ type=str,
+ help="Output file name. Use html ou image suffixes to choose the format.",
+ )
+ parser.add_argument(
"--token",
metavar="token",
help="force GitLab token, otherwise it's read from ~/.config/gitlab-token",
@@ -131,4 +137,10 @@ if __name__ == "__main__":
pipeline, _ = get_gitlab_pipeline_from_url(gl, args.pipeline_url)
fig = generate_gantt_chart(pipeline)
- fig.show()
+ if args.output and "htm" in args.output:
+ fig.write_html(args.output)
+ elif args.output:
+ fig.update_layout(width=1000)
+ fig.write_image(args.output)
+ else:
+ fig.show()
diff --git a/bin/ci/requirements.txt b/bin/ci/requirements.txt
index e01c0096543..a1448999b15 100644
--- a/bin/ci/requirements.txt
+++ b/bin/ci/requirements.txt
@@ -1,6 +1,7 @@
colorama==0.4.5
filecache==0.81
gql==3.4.0
+kaleido==0.2.1
python-dateutil==2.8.2
pandas==2.1.1
plotly==5.17.0