Skip to content

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

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

[pull] master from cube-js:master#677
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 : )

…ck (#11595)

* feat(cube-cli): reintroduce `cube validate` as a Cloud data-model check

The old `cubejs validate` compiled the model locally, which meant it could
only ever check what a local checkout plus a local install could express —
not the environment variables, drivers or dependencies the model actually
runs against.

`cube validate <deployment>` instead asks the branch's own Cube runtime for
`GET /cubejs-api/v1/meta`, the same call the console makes in dev mode, via
the new `GET /build/api/v1/deployments/{id}/data-model/validate` endpoint. So
the verdict is by construction the one that branch's API would give, and
naming the branch is what picks the runtime:

  cube validate 42                     # the deploy branch (production)
  cube validate 42 --branch my-branch  # a specific branch
  cube validate 42 --dev-mode          # the active dev-mode working copy

It exits non-zero with the compiler's errors, per file, so it works as a CI
gate; `--json` gives the same report machine-readably.

Ref CUB-3782

* fix(cube-cli): never print a validation failure with nothing to act on

Review of the paired PR. All three are the same shape: the response contract
lives in cubedevinc/cubejs-enterprise and this command ships separately, so an
entry that doesn't match what it expects still has to print as something. A
blank line is the one output `validate` must never produce — printing the
errors IS the command.

- `format_error` renders a bare-string entry as itself and a half-filled
  object as whichever half it has, falling back to the entry's own JSON rather
  than the empty string `output::field` would give for both lookups.
- A response without `branchName` no longer yields "Data model on  is valid":
  it falls back to the branch the caller asked for, or a generic label for
  `--dev-mode`, where the personal `dev-…` name only exists server-side.
- `valid: false` with no errors said "failed to compile:" and then listed
  nothing, followed by "has 0 compilation error(s)". It now says the model
  could not be validated, which points at the runtime — where the answer is.
  Still fails closed: a report this command can't read is not evidence the
  model compiles.

Adds a `validate` row to the README's command table, and unit tests for the
new pure functions.

* fix(cube-cli): don't report an unlistable validation failure twice

The empty-errors path printed a stderr line and then a bail! saying the same
thing, unlike the error-list case where the stderr line heads a list. Keeping
only the bail! leaves one line, and it's the more informative one — it says
the API reported a failure without compilation errors, which is what points
the operator at the runtime rather than the model.

---------

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 efeaee3 into code:master Aug 20, 2026
9 of 11 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