ci: fail publish pipeline loudly on registry/auth/network errors #396

Merged
jason.woltje merged 1 commits from fix/publish-loud-errors into main 2026-04-05 03:58:36 +00:00
Owner

Summary

The publish-npm step ended with || echo "[publish] Some packages may already exist at this version — continuing", which unconditionally converted any failure into success.

That fallback silently masked a real Gitea registry 404 during the @mosaic/*@mosaicstack/* org rename — pipelines #681 and #684 reported green while every single @mosaicstack/* publish fell on the floor, blocking users from installing the gateway until the registry issue was independently resolved in #394.

Change

Replace the blanket swallow with a targeted rule:

Pattern Action
E404 / E401 / ENEEDAUTH / ECONNREFUSED / ETIMEDOUT / ENOTFOUND FATAL — fail pipeline
EPUBLISHCONFLICT / cannot publish over / previously published Tolerate (legitimate "only some packages bumped" case)
Any other unrecognized failure FATAL (fail closed)

Why this matters

This pattern was hiding the exact class of bug I was investigating for the last several hours. Without this fix the next publish-drift will hide itself the same way.

Test plan

  • pnpm format:check passes
  • YAML parses (python3 -c 'import yaml; yaml.safe_load(...)')
  • CI publish step runs normally on merge (no regression) — current main already has a healthy publish history so the happy path should succeed
  • Future broken publishes will now fail the pipeline instead of silently reporting green
## Summary The `publish-npm` step ended with `|| echo "[publish] Some packages may already exist at this version — continuing"`, which unconditionally converted any failure into success. That fallback silently masked a real Gitea registry 404 during the `@mosaic/*` → `@mosaicstack/*` org rename — pipelines #681 and #684 reported green while **every single `@mosaicstack/*` publish fell on the floor**, blocking users from installing the gateway until the registry issue was independently resolved in #394. ## Change Replace the blanket swallow with a targeted rule: | Pattern | Action | |---|---| | `E404` / `E401` / `ENEEDAUTH` / `ECONNREFUSED` / `ETIMEDOUT` / `ENOTFOUND` | **FATAL** — fail pipeline | | `EPUBLISHCONFLICT` / `cannot publish over` / `previously published` | Tolerate (legitimate "only some packages bumped" case) | | Any other unrecognized failure | **FATAL** (fail closed) | ## Why this matters This pattern was hiding the exact class of bug I was investigating for the last several hours. Without this fix the next publish-drift will hide itself the same way. ## Test plan - [x] `pnpm format:check` passes - [x] YAML parses (`python3 -c 'import yaml; yaml.safe_load(...)'`) - [ ] CI publish step runs normally on merge (no regression) — current main already has a healthy publish history so the happy path should succeed - [ ] Future broken publishes will now fail the pipeline instead of silently reporting green
jason.woltje added 1 commit 2026-04-05 03:50:47 +00:00
The publish-npm step ended with `|| echo "[publish] Some packages may
already exist at this version — continuing"`, which unconditionally
converted any failure into success. That fallback silently masked a
real Gitea registry 404 during the @mosaic/* → @mosaicstack/* org
rename — CI reported green for pipelines #681 and #684 while every
single @mosaicstack/* publish fell on the floor, blocking users from
installing the gateway.

Replace the blanket swallow with a targeted rule:

- `E404 / E401 / ENEEDAUTH / ECONNREFUSED / ETIMEDOUT / ENOTFOUND` →
  FATAL, fail the pipeline. These are real registry/auth/network
  problems that must surface.
- `EPUBLISHCONFLICT / cannot publish over / previously published` →
  tolerate. This is the legitimate "only some packages were bumped in
  this merge" case and should not block CI.
- Any other unrecognized failure → FATAL (fail closed, not open).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jason.woltje force-pushed fix/publish-loud-errors from 437623a76f to 43145745d7 2026-04-05 03:53:02 +00:00 Compare
jason.woltje merged commit 1230f6b984 into main 2026-04-05 03:58:36 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#396