Skip to content

Commit

Permalink
Ensure variable name consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
sgibson91 committed Dec 17, 2024
1 parent 003b348 commit 51be2fe
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
6 changes: 3 additions & 3 deletions deployer/commands/generate/helm_upgrade/decision.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def filter_out_staging_hubs(all_hub_matrix_jobs):
function.
Returns:
staging_matrix_jobs (list[dict]): A list of dictionaries representing
staging_hub_matrix_jobs (list[dict]): A list of dictionaries representing
matrix jobs to upgrade staging hubs on clusters that require it.
prod_hub_matrix_jobs (list[dict]): A list of dictionaries representing matrix
jobs to upgrade all production hubs, i.e., those without "staging" in their
Expand Down Expand Up @@ -302,8 +302,8 @@ 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}
missing_clusters = prod_hub_clusters.difference(staging_clusters)
staging_hub_clusters = {job["cluster_name"] for job in staging_hub_matrix_jobs}
missing_clusters = prod_hub_clusters.difference(staging_hub_clusters)

if missing_clusters:
# Generate staging jobs for clusters that don't have them but do have
Expand Down
5 changes: 1 addition & 4 deletions deployer/commands/generate/helm_upgrade/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,7 @@ def helm_upgrade_jobs(
)

# Clean up the matrix 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 = assign_staging_jobs_for_missing_clusters(
staging_hub_matrix_jobs, prod_hub_matrix_jobs
)
# Pretty print the jobs using rich
Expand Down
12 changes: 6 additions & 6 deletions tests/test_helm_upgrade_decision.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ def test_filter_out_staging_hubs_job_exists():
},
]

expected_staging_hub_matrix_jobs = [
expected_staging_matrix_jobs = [
{
"cluster_name": "cluster1",
"provider": "gcp",
Expand All @@ -403,12 +403,12 @@ def test_filter_out_staging_hubs_job_exists():
]

(
result_staging_hub_matrix_jobs,
result_staging_matrix_jobs,
result_prod_hub_matrix_jobs,
) = filter_out_staging_hubs(input_hub_matrix_jobs)

case.assertCountEqual(
result_staging_hub_matrix_jobs, expected_staging_hub_matrix_jobs
result_staging_matrix_jobs, expected_staging_matrix_jobs
)
case.assertCountEqual(result_prod_hub_matrix_jobs, expected_prod_hub_matrix_jobs)

Expand All @@ -431,7 +431,7 @@ def test_filter_out_staging_hubs_job_does_not_exist():
},
]

expected_staging_hub_matrix_jobs = [
expected_staging_matrix_jobs = [
{
"cluster_name": "cluster1",
"provider": "gcp",
Expand All @@ -452,12 +452,12 @@ def test_filter_out_staging_hubs_job_does_not_exist():
"deployer.utils.file_acquisition.CONFIG_CLUSTERS_PATH", clusters_path
):
(
result_staging_hub_matrix_jobs,
result_staging_matrix_jobs,
result_prod_hub_matrix_jobs,
) = filter_out_staging_hubs(input_hub_matrix_jobs)

case.assertCountEqual(
result_staging_hub_matrix_jobs, expected_staging_hub_matrix_jobs
result_staging_matrix_jobs, expected_staging_matrix_jobs
)
case.assertCountEqual(result_prod_hub_matrix_jobs, expected_prod_hub_matrix_jobs)

Expand Down

0 comments on commit 51be2fe

Please sign in to comment.