fix(install): resolve latest without the rate-limited API, and test the installer

`install.sh` asked the release API for the latest tag. That API allows 60
requests an hour per IP without a token, which one office behind a NAT or a CI
runner exhausts — and a throttled response has no `tag_name`, so the installer
reported "could not resolve latest release tag" and gave no hint that rate
limiting was the cause. It now follows the `/releases/latest` redirect, which
carries no such limit and which Gitea implements identically, and keeps the API
as the fallback for the wget path that cannot read the effective URL. Verified
against the real release: resolves v26.8.0-beta.0, verifies the checksum, and
the installed binary runs.

Releases with a hyphen in the tag are now flagged as prereleases. Nothing set
the flag, so every beta answered `/releases/latest` — the very thing the
installer resolves by default. That is harmless while every release is a beta
and wrong the moment a stable one exists, because the next beta published after
it would silently displace it for everyone installing without MATCHA_VERSION.

`test_install.sh` has existed since the installer landed and no workflow ever
ran it — the same shape as the starter gap: a check that exists, passes, and
guards nothing. CI runs it now on Linux and macOS with shellcheck alongside, and
it covers a third case, since the branch this commit changes fails by producing
a message: an unresolvable `latest` must name MATCHA_VERSION and must leave no
binary behind.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
chrnx committed 2026-09-05 16:12:36 -05:00
1 parent 5c8f72b409
commit 88090f34a2
6 files changed
+78 -4

No files matched your search

+2 -1
View File
@@ -154,7 +154,8 @@ the alias can go once that is fixed.
```bash
cargo test # unit + CLI integration
scripts/starter-smoke.sh node # scaffold, install, type-check, boot, introspect
scripts/starter-smoke.sh deno # (also bun) — needs that runtime installed
scripts/starter-smoke.sh deno # (also bun, edge) — needs that runtime installed
./test_install.sh # install.sh against a file:// fixture, no network
```
`starter-smoke.sh` is the check that `cargo test` cannot be: `cargo test` proves