diff --git a/.github/workflows/deploy-hubs.yaml b/.github/workflows/deploy-hubs.yaml index 0ee0957b8..79dd11c8c 100644 --- a/.github/workflows/deploy-hubs.yaml +++ b/.github/workflows/deploy-hubs.yaml @@ -209,7 +209,7 @@ jobs: footer: "<{run_url}|Failing Run>" env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_FAILURES_WEBHOOK_URL }} - + # This job upgrades the support chart for clusters in parallel, if those upgrades # are required. This job needs the `generate-jobs` job to have completed and set # an output to the `support-matrix-jobs` variable name. It's inputs are a list of diff --git a/deployer/commands/generate/helm_upgrade/decision.py b/deployer/commands/generate/helm_upgrade/decision.py index 9a2b78187..52a7eba07 100644 --- a/deployer/commands/generate/helm_upgrade/decision.py +++ b/deployer/commands/generate/helm_upgrade/decision.py @@ -10,8 +10,8 @@ from rich.table import Table from ruamel.yaml import YAML -from deployer.utils.rendering import print_colour from deployer.utils.file_acquisition import find_absolute_path_to_cluster_file +from deployer.utils.rendering import print_colour yaml = YAML(typ="safe", pure=True) @@ -305,9 +305,7 @@ def assign_staging_jobs_for_missing_clusters( staging_hub_matrix_jobs now have an associated support/staging job. """ prod_hub_clusters = {job["cluster_name"] for job in prod_hub_matrix_jobs} - staging_clusters = { - job["cluster_name"] for job in staging_hub_matrix_jobs - } + staging_clusters = {job["cluster_name"] for job in staging_hub_matrix_jobs} missing_clusters = prod_hub_clusters.difference(staging_clusters) if missing_clusters: @@ -355,7 +353,9 @@ def assign_staging_jobs_for_missing_clusters( return staging_hub_matrix_jobs -def pretty_print_matrix_jobs(support_matrix_jobs, staging_hub_matrix_jobs, prod_hub_matrix_jobs): +def pretty_print_matrix_jobs( + support_matrix_jobs, staging_hub_matrix_jobs, prod_hub_matrix_jobs +): # Construct table for support chart upgrades support_table = Table(title="Support chart upgrades") support_table.add_column("Cloud Provider") diff --git a/deployer/commands/generate/helm_upgrade/jobs.py b/deployer/commands/generate/helm_upgrade/jobs.py index b31753e65..c819decea 100644 --- a/deployer/commands/generate/helm_upgrade/jobs.py +++ b/deployer/commands/generate/helm_upgrade/jobs.py @@ -91,16 +91,14 @@ def helm_upgrade_jobs( upgrade_support_on_this_cluster = False # Generate a job matrix of all hubs that need upgrading on this cluster - staging_hubs, prod_hubs = ( - generate_hub_matrix_jobs( - cluster_file, - cluster_config, - cluster_info, - set(changed_filepaths), - pr_labels, - upgrade_all_hubs_on_this_cluster=upgrade_all_hubs_on_this_cluster, - upgrade_all_hubs_on_all_clusters=upgrade_all_hubs_on_all_clusters, - ) + staging_hubs, prod_hubs = generate_hub_matrix_jobs( + cluster_file, + cluster_config, + cluster_info, + set(changed_filepaths), + pr_labels, + upgrade_all_hubs_on_this_cluster=upgrade_all_hubs_on_this_cluster, + upgrade_all_hubs_on_all_clusters=upgrade_all_hubs_on_all_clusters, ) staging_hub_matrix_jobs.extend(staging_hubs) prod_hub_matrix_jobs.extend(prod_hubs) @@ -122,9 +120,13 @@ def helm_upgrade_jobs( # support_and_staging_matrix_jobs = ensure_support_staging_jobs_have_correct_keys( # support_and_staging_matrix_jobs, prod_hub_matrix_jobs # ) - staging_matrix_jobs = assign_staging_jobs_for_missing_clusters(staging_hub_matrix_jobs, prod_hub_matrix_jobs) + staging_matrix_jobs = assign_staging_jobs_for_missing_clusters( + staging_hub_matrix_jobs, prod_hub_matrix_jobs + ) # Pretty print the jobs using rich - pretty_print_matrix_jobs(support_matrix_jobs, staging_hub_matrix_jobs, prod_hub_matrix_jobs) + pretty_print_matrix_jobs( + support_matrix_jobs, staging_hub_matrix_jobs, prod_hub_matrix_jobs + ) # The existence of the CI environment variable is an indication that we are running # in an GitHub Actions workflow diff --git a/deployer/utils/rendering.py b/deployer/utils/rendering.py index ef9208f9d..7d4d2c22d 100644 --- a/deployer/utils/rendering.py +++ b/deployer/utils/rendering.py @@ -81,9 +81,7 @@ def create_markdown_comment(support_matrix, staging_matrix, prod_matrix): column_converter["upgrade_support"]: boolean_converter[ entry["upgrade_support"] ], - column_converter["reason_for_redeploy"]: entry[ - "reason_for_redeploy" - ], + column_converter["reason_for_redeploy"]: entry["reason_for_redeploy"], } formatted_support_matrix.append(formatted_entry)