-
Notifications
You must be signed in to change notification settings - Fork 3k
improvement(logs): fixed logs for parallel and loop execution flow #2468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR improves error handling and logging for loop and parallel execution blocks by capturing validation errors at the block level and propagating them to the console and dashboard. Key Changes:
Issues Found:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Executor as DAGExecutor
participant LoopOrch as LoopOrchestrator
participant ParallelOrch as ParallelOrchestrator
participant Utils as SubflowUtils
participant Logger as BlockLog/ContextExtensions
Note over Executor: Execution Flow with Error Handling
Executor->>LoopOrch: setContextExtensions()
Executor->>ParallelOrch: setContextExtensions()
alt Loop Initialization
Executor->>LoopOrch: initializeLoopScope(ctx, loopId)
LoopOrch->>LoopOrch: Get loop config
alt ForEach Loop
LoopOrch->>Utils: resolveArrayInput(items)
Utils-->>LoopOrch: resolved items array
LoopOrch->>Utils: validateMaxCount(items.length, MAX_FOREACH_ITEMS)
alt Validation Fails
Utils-->>LoopOrch: error message
LoopOrch->>Utils: addSubflowErrorLog(ctx, loopId, error)
Utils->>Logger: Create BlockLog with error
Utils->>Logger: Call onBlockComplete with error
LoopOrch->>LoopOrch: Set validationError in scope
LoopOrch-->>Executor: Throw Error
else Validation Passes
Utils-->>LoopOrch: undefined (no error)
LoopOrch->>LoopOrch: Set scope.items and scope.item
end
end
alt For/DoWhile Loop
LoopOrch->>Utils: validateMaxCount(iterations, MAX_LOOP_ITERATIONS)
alt Validation Fails
Utils-->>LoopOrch: error message
LoopOrch->>Utils: addSubflowErrorLog(ctx, loopId, error)
Utils->>Logger: Create BlockLog with error
LoopOrch-->>Executor: Throw Error
end
end
end
alt Parallel Initialization
Executor->>ParallelOrch: initializeParallelScope(ctx, parallelId)
ParallelOrch->>ParallelOrch: Get parallel config
ParallelOrch->>Utils: resolveArrayInput(distribution)
alt Resolution Fails
Utils-->>ParallelOrch: Throw error
ParallelOrch->>Utils: addSubflowErrorLog(ctx, parallelId, error)
Utils->>Logger: Create BlockLog with error
ParallelOrch->>ParallelOrch: setErrorScope with validationError
ParallelOrch-->>Executor: Throw Error
end
ParallelOrch->>Utils: validateMaxCount(branchCount, MAX_PARALLEL_BRANCHES)
alt Validation Fails
Utils-->>ParallelOrch: error message
ParallelOrch->>Utils: addSubflowErrorLog(ctx, parallelId, error)
Utils->>Logger: Create BlockLog with error
ParallelOrch->>ParallelOrch: setErrorScope with validationError
ParallelOrch-->>Executor: Throw Error
end
end
Note over Logger: Errors now propagate to console and dashboard
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5 files reviewed, 1 comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7 files reviewed, 1 comment
…2468) * fixed logs for parallel and loop execution flow * Fix array check for collection * fixed for empty loop and paralle blocks and showing input on dashboard * extracted utility functions * fixed the refrencing errors and making sure it propogates to the console * fix parallel * fix tests' --------- Co-authored-by: priyanshu.solanki <priyanshu.solanki@saviynt.com> Co-authored-by: Siddharth Ganesan <siddharthganesan@gmail.com> Co-authored-by: Vikhyath Mondreti <vikhyath@simstudio.ai>
Summary
Loop/Parallel Block level errors captured.
Type of Change
Testing
Tested with @Sg312
Checklist