feat: add RuntimeStatus for per-component runtime status - #76
Open
claudespice wants to merge 3 commits into
Open
feat: add RuntimeStatus for per-component runtime status#76claudespice wants to merge 3 commits into
claudespice wants to merge 3 commits into
Conversation
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.
There was a problem hiding this comment.
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)plusComponentStatusandConnectionDetails(withIsReady()) for per-connection status reporting. - Adds hermetic unit tests using
httptestto 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.
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.
Contributor
Author
|
Status note: this PR shows zero checks — not green, just never run. The |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Adds
RuntimeStatus(ctx), wrappingGET /v1/status. It returns a[]ConnectionDetails— one entry per runtime connection (http,flight,metrics,opentelemetry) with that component's endpoint and status.Why
IsSpiceReadyreduces the whole runtime to one boolean, so when it returnsfalse there is no way to find out which component is not ready without
hand-rolling an HTTP call.
/v1/statusreports that per component, and noSpice SDK currently exposes it — this is the first.
Statuses map to the runtime's
ComponentStatus:Initializing,Ready,Disabled,Error,Refreshing,ShuttingDown,NotLoaded. The endpointneeds 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 passgofmt -l .cleanThe new tests are hermetic: they stand up an
httptestserver rather thanrequiring
spice run, so they cover the decode path, the non-200 path, and themalformed-body path in CI without external services.