Skip to content

[pull] master from cube-js:master - #676

Merged
pull[bot] merged 1 commit into
code:masterfrom
cube-js:master
Aug 20, 2026
Merged

[pull] master from cube-js:master#676
pull[bot] merged 1 commit into
code:masterfrom
cube-js:master

Conversation

@pull

@pull pull Bot commented Aug 20, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

…API (#11592)

* feat(cli): suggest updating the CLI on API errors

API errors are frequently caused by an outdated CLI talking to a newer
API, so the error output now suggests updating the CLI as a possible fix.

- add a shared `ApiError` (with status, url and response body) plus an
  `isApiError` marker-based type guard
- throw it from `CubeCloudClient` requests and from `cubejs typegen`
  instead of a bare `Error`, and include the response body in the message
- pass the caught error into `displayError` from every command so the
  update suggestion is printed under "Need some help?" for API errors
- fix `cubejs typegen` crashing inside its own catch block when the
  failure isn't shaped like `{ error: { error } }` (e.g. network errors)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jv8Ykk5wWXab2KjCsK58vi

* Revert "feat(cli): suggest updating the CLI on API errors"

This reverts commit b2cddfe.

* feat(cube-cli): suggest updating the CLI when a request fails on the API

A CLI that lags the API is a common cause of otherwise puzzling API
errors, so point at `cube update` before the user starts digging.

- add `ApiError`, a marker error type for failures that came from an API
  response (unsuccessful status, or a body the CLI can't make sense of),
  and `is_api_error` to spot it anywhere in an error chain
- return it from the API client and from the OAuth device/refresh flows;
  transport failures (DNS, TLS, connection refused) stay plain errors,
  since an update won't fix those
- print a hint under the error when the failure is an API error, pointing
  at the update notice instead of repeating it when one was just shown
- honor `CUBE_NO_UPDATE_CHECK` for the hint too, and document it

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jv8Ykk5wWXab2KjCsK58vi

* fix(cube-cli): only suggest an update when the CLI is actually behind

Telling someone already on the latest release to update is noise that
teaches them to ignore the hint, so consult the background release check
before offering it.

- turn the check's result into an `UpdateCheck` outcome (newer / up to
  date / disabled / undetermined) instead of a pre-rendered notice, and
  resolve it once for both the notice and the hint
- print no hint when the CLI is current or checks are opted out; name the
  available release when it is behind; suggest looking when the check
  could not complete
- color the hint on a terminal, matching the notice it sits under, and
  keep it plain in piped output
- cover the policy with tests that don't touch env or terminal state

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jv8Ykk5wWXab2KjCsK58vi

* fix(cube-cli): don't make piped runs wait on the release check

Resolving the check moved ahead of both its consumers, so every
non-interactive run paid up to 1.5s for an answer it then discarded: the
notice is interactive-only, and the hint only runs on an API failure. A
piped successful command took 1526ms against an unresponsive release
endpoint, against 28ms with checks opted out.

Await the handle only when something will read it — 24ms on that same
path now, with the notice and all four hint outcomes unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jv8Ykk5wWXab2KjCsK58vi

* fix(cube-cli): print the error before waiting on the release check

Only the hint needs the check's answer, so a slow or blocked GitHub sat
between the user and the reason their command failed — 1521ms of silence
against an unresponsive release endpoint, now 20ms.

The notice moves below the error line on a failing run as a result, which
also puts it directly above the hint that refers back to it. Successful
runs are unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jv8Ykk5wWXab2KjCsK58vi

---------

Co-authored-by: Claude <noreply@anthropic.com>
@pull pull Bot locked and limited conversation to collaborators Aug 20, 2026
@pull pull Bot added the ⤵️ pull label Aug 20, 2026
@pull
pull Bot merged commit 96eaca5 into code:master Aug 20, 2026
3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant