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:
6 files changed
+78
-4
No files matched your search
@@ -104,6 +104,24 @@ is pinned to is `CORE_VERSION` in `src/template.rs`, and each entry below says w
|
||||
was `TS2868: Cannot find name 'Bun'` — meaning `tsc --noEmit`, and therefore
|
||||
`matcha create --check`, failed on every bun project the CLI has ever scaffolded.
|
||||
|
||||
- **`install.sh` resolves `latest` without the release API.** The API is rate-limited to
|
||||
60 requests an hour per IP unauthenticated — an office behind one NAT or a CI runner
|
||||
burns through it — and a throttled response carries no `tag_name`, so the installer
|
||||
failed with "could not resolve latest release tag" and no hint of the cause. It now
|
||||
follows the `/releases/latest` redirect, which has no such limit and which Gitea
|
||||
implements the same way, keeping the API as the fallback for the wget path. The error
|
||||
that remains names the rate limit and points at `MATCHA_VERSION`.
|
||||
|
||||
- **A beta release is flagged as a prerelease.** Nothing set the flag, so every beta
|
||||
answered `/releases/latest` — which is what `install.sh` resolves when no
|
||||
`MATCHA_VERSION` is given. Harmless while every release is a beta, and wrong the moment
|
||||
a stable one exists: the next beta published after it would displace it for everyone
|
||||
installing with the default.
|
||||
|
||||
- **CI runs `test_install.sh`.** It has existed since the installer landed and no workflow
|
||||
ever ran it. It now runs on Linux and macOS, with `shellcheck` alongside, and covers a
|
||||
third case: an unresolvable `latest` must explain itself and install nothing.
|
||||
|
||||
- **`MIT` is a file, not just a manifest field.** `Cargo.toml` declared `license = "MIT"` and
|
||||
the published crate carried no license text. Added along with the `DCO` the README has been
|
||||
requiring sign-off against, and a `CONTRIBUTING.md` saying how.
|
||||
|
||||
Reference in new issue
Block a user