Skip to content

refactor(cli): extract pickCLIRelease and drop dead normalizeOS#4116

Merged
esengine merged 1 commit into
main-v2from
fix/upgrade-skip-prerelease
Jun 12, 2026
Merged

refactor(cli): extract pickCLIRelease and drop dead normalizeOS#4116
esengine merged 1 commit into
main-v2from
fix/upgrade-skip-prerelease

Conversation

@esengine

@esengine esengine commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Follow-up to #4005 — cleanup only, no behavior change.

reasonix upgrade deliberately tracks the newest 1.x release, including rc. Rationale (verified 2026-06-12):

  • Only 1.x builds carry the upgrade command, so a 0.5x user never reaches this path — there's no legacy-stable user to protect.
  • The 1.x line ships as rc on npm @next (@latest is frozen at the deprecated 0.53.2); brew/GitHub relabel the same content as stable v1.6.0. So for the people who can run upgrade, "the latest 1.x" is the rc/@next line — they should always move to the newest 1.x, not be held on an older stable.

#4005 already picked the newest v* release regardless of the prerelease flag; this PR keeps that and just tidies up:

  • Extract the selection into a pure pickCLIRelease (foreign desktop-v/npm-v tags skipped) and unit-test it without a network call — including a case that locks in "a newer rc wins", so nobody re-adds a prerelease skip by mistake.
  • Remove normalizeOS, a no-op that returned runtime.GOOS unchanged behind a multi-line comment (real assets are reasonix-<goos>-<goarch>).

Note: the namespace filter is load-bearing — GitHub's latest=true badge is currently on desktop-v1.6.0, so listing /releases + skipping foreign namespaces is what reaches the CLI's v1.6.0.

@esengine esengine requested a review from SivanCola as a code owner June 12, 2026 03:50
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development tui Terminal UI / CLI (internal/cli, internal/control) labels Jun 12, 2026
`reasonix upgrade` deliberately tracks the newest 1.x, including rc: only 1.x
carries this command and the 1.x line ships as rc on npm @next, so there is no
stable user to hold back — the original #4005 already picked the newest v*
release regardless of the prerelease flag, and that stays.

Extract the selection into a pure pickCLIRelease (foreign desktop-v/npm-v tags
skipped) and unit-test it without a network round-trip, including a case that
locks in "a newer rc wins". Remove normalizeOS, a no-op returning runtime.GOOS
unchanged behind a multi-line comment; real assets are reasonix-<goos>-<goarch>.
No behavior change.
@esengine esengine force-pushed the fix/upgrade-skip-prerelease branch from 324228c to 8020f04 Compare June 12, 2026 03:59
@esengine esengine changed the title fix(cli): track the stable channel in self-update (skip prereleases) refactor(cli): extract pickCLIRelease and drop dead normalizeOS Jun 12, 2026
@esengine esengine merged commit 2fa3a57 into main-v2 Jun 12, 2026
14 checks passed
@esengine esengine deleted the fix/upgrade-skip-prerelease branch June 12, 2026 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tui Terminal UI / CLI (internal/cli, internal/control) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant