feat: add workflow output comparison tooling
This commit is contained in:
@@ -15,8 +15,10 @@ from app.domains.rendering.schemas import (
|
||||
WorkflowDefinitionCreate,
|
||||
WorkflowDefinitionUpdate,
|
||||
WorkflowDefinitionOut,
|
||||
WorkflowRunComparisonOut,
|
||||
WorkflowRunOut,
|
||||
)
|
||||
from app.domains.rendering.workflow_comparison_service import build_workflow_run_comparison
|
||||
from app.domains.rendering.workflow_config_utils import canonicalize_workflow_config
|
||||
from app.domains.rendering.workflow_node_registry import (
|
||||
StepCategory,
|
||||
@@ -199,6 +201,18 @@ async def list_workflow_runs(
|
||||
return result.scalars().all()
|
||||
|
||||
|
||||
@router.get("/runs/{run_id}/comparison", response_model=WorkflowRunComparisonOut)
|
||||
async def get_workflow_run_comparison(
|
||||
run_id: uuid.UUID,
|
||||
_user: User = Depends(require_admin_or_pm),
|
||||
db: AsyncSession = Depends(get_db),
|
||||
):
|
||||
comparison = await build_workflow_run_comparison(db, run_id)
|
||||
if comparison is None:
|
||||
raise HTTPException(status_code=404, detail="Workflow run not found")
|
||||
return comparison
|
||||
|
||||
|
||||
class WorkflowDispatchResponse(BaseModel):
|
||||
workflow_run: WorkflowRunOut
|
||||
context_id: str
|
||||
|
||||
Reference in New Issue
Block a user