Skip to content

fix(otto): translate 404 into actionable platform error#2123

Open
jlaneve wants to merge 2 commits into
mainfrom
fix/otto-unsupported-platform
Open

fix(otto): translate 404 into actionable platform error#2123
jlaneve wants to merge 2 commits into
mainfrom
fix/otto-unsupported-platform

Conversation

@jlaneve

@jlaneve jlaneve commented May 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Customer on 32-bit Windows hit astro otto and got a bare HTTP 404 from https://install.astronomer.io/otto/latest/otto-windows-386.exe.zip with no actionable guidance (Zendesk #91793).

Otto doesn't ship 32-bit binaries because Bun has no 32-bit --compile target — 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:

  • On a 404 from the asset URL, probe /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.
  • If the probe also fails, report the original HTTP 404 verbatim — we don't blame the user for a CDN outage.
  • Other status codes (5xx etc.) pass through unchanged.

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:

Error: setting up otto: otto is not available for windows/386. See https://github.com/astronomer/astro-cli/releases for supported platforms. If you are on 64-bit Windows but installed the 32-bit astro CLI, reinstall the x86_64 build

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/... clean
  • golangci-lint run pkg/otto/... 0 issues

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.
@jlaneve jlaneve requested a review from a team as a code owner May 5, 2026 14:38
@coveralls-official

coveralls-official Bot commented May 5, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 0

Coverage decreased (-0.03%) to 39.717%

Details

  • Coverage decreased (-0.03%) from the base build.
  • Patch coverage: 6 uncovered changes across 1 file (17 of 23 lines covered, 73.91%).
  • 84 coverage regressions across 3 files.

Uncovered Changes

File Changed Covered %
pkg/otto/binary.go 23 17 73.91%

Coverage Regressions

84 previously-covered lines in 3 files lost coverage.

File Lines Losing Coverage Coverage
cmd/cloud/env_var.go 47 64.85%
cmd/cloud/env_airflow_var.go 32 38.89%
cmd/cloud/env_input.go 5 65.0%

Coverage Stats

Coverage Status
Relevant Lines: 65795
Covered Lines: 26132
Line Coverage: 39.72%
Coverage Strength: 9.4 hits per line

💛 - 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.
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