Show last run timestamp on ops automation status
All checks were successful
CI Smoke / host-smoke (push) Successful in 1s
CI Smoke / container-smoke (push) Successful in 5s
Build and Publish Container Image / build-and-push (push) Successful in 1m9s

Expose last_run_at / last_run on the status contract and display Last run
and Tasks columns on the /ops/ui status page for the selected window.
This commit is contained in:
tegwick 2026-07-22 00:16:25 +02:00
parent a304ad7397
commit 6c34e2c1f1
3 changed files with 75 additions and 4 deletions

View file

@ -75,6 +75,28 @@ def test_completed_when_expected_run_exists() -> None:
)
assert report["status"] == "completed"
assert report["last_run_at"] == "2026-06-26T07:00:10+00:00"
assert report["last_run"]["run_id"] == "run-1"
assert report["last_run"]["tasks_spawned"] == 1
def test_last_run_picks_newest_fired_at() -> None:
runs = [
{
"run_id": "older",
"fired_at": "2026-06-26T07:00:00+00:00",
"tasks_spawned": 0,
},
{
"run_id": "newer",
"fired_at": "2026-06-28T07:00:00+00:00",
"tasks_spawned": 2,
},
]
summary = status.latest_run_summary(runs)
assert summary is not None
assert summary["run_id"] == "newer"
assert summary["tasks_spawned"] == 2
def test_validation_failure_wins_over_completed_run() -> None: