Add HTML5 object runtime context
CI / python (push) Has been cancelled
CI / rust (push) Has been cancelled

This commit is contained in:
2026-05-17 00:11:26 +03:00
parent 1da745c52e
commit b93fd88e81
3 changed files with 67 additions and 1 deletions
+31 -1
View File
@@ -1747,8 +1747,9 @@ async def html5_project_object_context(project_id: str, object_name: str) -> Res
impact = await get_object_impact(project_id, object_name)
access = await get_object_access(project_id, object_name)
ui = await get_object_ui(project_id, object_name)
runtime = _runtime_for_object_context(project_id, impact)
return Response(
render_html5_object_context(project_id, schema, impact, access, ui),
render_html5_object_context(project_id, schema, impact, access, ui, runtime),
media_type="text/html; charset=utf-8",
)
@@ -8112,6 +8113,35 @@ def _html5_metadata_tabular_sections(raw: str) -> list[dict]:
return sections
def _runtime_for_object_context(project_id: str, impact: ObjectImpactResponse) -> list[RuntimeSummaryResponse]:
lineages = {
item.lineage_id
for group in [
[impact.object],
impact.modules,
impact.routines,
impact.forms,
impact.commands,
impact.jobs,
impact.writes,
]
for item in group
if item is not None
}
snapshot = _project_snapshot_or_404(project_id)
overlay = _overlays.get(project_id, RuntimeOverlay(project_id=project_id))
return [
RuntimeSummaryResponse(
node=_named_node(item.node),
signal_count=item.signal_count,
error_count=item.error_count,
max_duration_ms=item.max_duration_ms,
)
for item in summarize_runtime(snapshot, overlay)
if item.node.lineage_id in lineages
]
def _current_import_source(project_id: str) -> ImportSourceKind:
setup = _project_setup_response(project_id)
if setup.current_source is not None: