Adding job rollups to testflinger-cli queue-status
A CLI change for Testflinger that folds job counts into queue-status, with a verbose mode that lists individual job IDs and a JSON mode that keeps existing consumers working.
Testflinger is the broker that sits between CI and a hardware lab. The CLI is what most people use to drive it day to day. Until #774 (merged today), testflinger-cli queue-status <queue> only showed agent counts, so to find out what jobs were waiting or running on the queue you had to run a second status command per job ID. This post is the technical write-up. Closes #116.
What was wrong before
queue-status answered half the question. It told you how many agents the queue had and which of them were available, busy, or offline, but it did not tell you what the queue itself was holding. To find out you went looking in the dashboard or paged through individual job IDs.
What the change does
queue-status now folds the job counts into the same call:
$ testflinger-cli queue-status my-queue
Agents in queue: 1
Available: 1
Busy: 0
Offline: 0
Jobs waiting: 1
Jobs running: 0
Jobs completed: 2
A new --verbose flag prints the job IDs themselves with their submission timestamps, grouped by status:
$ testflinger-cli queue-status --verbose my-queue
…
Waiting:
de153d8f-7d32-47d7-9a05-a20f2ef6bb35 - 2023-10-13 15:22:46
Completed:
8b0bb52f-08d8-4671-b275-55d84a965f7c - 2023-10-13 15:22:30
--json gets the same job-status keys without removing the existing agent-status keys, so anything parsing it already keeps working.
Implementation
The PR uses the existing /v1/queues/{queue}/agents and /v1/queues/{queue}/jobs endpoints — no API changes. The CLI calls both, groups the jobs by their server-side status, and renders either the rollup, the verbose list, or the JSON payload depending on the flags.
Important Links
- The PR:
#774(merged 27 Aug 2025). - Closes:
#116. - Repo:
canonical/testflinger· docs.