ACTIVITY-WP-0044-T02: read freshness-run.v1 results[] from rmgr
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 2s
Build and Publish Container Image / build-and-push (push) Successful in 1m6s

The repo-manager runner reports per-repository rows under results[], not
receipts[]; the projection counted nothing against the real output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Assistant: claude-code
Assistant-Model: opus
Assistant-Process: 692292@bnt-lap001
Assistant-Session: 89c7d8e8-e1b3-47eb-9411-a0ab227fca2f
This commit is contained in:
tegwick 2026-10-04 13:18:33 +02:00
parent d6eb788578
commit b2c6c56132
3 changed files with 29 additions and 10 deletions

View file

@ -94,7 +94,7 @@ def test_invocation_projects_counts_only(monkeypatch):
def fake_run(argv, **kwargs):
calls.append((argv, kwargs["timeout"]))
out = {"receipts": [
out = {"schema": "repo-manager.freshness-run.v1", "results": [
{"repo": "a", "outcome": "applied", "detail": "must not persist"},
{"repo": "b", "outcome": "noop"},
{"repo": "c", "outcome": "refused"},
@ -106,7 +106,7 @@ def test_invocation_projects_counts_only(monkeypatch):
raw = repo_manager.repo_manager_freshness({"limit": 6, "max_seconds": 240, "apply": True})
projected = normalize_operation_result("repo_manager_freshness", raw)
assert calls[0][1] == 240 + repo_manager._TIMEOUT_GRACE_SECONDS
assert projected["receipt_count"] == 4
assert projected["result_count"] == 4
assert projected["outcomes"]["applied"] == 1
assert projected["outcomes"]["noop"] == 1
assert projected["outcomes"]["refused"] == 1
@ -114,6 +114,16 @@ def test_invocation_projects_counts_only(monkeypatch):
assert "must not persist" not in json.dumps(projected)
def test_dry_run_rows_without_outcome_count_nothing():
raw = {"schema": "repo-manager.freshness-run.v1", "dry_run": True,
"results": [{"slug": "a", "action": "reconcile"},
{"slug": "b", "action": "skip_noop"}],
"apply": False, "limit": 2, "max_seconds": 60, "exit_code": 0}
projected = normalize_operation_result("repo_manager_freshness", raw)
assert projected["result_count"] == 2
assert sum(projected["outcomes"].values()) == 0
def test_invocation_fails_on_non_json(monkeypatch):
monkeypatch.setattr(
repo_manager.subprocess, "run",
@ -127,7 +137,7 @@ def test_invocation_fails_on_non_json(monkeypatch):
async def test_execute_bounded_operation_dispatches_to_repo_manager(monkeypatch):
monkeypatch.setattr(
repo_manager, "repo_manager_freshness",
lambda params: {"receipts": [], "apply": False, "limit": 1, "max_seconds": 10},
lambda params: {"results": [], "apply": False, "limit": 1, "max_seconds": 10},
)
patch = await activities.execute_bounded_operation({"source": _source(apply=False)})
assert patch["freshness"]["kind"] == "repo_manager_freshness"