Skip to content

feat: add RuntimeStatus for per-component runtime status - #76

Open
claudespice wants to merge 3 commits into
spiceai:trunkfrom
claudespice:feat/runtime-status
Open

feat: add RuntimeStatus for per-component runtime status#76
claudespice wants to merge 3 commits into
spiceai:trunkfrom
claudespice:feat/runtime-status

Conversation

@claudespice

Copy link
Copy Markdown
Contributor

What

Adds RuntimeStatus(ctx), wrapping GET /v1/status. It returns a
[]ConnectionDetails — one entry per runtime connection (http, flight,
metrics, opentelemetry) with that component's endpoint and status.

Why

IsSpiceReady reduces the whole runtime to one boolean, so when it returns
false there is no way to find out which component is not ready without
hand-rolling an HTTP call. /v1/status reports that per component, and no
Spice SDK currently exposes it — this is the first.

Statuses map to the runtime's ComponentStatus: Initializing, Ready,
Disabled, Error, Refreshing, ShuttingDown, NotLoaded. The endpoint
needs no cluster mode or extra configuration, so this works on a default
spice run.

Part of aligning runtime health/status coverage across the Spice SDKs.

Verification

  • go build ./...
  • go vet ./...
  • go test -run 'TestRuntimeStatus|TestConnectionDetailsIsReady' ./... — new unit tests pass
  • gofmt -l . clean
  • Integration tests — not run (no live runtime available in this environment)

The new tests are hermetic: they stand up an httptest server rather than
requiring spice run, so they cover the decode path, the non-200 path, and the
malformed-body path in CI without external services.

Wraps GET /v1/status, which reports the state of each runtime connection
(http, flight, metrics, opentelemetry) individually. IsSpiceReady already
covers the boolean case but cannot say which component is not ready.

Adds hermetic httptest-based unit tests so the new path is covered without
a live runtime.
@lukekim
lukekim requested a review from Copilot July 26, 2026 01:03
@lukekim lukekim self-assigned this Jul 26, 2026
@lukekim lukekim added the enhancement New feature or request label Jul 26, 2026
@lukekim lukekim added this to the v8.0.0 milestone Jul 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new public RuntimeStatus(ctx) API to the Go Spice client to expose per-component runtime connection status via GET /v1/status, complementing the existing boolean-only readiness check.

Changes:

  • Introduces RuntimeStatus(ctx) plus ComponentStatus and ConnectionDetails (with IsReady()) for per-connection status reporting.
  • Adds hermetic unit tests using httptest to validate decoding and error paths.
  • Documents the new API and shows example output/usage in the README.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
status.go Adds types for component status + a RuntimeStatus method that calls /v1/status and decodes connection details.
status_test.go Adds hermetic tests for success, non-200, and malformed JSON response handling, plus IsReady() behavior.
README.md Documents RuntimeStatus usage and explains how it differs from IsSpiceReady.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread status.go
The non-200 error carried only the numeric code, so a caller had to decode
401 vs 500 themselves. Include http.StatusText so the message is actionable
on its own.
@claudespice

Copy link
Copy Markdown
Contributor Author

Status note: this PR shows zero checks — not green, just never run. The Go workflow run for the current head 285d359a sits at action_required since 2026-07-28T00:18Z (30316904707): fork PRs need a maintainer to approve the run before it executes. That approval, plus a first review, are the only outstanding items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants