sched: schedule administration API, admitted inspection, occurrence pages (T13)
This commit is contained in:
+26
-5
@@ -337,13 +337,34 @@ class WorkflowRunApi:
|
||||
}
|
||||
|
||||
async def inspect_run(self, *, run_id: str) -> RunResult:
|
||||
"""Return one durable stopped-run summary without debug trace entries.
|
||||
"""Return one durable run summary without debug trace entries.
|
||||
|
||||
Admitted runs with no stopped checkpoint fail closed here (no
|
||||
fabricated trace/output); checkpoint-free inspection arrives with
|
||||
the scheduling administration surface (T13).
|
||||
Admitted runs with no stopped checkpoint report their durable
|
||||
admission truthfully (status admitted, no checkpoint id, no
|
||||
trace slice, output, or interrupt) instead of failing closed;
|
||||
inspection never fabricates checkpoint-derived state.
|
||||
``read_run_trace`` still rejects checkpoint-less runs.
|
||||
"""
|
||||
record, run = load_stored_run(self._run_store(), run_id)
|
||||
store = self._run_store()
|
||||
record = store.get_run(run_id)
|
||||
if record.status is StoredRunStatus.ADMITTED:
|
||||
environment = record.environment
|
||||
try:
|
||||
max_steps = store.get_admission(run_id).max_steps
|
||||
except KeyError:
|
||||
max_steps = None
|
||||
return _run_payload(
|
||||
deployment=environment.deployment,
|
||||
artifact=environment.root_artifact,
|
||||
status=record.status.value,
|
||||
run_id=record.id,
|
||||
resume_readiness=record.resume_readiness.value,
|
||||
diagnostics=record.diagnostics,
|
||||
trace_count=0,
|
||||
max_steps=max_steps,
|
||||
steps_executed=0,
|
||||
)
|
||||
record, run = load_stored_run(store, run_id)
|
||||
environment = record.environment
|
||||
return _run_payload(
|
||||
deployment=environment.deployment,
|
||||
|
||||
Reference in New Issue
Block a user