Skip to content

Commit 07f8f9b

Browse files
committed
fix(ci): guard the matrix deployment jobs against an empty job list
wait-for-deployment builds its matrix from build-helmreleases.outputs.staging_helmreleases, and create-auto-merge-prod-pr from updated_prod_cluster_names. Neither checked the value for '[]' first, unlike every other matrix job in this file (services-build and helm-charts-build both guard on != '[]' && != ''). A matrix that expands to zero combinations cannot produce a job, so the reusable-workflow call reports failure. On PR #2092 that surfaced as a gate failure with no failing job anywhere: 15 of the pipeline's 16 jobs were success or skipped, wait-for-deployment had no check run at all, and alls-green received gooddata-ruby-lcm-promote-pipeline result=failure with empty outputs. The trigger was #2094. Before it, create-staging-pr failed outright when there was nothing to deploy, so wait-for-deployment's !contains(needs.*.result, 'failure') was false and the job was skipped before its matrix was ever evaluated -- it showed up as 'skipped' in run 32728855771. Once create-staging-pr correctly succeeded on a no-op, the condition passed, the matrix was evaluated for the first time in this state, and it was empty. #2094 did not introduce this, it removed the failure that was masking it. staging_helmreleases is empty whenever stg1 already runs the built chart, which is the normal state after a previous attempt delivered its staging PR -- gitops-deployments#26557 in this case. create-auto-merge-prod-pr carries the same defect. It is latent here because the gate sets AUTO_MERGE: false, but it is live for any consumer that auto-merges into an already up-to-date production cluster. JIRA: GRIF-518
1 parent d227561 commit 07f8f9b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎.github/workflows/lcm-pipeline.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ jobs:
225225
!cancelled() &&
226226
!contains(needs.*.result, 'failure') &&
227227
needs.build-helmreleases.result == 'success' &&
228+
needs.build-helmreleases.outputs.staging_helmreleases != '[]' &&
229+
needs.build-helmreleases.outputs.staging_helmreleases != '' &&
228230
inputs.deploy
229231
strategy:
230232
matrix:
@@ -335,6 +337,8 @@ jobs:
335337
!cancelled() &&
336338
!contains(needs.*.result, 'failure') &&
337339
needs.build-helmreleases.result == 'success' &&
340+
needs.build-helmreleases.outputs.updated_prod_cluster_names != '[]' &&
341+
needs.build-helmreleases.outputs.updated_prod_cluster_names != '' &&
338342
inputs.AUTO_MERGE &&
339343
inputs.deploy
340344
strategy:

0 commit comments

Comments
 (0)