Skip to content

Add GET /status Endpoint for Deployment Queue State #35

@adarshm11

Description

@adarshm11

Summary

There is currently no way to query the live state of the deployment server without reading logs. Adding a GET /status endpoint would expose which repos have active workers, whether queues are backed up, and the last deployment result for each repo.

Problem

When something goes wrong (e.g. a deployment is stuck or a queue is growing), there is no quick way to inspect the server state without ssh-ing in and tailing logs. A lightweight status endpoint would make it easy to check from a browser, curl, or a monitoring script.

Proposed Solution

Add a GET /status endpoint that returns a JSON snapshot of the current server state:

{
  "repos": {
    "my-repo/main": {
      "worker_active": true,
      "queue_depth": 2,
      "last_deployment": {
        "status": "success",
        "commit": "abc1234",
        "timestamp": "2026-03-24T10:15:00Z"
      }
    }
  }
}

Implementation notes:

  • Worker thread state is already tracked in the workers dict — queue_depth can be derived from the existing Queue object.
  • last_deployment can be stored in a small in-memory dict keyed by repo/branch, updated at the end of each worker run.
  • No persistence needed — state resets on server restart.

Acceptance Criteria

  • GET /status returns 200 OK with a JSON body
  • Response includes each configured repo/branch, whether a worker is active, and queue depth
  • Response includes the status, commit hash, and timestamp of the most recent completed deployment per repo
  • Endpoint is documented in the README

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions