• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

astronomer / astro-cli / 38993389548
45%

Build:
DEFAULT BRANCH: main
Ran 17 Oct 2026 02:04AM UTC
Jobs 1
Files 218
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

17 Oct 2026 02:03AM UTC coverage: 45.042% (+0.03%) from 45.009%
38993389548

push

github

web-flow
fix(otto): preflight org membership before launching Otto (AI-992) (#2208)

* fix(otto): preflight org membership before launching Otto (AI-992)

`astro otto` could spawn Otto with a token whose user isn't a member of
ASTRO_ORGANIZATION — e.g. a stale ASTRO_ORGANIZATION export, or an org
selected under a different login. The mismatch was invisible at launch (the
LLM gateway isn't RBAC-gated) and only surfaced later as a confusing
"403: organization <id> is forbidden" on the first org-scoped call (hosted
skills).

Add a launch-time membership preflight in pkg/otto:

- Resolve the effective org the way BuildEnv does (context org, else the
  inherited ASTRO_ORGANIZATION that passes through when the context org is
  empty) and call GetOrganization with the current token.
- On a definitive 403/404, fail fast with actionable guidance that names the
  signed-in user (astro login / astro organization switch / clear a stale
  export), and exit quietly like ErrNotLoggedIn.
- Fail CLOSED only on 403/404; any transient or inconclusive outcome
  (request error, 5xx, unexpected shape) lets the launch proceed so the
  preflight can never become a new way for `astro otto` to break.

Adds pkg/otto/preflight_test.go covering member/403/404, the inherited-env
org path, self-user lookup failure, skip-when-no-org/token, and fail-open.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Never block an API token, bound the preflight, and name the org's source

- A 403/404 blocks only a login the self-user lookup can name. An API
  token reaches an organization by its own grants rather than
  membership, so a workspace- or deployment-scoped token that cannot
  read its organization is no longer locked out of Otto. A self-user
  lookup that fails now lets the launch proceed instead of blocking
  with a generic subject.
- Both calls run under a 5s deadline instead of the HTTP client's 30s,
  and the preflight is skipped for --help and --version, which need no
  organiz... (continued)

46 of 58 new or added lines in 3 files covered. (79.31%)

1 existing line in 1 file now uncovered.

27184 of 60352 relevant lines covered (45.04%)

9.8 hits per line

Uncovered Changes

Lines Coverage ∆ File
5
90.2
pkg/otto/preflight.go
4
0.0
0.0% pkg/otto/start.go
3
18.46
-0.89% cmd/otto.go

Coverage Regressions

Lines Coverage ∆ File
1
18.46
-0.89% cmd/otto.go
Jobs
ID Job ID Ran Files Coverage
1 38993389548.1 17 Oct 2026 02:04AM UTC 218
45.04
GitHub Action Run
Source Files on build 38993389548
  • Tree
  • List 218
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #38993389548
  • a7e027ca on github
  • Prev Build on main (#38992534827)
  • Next Build on main (#39046451526)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc