Skip to content

fix(ci): don't silently skip publishes when change detection fails#108

Merged
SethPaul merged 1 commit into
mainfrom
fix/publish-detect-changes-silent-skip
Jun 1, 2026
Merged

fix(ci): don't silently skip publishes when change detection fails#108
SethPaul merged 1 commit into
mainfrom
fix/publish-detect-changes-silent-skip

Conversation

@SethPaul
Copy link
Copy Markdown
Contributor

@SethPaul SethPaul commented Jun 1, 2026

Problem

publish-all-packages.yml's change-detection computed the changed-package set with:

CHANGED_PACKAGES=$(pnpm turbo run build --dry=json --filter="...[${BASE_REF}]" 2>/dev/null | jq ... || echo "[]")

Any turbo failure — or an unreachable github.event.before (shallow clone, force-push, freshly created branch) — collapses to []. That sets has-changes=false, which gates calculate-dependency-layers and the entire version-and-publish job, so the whole release is silently skipped while the workflow still reports ✅. 2>/dev/null hides the turbo error that would have explained it.

This just bit us: @saga-ed/soa-postgres@0.1.2 did not publish on the #107 merge — the run was green but detect-changes logged Changed packages: [] and the publish job was skipped. (0.1.2 was then published manually.)

Fix

Distinguish a real diff failure from a genuinely-empty diff:

  • Stop swallowing turbo's stderr — surface it in the logs.
  • Guard that the base ref is actually reachable (git cat-file -e) before diffing.
  • On any uncertainty (unreachable ref, turbo error), fall back to all packages instead of [].

A superset is safe because the publish step is already idempotent — npm publish skips versions that already exist (continue on error … may already exist). So at worst we re-attempt publishing unchanged packages (no-op); we never silently drop a real release again.

Verification

  • yaml.safe_load parses ✅; bash -n on the extracted script ✅.
  • Reproduced the failure mode locally (reachable base ref + turbo unavailable, and an unreachable base ref): old logic → []; new logic → the full 29-package fallback (incl. node/postgres), i.e. publish would proceed.

Note: the bug fixed here is in the workflow on main; this PR doesn't change any package, so it won't itself trigger a publish.

publish-all-packages.yml computed changed packages with
`pnpm turbo ... 2>/dev/null ... || echo "[]"`. Any turbo failure or an
unreachable `github.event.before` (shallow clone, force-push, freshly
created branch) collapsed to `[]` -> has-changes=false -> the entire
version-and-publish job was skipped, silently dropping the release. This
is how @saga-ed/soa-postgres 0.1.2 failed to publish on the #107 merge
despite a green workflow run.

Distinguish a real diff failure from a genuinely-empty diff: surface
turbo's stderr, guard that the base ref is reachable, and on any
uncertainty fall back to ALL packages. The publish step is idempotent
(npm publish skips already-published versions), so a superset is safe;
an empty set is not.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

❌ Test Results

Status Suites Tests
✅ Passed 150 380
❌ Failed 0 9
⏭️ Skipped 0 0
Total 150 389

Package Results

Package Tests Passed Failed
✅ @saga-ed/soa-core 23 23 0
✅ @saga-ed/soa-node 273 273 0
✅ @saga-ed/soa-web 17 17 0

Commits

  • Branch: 11943eb (fix/publish-detect-changes-silent-skip)
  • Merge: 6a3fb01

Links


Updated: 2026-06-01T22:40:02.003Z

@SethPaul SethPaul merged commit e5a3def into main Jun 1, 2026
32 checks passed
@SethPaul SethPaul deleted the fix/publish-detect-changes-silent-skip branch June 1, 2026 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant