Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deployer: respect deployer:skip-deploy-hubs, :deploy-hubs, :deploy-support labels #4765

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions deployer/commands/generate/helm_upgrade/decision.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,14 @@ def generate_hub_matrix_jobs(
matrix_job["hub_name"] = hub["name"]

if upgrade_all_hubs_on_all_clusters:
matrix_job["reason_for_redeploy"] = (
"Core infrastructure has been modified"
)
if pr_labels and "deployer:deploy-hubs" in pr_labels:
matrix_job["reason_for_redeploy"] = (
"deployer:deploy-hubs label detected"
)
else:
matrix_job["reason_for_redeploy"] = (
"Core infrastructure has been modified"
)

matrix_jobs.append(matrix_job)

Expand Down Expand Up @@ -221,9 +226,14 @@ def generate_support_matrix_jobs(
matrix_job["upgrade_support"] = True

if upgrade_support_on_all_clusters:
matrix_job["reason_for_support_redeploy"] = (
"Support helm chart has been modified"
)
if pr_labels and "deployer:deploy-support" in pr_labels:
matrix_job["reason_for_support_redeploy"] = (
"deployer:deploy-support label detected"
)
else:
matrix_job["reason_for_support_redeploy"] = (
"Support helm chart has been modified"
)

matrix_jobs.append(matrix_job)

Expand Down
7 changes: 6 additions & 1 deletion deployer/commands/generate/helm_upgrade/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def helm_upgrade_jobs(
),
pr_labels: str = typer.Argument(
"[]",
help="JSON formatted list of PR labels, where 'deployer:skip-deploy' and 'deployer:skip-deploy-hubs' are respected.",
help="JSON formatted list of PR labels, where 'deployer:skip-deploy', 'deployer:skip-deploy-hubs', 'deployer:deploy-support', and 'deployer:deploy-hubs' are respected.",
),
):
"""
Expand All @@ -45,6 +45,11 @@ def helm_upgrade_jobs(
upgrade_all_hubs_on_all_clusters,
) = discover_modified_common_files(changed_filepaths)

if "deployer:deploy-support" in pr_labels:
upgrade_support_on_all_clusters = True
if "deployer:deploy-hubs" in pr_labels:
upgrade_all_hubs_on_all_clusters = True

# Convert changed filepaths into absolute Posix Paths
changed_filepaths = [
REPO_ROOT_PATH.joinpath(filepath) for filepath in changed_filepaths
Expand Down