Commit 2b14c58
authored
fix(cicd): allow skipped Deploy-to-Morpheus-P-Node to satisfy C-Node deploy needs (#715)
## Summary
Hotfix for the first v7 `test`-branch deployment attempt ([Actions run
#1447 / run id
24796856145](https://github.com/MorpheusAIs/Morpheus-Lumerin-Node/actions/runs/24796856145)).
The previous PR (#714 → #713) introduced a new job sequence:
```
Drain-Morpheus-C-Node → Deploy-to-Morpheus-P-Node → Deploy-to-Morpheus-C-Node
```
On push to `test`, `Deploy-to-Morpheus-P-Node` is correctly **skipped**
(its own `if` restricts it to `main` — no dev P-Node exists). That skip
then propagated onto `Deploy-to-Morpheus-C-Node` through the implicit
`success()` guard that every job has when no explicit `if` tolerates a
skipped dependency. Net effect:
- `Drain-Morpheus-C-Node` ✅ removed the running dev C-Node task from
both NLB target groups.
- `Deploy-to-Morpheus-C-Node` ❌ silently skipped — no new task
registered, no re-register of the existing task.
- Dev C-Node endpoints (`router.dev.mor.org:8082`/`:8545`) stopped
serving traffic until we manually re-registered the old task to the TGs.
## What this PR changes
`.github/workflows/build.yml`, `Deploy-to-Morpheus-C-Node` job only:
### Explicit `if` guard that tolerates the P-Node skip
```yaml
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 == 'workflow_dispatch' && github.event.inputs.build_all_os == 'true' && github.event.inputs.create_deployment == 'true')
)
```
- Still requires real success from the drain + GHCR jobs.
- Explicitly accepts `success` OR `skipped` for the P-Node dependency.
- `!cancelled()` short-circuits the job if someone cancels the run, so
we don't try to redeploy a half-cancelled sequence.
### Comment rewrite
The previous inline comment claimed skipped jobs are treated as
successful for dependency resolution. That's the opposite of how GitHub
Actions actually behaves — the note is replaced with an accurate
explanation and a reference to this incident so future-us (or other
maintainers) won't step on the same rake.
## What this PR does NOT change
- No change to the drain job or the controlled-traffic C-Node deploy
sequence (register→dereg→hold→rereg→wait).
- No change to the P-Node job or its `if` gating.
- No change to any other workflow or deploy script.
This is a pure guard-correctness fix.
## Test plan
- [x] YAML syntax validated (`yaml.safe_load`).
- [x] Manually walked through `needs` outcomes:
- On push to `test`: P-Node `skipped`, drain + GHCR `success` → C-Node
**runs**. ✅
- On push to `main`: all three `success` → C-Node **runs**. ✅
- Drain fails → C-Node **skipped** (won't redeploy while the TG state is
ambiguous). ✅
- GHCR fails → C-Node **skipped**. ✅
- P-Node fails on main (not skipped) → C-Node **skipped** (we want to
bail rather than leave prd with a v-mismatch between providers and the
consumer). ✅
- [ ] Merge to `dev`, promote to `test`, confirm
`Deploy-to-Morpheus-Consumer` actually runs this time and completes the
drain → hold → re-register → /healthcheck cycle end-to-end.
- [ ] Once green on test, cut `test` → `main` for first prd exercise.
## Related
- Previous PR: #714 (dev → test) carrying #713 (initial
drain/sequence/hold).
- Companion IAM + planning doc already applied in `Morpheus-Infra`.
Made with [Cursor](https://cursor.com)1 file changed
Lines changed: 17 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1297 | 1297 | | |
1298 | 1298 | | |
1299 | 1299 | | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
1300 | 1312 | | |
| 1313 | + | |
1301 | 1314 | | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
1302 | 1318 | | |
1303 | | - | |
| 1319 | + | |
1304 | 1320 | | |
1305 | 1321 | | |
1306 | 1322 | | |
1307 | 1323 | | |
1308 | 1324 | | |
1309 | 1325 | | |
1310 | | - | |
1311 | | - | |
1312 | 1326 | | |
1313 | 1327 | | |
1314 | 1328 | | |
| |||
0 commit comments