Skip to content

fix(publish): say the diff is unavailable rather than claiming no changes - #11

Merged
dean-harel-unipaas merged 1 commit into
mainfrom
fix/changelog-fallback-is-honest
Aug 29, 2026
Merged

fix(publish): say the diff is unavailable rather than claiming no changes#11
dean-harel-unipaas merged 1 commit into
mainfrom
fix/changelog-fallback-is-honest

Conversation

@dean-harel-unipaas

Copy link
Copy Markdown
Contributor

Part of UN-7216.

The bug

publish.ts wrapped the oasdiff changelog call in a try/catch whose fallback was No API-surface changes detected.

That branch only runs inside stage === 'changed', and classify returns changed precisely when the incoming spec differs from what is published. So the one situation where the fallback fires is the one situation where "no changes" is guaranteed false — and the result is written into CHANGELOG.md and reused as the GitHub Release body, permanently and publicly.

Not failing the publish over a broken differ is the right call. The fallback text was the problem, not the fallback.

The change

The catch now writes Diff unavailable: the spec changed, but oasdiff did not run. and logs the underlying error instead of swallowing it.

The || 'No API-surface changes detected.' on empty oasdiff output is untouched: empty output genuinely means oasdiff found no API-surface changes, which is a true statement. A crash and an empty result are different facts and should not share a sentence.

Verification

Ran the publisher against a scratch clone with a local bare remote, oasdiff absent, and a modified spec:

oasdiff failed, publishing without a diff: spawnSync oasdiff ENOENT

## v1.12+20260829.deadbee (2026-08-29)

Diff unavailable: the spec changed, but oasdiff did not run.

npm run typecheck clean, npm test 11/11.

Context worth knowing

This path has never executed in production. CHANGELOG.md contains exactly one entry, Initial published spec., which is the !fs.existsSync(SPEC_JSON) branch. oasdiff changelog has not run here once, so the first real exercise of it will be the next production deploy that changes the spec.

UN-7216 carries that and the related pipeline findings.

…nges

The catch around oasdiff wrote "No API-surface changes detected." That branch
only runs inside stage === 'changed', which means the spec provably differs
from what is published, so a crashed differ produced a permanent public
statement that the opposite was true, in both CHANGELOG.md and the release
body. Empty oasdiff output and a dead oasdiff are different facts and now read
differently; the empty case keeps its wording, which is accurate.

The error is also logged rather than swallowed, so the job says why. Verified
by running the publisher with oasdiff absent: the log carries "spawnSync
oasdiff ENOENT" and the entry reads "Diff unavailable".

Not fixed here: this path has never executed in production. CHANGELOG.md holds
one entry, "Initial published spec.", which is the no-previous-spec branch, so
oasdiff has not run once. UN-7216 carries that.
@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 855d5ca7-c43f-4255-8d94-2ebd45764c48


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dean-harel-unipaas
dean-harel-unipaas merged commit 5cc7d96 into main Aug 29, 2026
2 checks passed
@dean-harel-unipaas
dean-harel-unipaas deleted the fix/changelog-fallback-is-honest branch August 29, 2026 11:00
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