STATE-WP-0072: progress reporter uses workplan_id
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 2s

POST /progress/ with workplan_id only; keep workstream_id param as
deprecated CLI alias for backward compatibility.
This commit is contained in:
tegwick 2026-07-09 01:48:53 +02:00
parent 7fb9b2b926
commit 1eb9b250be
2 changed files with 10 additions and 4 deletions

View file

@ -12,7 +12,11 @@ from wisevalidator.models import RunResult
STATE_HUB_URL = os.environ.get("STATE_HUB_URL", "http://127.0.0.1:8000")
def report(result: RunResult, workstream_id: str | None = None) -> bool:
def report(
result: RunResult,
workplan_id: str | None = None,
workstream_id: str | None = None,
) -> bool:
"""POST result to state-hub /progress/. Returns True on success."""
body = {
"event_type": "e2e_result",
@ -35,8 +39,9 @@ def report(result: RunResult, workstream_id: str | None = None) -> bool:
"details": json.dumps(body),
"event_type": "e2e_result",
}
if workstream_id:
payload["workstream_id"] = workstream_id
scope_id = workplan_id or workstream_id
if scope_id:
payload["workplan_id"] = scope_id
try:
req = urllib.request.Request(

View file

@ -34,4 +34,5 @@ def test_report_posts_e2e_result() -> None:
assert captured["url"].endswith("/progress/")
assert captured["body"]["event_type"] == "e2e_result"
assert "PASSED" in captured["body"]["summary"]
assert captured["body"]["workstream_id"] == "ws-uuid"
assert captured["body"]["workplan_id"] == "ws-uuid"
assert "workstream_id" not in captured["body"]