From c8a0e072ca84c81c5d23c6677d9f7ccbf0166392 Mon Sep 17 00:00:00 2001 From: abs2023 Date: Wed, 22 Apr 2026 16:07:11 -0500 Subject: [PATCH] fix(cicd): allow skipped Deploy-to-Morpheus-P-Node to satisfy C-Node deploy needs Root cause of the first v7 test-branch run (GH Actions run 24796856145): the drain job ran and deregistered the dev C-Node from both NLB target groups, then Deploy-to-Morpheus-C-Node was silently skipped because its implicit success() guard propagated the skip from Deploy-to-Morpheus-P-Node (which is main-only and intentionally skips on test pushes). That left dev with the old C-Node task running in ECS but with no load-balancer membership until we manually re-registered it. Fix: - Add an explicit `if` to Deploy-to-Morpheus-C-Node that: - Requires GHCR build + drain success. - Accepts Deploy-to-Morpheus-P-Node.result in {success, skipped}. - Wraps in `!cancelled()` so manual cancels still short-circuit. - Rewrite the inline comment that previously (incorrectly) claimed skipped jobs are treated as successful for dependency resolution; they are not. No change to the deploy logic itself, the drain job, or any other workflow sequencing. This is a pure `needs` / guard correctness fix. Made-with: Cursor --- .github/workflows/build.yml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fd9f6dad..b9516345 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1297,18 +1297,32 @@ jobs: Deploy-to-Morpheus-C-Node: name: Deploy to Morpheus Consumer via GitHub + # NOTE on `needs` + skipped dependencies: + # GitHub Actions' default job condition is implicit `success()`, which returns + # false when ANY needed job was skipped. P-Node is main-only (see its own `if`), + # so on a `test` deploy `Deploy-to-Morpheus-P-Node` is always skipped. Without + # an explicit `if` that tolerates that skip, the C-Node deploy gets skipped + # too — which is exactly what bit us on the first v7 test run: the drain job + # ran and deregistered the C-Node, then the actual deploy silently skipped, + # leaving dev without a replacement task. + # + # This `if` explicitly allows the skipped P-Node outcome, while still gating + # on drain + GHCR success and requiring we're on a deploy-eligible branch. + # `!cancelled()` keeps the guard working if a user cancels mid-run. if: | + !cancelled() && github.repository == 'MorpheusAIs/Morpheus-Lumerin-Node' && + needs.GHCR-Build-and-Push.result == 'success' && + needs.Drain-Morpheus-C-Node.result == 'success' && + (needs.Deploy-to-Morpheus-P-Node.result == 'success' || needs.Deploy-to-Morpheus-P-Node.result == 'skipped') && ( - (github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/test'))|| + (github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/test')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.build_all_os == 'true' && github.event.inputs.create_deployment == 'true') ) needs: - Generate-Tag - GHCR-Build-and-Push - Drain-Morpheus-C-Node - # P-Node is main-only; on test this job is skipped and the `needs` is still - # satisfied (skipped jobs are treated as successful for dependency resolution). - Deploy-to-Morpheus-P-Node runs-on: ubuntu-latest environment: ${{ github.ref_name }}