fix(ci): queue-age metric resets when the queue drains (Forgejo returns null) #92
Loading…
Reference in a new issue
No description provided.
Delete branch "jfraeys/fix/queue-metrics-null-queue"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug in #85, found while verifying it on production: GET /admin/runners/jobs answers an empty queue with 200 and a JSON null, not []. queue_metrics() only updated its state for a list, so after a job queued and then drained, its first-seen time stayed in queue-seen.json forever and oldest_queued_job_age_seconds would climb until CIEphemeralJobsWaitingTooLong fired falsely after 40 minutes. Not triggered yet on production (the queue has been empty since the deploy).
Treat 200 + null as an empty queue. My original test mocked [] and missed this; the new check runs the real shape: job queued 50 min -> 3000, drained (null) -> 0, a 429 still keeps the previous state.
Takes effect on the next deploy of the ci_ephemeral_provisioner role: scripts/deploy-services.sh --tags ci_ephemeral_provisioner --limit services.
🤖 Generated with Claude Code