argocd-helm/scripts/release-analysis/main.py
Tim Collins 56c5a31c9e
feat(github): Analyse past release times (#3135)
* feat(github): Analyse past release times

Signed-off-by: Tim Collins <tim@thecollins.team>

* typo

Signed-off-by: Tim Collins <tim@thecollins.team>

* add megalinter config. Fix my rubbish code to appease the linter

Signed-off-by: Tim Collins <tim@thecollins.team>

---------

Signed-off-by: Tim Collins <tim@thecollins.team>
Co-authored-by: Aikawa <yu.croco@gmail.com>
2025-01-29 13:43:03 +00:00

31 lines
900 B
Python

import os
from fetch_helmet_releases import fetch_and_write_helmet_releases
from fetch_releases import fetch_and_write_releases
from merge_csvs import merge_csv_files
from plot_graph import plot_time_difference
# Check there is a github token
github_token = os.getenv("GITHUB_TOKEN")
if not github_token:
raise ValueError("GITHUB_TOKEN environment variable is not set")
# Do the thing
print("Fetching releases...")
fetch_and_write_releases("argo_releases.csv")
print("Done")
print("Fetching Team Helmet releases...")
fetch_and_write_helmet_releases("argo_helm_releases.csv")
print("Done")
print("Merging release info...")
merge_csv_files("argo_releases.csv", "argo_helm_releases.csv", "merged_releases.csv")
print("Done")
print("Plotting time difference graphs...")
plot_time_difference("merged_releases.csv")
print("Done")
# Delete __pycache__ directories
os.system("rm -rf __pycache__")