Skip to content

fix: do not tell CI builds they are too old - #17

Merged
zcsizmadia merged 1 commit into
mainfrom
fix/ci-build-version-warning
Sep 11, 2026
Merged

zcsizmadia merged 1 commit into
mainfrom
fix/ci-build-version-warning

Conversation

@zcsizmadia

Copy link
Copy Markdown
Collaborator

Found while checking this extension against a freshly built hawser CLI.

The bug

hawser version --json reports 0.0.0-ci on pull-request builds and 0.0.0-dryrun on a release dry run — hawser's release.yml stamps those deliberately to mean "not a release".

The check exempted only the literal string dev:

if (v.app !== 'dev' && compare(v.app, MIN_HAWSER) < 0) {

Both CI markers parse as 0.0.0, which is below every minimum. So anyone testing a CI artifact got "Hawser 0.0.0-ci found; this extension expects 0.3.0 or newer" — when the version only ever meant it was not a release.

The fix

isRelease() also treats a 0.0.0 prefix as not-a-release. Verified against every version string hawser actually emits:

version before after
0.0.0-ci WARN ok ← fixed
0.0.0-dryrun WARN ok ← fixed
dev ok ok
0.3.0-50-g650c25e-dev ok ok
0.3.0 ok ok
0.2.0 WARN WARN
0.2.0-9-gabc-dev WARN WARN

Genuinely old releases still warn. A local source build was already quiet, incidentally — compare splits on - as well as ., so the extra -50-g… segments read as greater than 0.3.0.

The rest of the contract is in sync

I checked the whole CLI coupling against a hawser built from today's main: installed, supervisor, engine, desired, distro?, profile? and version.app are all present and inside their declared unions. Recent hawser changes — a rewritten install refusal message, a new relocate command with its own exit code 12 — touch nothing here, because this extension parses --json only and never scrapes human-readable text.

npm run check and npm run build -- --production both pass locally.

`hawser version --json` reports `0.0.0-ci` on pull-request builds and
`0.0.0-dryrun` on a release dry run -- hawser's release workflow stamps those
deliberately to mean "not a release". The version check exempted only the
literal string `dev`, so both parsed as 0.0.0, compared below every minimum,
and anyone testing a CI artifact was warned their hawser was too old when the
version only ever meant it was not a release.

Replace the `!== 'dev'` test with isRelease(), which also treats a 0.0.0
prefix as not-a-release. Genuinely old releases still warn: 0.2.0 and
0.2.0-9-gabc-dev are unaffected, and a local source build (0.3.0-50-g...-dev)
was already quiet because the comparison splits on "-" as well as "." and so
reads the extra segments as greater.

Found while checking this extension against a freshly built hawser: the CLI
contract itself is unchanged (status/version --json fields all still in their
declared unions), so this was the only drift.
@zcsizmadia
zcsizmadia merged commit ebfa3b7 into main Sep 11, 2026
1 check passed
@zcsizmadia
zcsizmadia deleted the fix/ci-build-version-warning branch September 11, 2026 02:05
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