Add read-only /api/v1/instances endpoint exposing deployed commit #125

Merged
hannah-vernon merged 1 commit from feature/read-only-instances-endpoint into dev 2026-09-21 18:03:49 -05:00
Owner

What does this PR do?

Adds a read-only GET /api/v1/instances endpoint that exposes the deployed version and commit per registered instance, the same data the Admin UI Instances view shows. The handler reads the instance registry (D-0037) and the latest queue telemetry and folds them through the shared QueueStatusView.Build, so the API and UI derive identical rows: instanceId, full version, nullable commitSha, a nine-character shortCommit, roles, hostName, nullable upgradeTarget, startedAt, reportedAt, queuesReported, nullable lastCapturedAt, and a stalenessLight traffic light.

This makes deployment verification self-service: trusted automation can read the live deployed commit instead of scraping the Instances page. It amends D-0040 (read-only API); no schema change (read-only over existing stores).

Fixes #

How was this tested?

  • dotnet build - 0 errors, 0 warnings
  • dotnet test - all tests pass (935 total, +1 new AdminApi handler test)
  • Manually tested on ___ (to be verified live once deployed)

Checklist

  • I have read the Contributing Guide
  • Changes are focused - one logical change per PR
  • Documentation updated (README.md / DECISIONS.md / TODO.md / AGENT-README.md, if applicable)
  • New dependencies are MIT/Apache-2.0/BSD, security-vetted, and recorded in THIRD-PARTY-NOTICES.md
  • No secrets, credentials, or real infrastructure identifiers in the diff
  • No commented-out code or debug leftovers
## What does this PR do? Adds a read-only `GET /api/v1/instances` endpoint that exposes the deployed version and commit per registered instance, the same data the Admin UI Instances view shows. The handler reads the instance registry (D-0037) and the latest queue telemetry and folds them through the shared `QueueStatusView.Build`, so the API and UI derive identical rows: `instanceId`, full `version`, nullable `commitSha`, a nine-character `shortCommit`, `roles`, `hostName`, nullable `upgradeTarget`, `startedAt`, `reportedAt`, `queuesReported`, nullable `lastCapturedAt`, and a `stalenessLight` traffic light. This makes deployment verification self-service: trusted automation can read the live deployed commit instead of scraping the Instances page. It amends D-0040 (read-only API); no schema change (read-only over existing stores). Fixes # ## How was this tested? - [x] `dotnet build` - 0 errors, 0 warnings - [x] `dotnet test` - all tests pass (935 total, +1 new AdminApi handler test) - [ ] Manually tested on ___ (to be verified live once deployed) ## Checklist - [x] I have read the [Contributing Guide](../CONTRIBUTING.md) - [x] Changes are focused - one logical change per PR - [x] Documentation updated (README.md / DECISIONS.md / TODO.md / AGENT-README.md, if applicable) - [x] New dependencies are MIT/Apache-2.0/BSD, security-vetted, and recorded in THIRD-PARTY-NOTICES.md - [x] No secrets, credentials, or real infrastructure identifiers in the diff - [x] No commented-out code or debug leftovers
Expose the deployed version and commit per registered instance over the
read-only API, the same data the Admin UI Instances view shows.  The
handler reads the instance registry (D-0037) and the latest queue
telemetry and folds them through the shared QueueStatusView.Build, so the
API and UI derive identical rows (version, commit, roles, host, queues
reported, last capture, staleness light).  This makes deployment
verification self-service instead of requiring the Instances page.

Amends D-0040 (read-only API); no schema change.  Documents the endpoint
in docs/read-only-api.md and adds an AdminApi handler test.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
hannah-vernon/viegard-sentinel!125
No description provided.