-
Notifications
You must be signed in to change notification settings - Fork 3k
improvement(copilot): add edge handle validation to copilot edit workflow #2448
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile SummaryAdded comprehensive edge handle validation to the copilot edit workflow tool to prevent invalid workflow connections from being created. Key Changes
Impact
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Copilot
participant editWorkflow
participant createValidatedEdge
participant validateSourceHandleForBlock
participant validateConditionHandle
participant validateTargetHandle
participant WorkflowState
Copilot->>editWorkflow: Execute operations (add/edit blocks with connections)
editWorkflow->>editWorkflow: applyOperationsToWorkflowState()
Note over editWorkflow: Process operations in order: delete, extract, add, insert, edit
alt Add/Edit operation with connections
editWorkflow->>createValidatedEdge: Create edge with source/target handles
createValidatedEdge->>WorkflowState: Check if target block exists
alt Target block missing
WorkflowState-->>createValidatedEdge: Block not found
createValidatedEdge->>editWorkflow: Skip edge (log invalid_edge_target)
end
createValidatedEdge->>WorkflowState: Check if source block exists
alt Source block missing
WorkflowState-->>createValidatedEdge: Block not found
createValidatedEdge->>editWorkflow: Skip edge (log invalid_edge_source)
end
createValidatedEdge->>validateSourceHandleForBlock: Validate source handle for block type
alt Block type specific validation
validateSourceHandleForBlock->>validateSourceHandleForBlock: Check block type (loop/parallel/condition/router/default)
alt Condition block
validateSourceHandleForBlock->>validateConditionHandle: Validate condition handle against conditions
validateConditionHandle->>validateConditionHandle: Parse conditions array
validateConditionHandle->>validateConditionHandle: Build valid handles set (condition-{id}, condition-{blockId}-if/else-if/else)
validateConditionHandle-->>validateSourceHandleForBlock: Return validation result
end
validateSourceHandleForBlock-->>createValidatedEdge: Return validation result
end
alt Invalid source handle
createValidatedEdge->>editWorkflow: Skip edge (log invalid_source_handle)
end
createValidatedEdge->>validateTargetHandle: Validate target handle
validateTargetHandle-->>createValidatedEdge: Return validation result
alt Invalid target handle
createValidatedEdge->>editWorkflow: Skip edge (log invalid_target_handle)
end
createValidatedEdge->>WorkflowState: Add validated edge
createValidatedEdge-->>editWorkflow: Return success
end
editWorkflow->>WorkflowState: Return modified workflow state with skipped items
|
Contributor
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.
1 file reviewed, 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds edge handle validation to copilot edit workflow
Type of Change
Testing
Manual
Checklist