feat(ui): each run says who or what started it; run detail without ids (#5212)
#5212 "Plain labels: no raw ids, scopes, metric keys or unexplained jargon", batch 2: - A run records where it came from: AnsibleRun.origin ("schedule", "alert" or "mcp") and origin_id, set by the scheduler, Run now, alert actions and the MCP tools. Migration 0031 backfills past runs from alert events, schedules' last runs, and MCP audit entries. - The runs list has a Started by column: "schedule nightly", "alert rule nas down", "alice via MCP" or "alice", linked where there is a page. The raw scope tooltip is gone. - Run detail: no run id in the subtitle or body, Started by in words, and the host summary lists failed and unreachable hosts first. The live output only follows new lines while the reader is at the bottom, and when the run finishes the page reloads once so the badge and summary are final. - list_ansible_runs and get_ansible_run report origin and origin_id. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -111,6 +111,7 @@ def test_firing_triggers_ansible_action(app, tmp_path):
|
||||
run, event = asyncio.run(_go())
|
||||
assert run is not None, "no AnsibleRun was created by the firing rule"
|
||||
assert run.triggered_by is None # system-triggered
|
||||
assert run.origin == "alert" and run.origin_id == event.rule_id # the runs list names the rule (#5212)
|
||||
assert run.status == AnsibleRunStatus.success, run.output
|
||||
assert "FIRED-cpu_pct" in (run.output or "") # injected context var reached the play
|
||||
assert event.ansible_run_id == run.id # firing event linked to the run
|
||||
|
||||
Reference in New Issue
Block a user