fix(otto): translate 404 into actionable platform error#2123
Open
jlaneve wants to merge 2 commits into
Open
Conversation
Customers on platforms Otto doesn't publish binaries for (most commonly 32-bit Windows, since Bun has no 32-bit --compile target) hit a bare "HTTP 404 from <url>" with no guidance on what to do. Probe /latest/version to distinguish "we don't ship this platform" from "the CDN is down" and rewrite the former into a clear message pointing at supported platforms, including the common case of a 64-bit Windows user who installed the 32-bit astro CLI by mistake.
Coverage Report for CI Build 0Coverage decreased (-0.03%) to 39.717%Details
Uncovered Changes
Coverage Regressions84 previously-covered lines in 3 files lost coverage.
Coverage Stats
💛 - Coveralls |
…hint - Extract versionURL constant and reuse it from LatestVersion() so the /latest/version path has one source of truth. - HEAD instead of GET for the probe — we never read the body. - Show the 32-bit-CLI-on-64-bit-Windows hint only when GOOS is windows; it's confusing for a Linux user on an unsupported arch. - Trim doc comments back to load-bearing WHY (sibling private helpers use 1-3 lines; the originals were 6). - Drop test comments that narrated the customer ticket and design rationale — the test names + assertions carry the meaning.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Customer on 32-bit Windows hit
astro ottoand got a bareHTTP 404 from https://install.astronomer.io/otto/latest/otto-windows-386.exe.zipwith no actionable guidance (Zendesk #91793).Otto doesn't ship 32-bit binaries because Bun has no 32-bit
--compiletarget — and won't anytime soon, since JavaScriptCore (Bun's underlying engine) dropped 32-bit Windows years ago. So this is a permanent platform gap, not a missing build.This PR makes the failure mode useful instead of cryptic:
/latest/version(a tiny static file published with every release) to confirm the CDN itself is reachable. If yes, the 404 is structurally an unsupported-platform error — rewrite it into a message that names the platform and points at the astro-cli releases page for supported builds, plus a hint about the common 64-bit-Windows-with-32-bit-CLI case.HTTP 404verbatim — we don't blame the user for a CDN outage.Deliberately did not hardcode the supported-platform list in astro-cli — that would create a second source of truth that drifts the moment Otto adds or drops a build target. The CDN itself is the source of truth: if a binary isn't there, it's not supported.
Sample output for the customer's case:
Test plan
go test ./pkg/otto/...— all green, including 3 new cases for the 404 classifier (unsupported platform, CDN down, non-404 status)go vet ./pkg/otto/...cleangolangci-lint run pkg/otto/...0 issues