fix(e7): CI-Gate-Vorbereitung — ruff über app/ von 105 auf 0 Findings bereinigt; 8 echte F821-NameError-Produktionsbugs behoben (external_api stream_chat-Call-Signatur an stream_chat_comm angepasst, agent_runner uuid vor lokalem Import, automation/plugin UserTenant-Import, tasks delete-audit user_id, workflows/engine timedelta, unified_search/contracts Any); py311-kompatibles StepHandler-Alias statt type-Statement; E402/F841 bereinigt; Verifikation 85/89 grün (4 Failures = bekannter Vorbestand BUG-099)
Check Cross-Plugin Imports / check (push) Has been cancelled
Check Cross-Plugin Imports / check (push) Has been cancelled
This commit is contained in:
+11
-7
@@ -173,7 +173,6 @@ async def create_instance(
|
||||
"""Create a new workflow instance."""
|
||||
tenant_id = uuid.UUID(current_user["tenant_id"])
|
||||
user_id = uuid.UUID(current_user["user_id"])
|
||||
is_admin = current_user.get("is_system_admin", False)
|
||||
|
||||
try:
|
||||
result = await workflow_service.create_instance(
|
||||
@@ -304,10 +303,11 @@ async def resume_instance(
|
||||
"""Resume a waiting workflow instance (e.g. after wait timer expired)."""
|
||||
tenant_id = uuid.UUID(current_user["tenant_id"])
|
||||
|
||||
from app.workflows.engine import WorkflowEngine
|
||||
from app.models.workflow import WorkflowInstance
|
||||
from sqlalchemy import select
|
||||
|
||||
from app.models.workflow import WorkflowInstance
|
||||
from app.workflows.engine import WorkflowEngine
|
||||
|
||||
result = await db.execute(
|
||||
select(WorkflowInstance).where(
|
||||
WorkflowInstance.id == uuid.UUID(instance_id),
|
||||
@@ -375,9 +375,10 @@ async def webhook_trigger(
|
||||
db: AsyncSession = Depends(get_db),
|
||||
):
|
||||
"""Incoming webhook trigger — starts a workflow via secure token."""
|
||||
from app.models.webhook import Webhook
|
||||
from sqlalchemy import select
|
||||
|
||||
from app.models.webhook import Webhook
|
||||
|
||||
result = await db.execute(
|
||||
select(Webhook).where(
|
||||
Webhook.token == token,
|
||||
@@ -423,9 +424,10 @@ async def get_instance_history(
|
||||
"""Get step history for a workflow instance (execution log)."""
|
||||
tenant_id = uuid.UUID(current_user["tenant_id"])
|
||||
|
||||
from app.models.workflow import WorkflowStepHistory
|
||||
from sqlalchemy import select
|
||||
|
||||
from app.models.workflow import WorkflowStepHistory
|
||||
|
||||
result = await db.execute(
|
||||
select(WorkflowStepHistory)
|
||||
.where(
|
||||
@@ -472,9 +474,10 @@ async def approve_workflow_step(
|
||||
body = {}
|
||||
comment = body.get("comment", "")
|
||||
|
||||
from sqlalchemy import select
|
||||
|
||||
from app.core.approval import create_approval_request, resolve_approval_request
|
||||
from app.models.workflow import WorkflowInstance
|
||||
from sqlalchemy import select
|
||||
|
||||
result = await db.execute(
|
||||
select(WorkflowInstance).where(
|
||||
@@ -535,9 +538,10 @@ async def reject_workflow_step(
|
||||
body = {}
|
||||
comment = body.get("comment", "")
|
||||
|
||||
from sqlalchemy import select
|
||||
|
||||
from app.core.approval import create_approval_request, resolve_approval_request
|
||||
from app.models.workflow import WorkflowInstance
|
||||
from sqlalchemy import select
|
||||
|
||||
result = await db.execute(
|
||||
select(WorkflowInstance).where(
|
||||
|
||||
Reference in New Issue
Block a user