-
Notifications
You must be signed in to change notification settings - Fork 14.1k
fix: published workflow(tool) can be deleted. #17900
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
Adds a check to prevent deletion of workflows published as tools. Introduces a test suite to ensure proper error handling for workflow deletion, including cases where workflows are drafts, in use by apps, or published as tools. Signed-off-by: -LAN- <[email protected]>
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.
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
api/services/workflow_service.py:519
- [nitpick] Consider introducing a dedicated exception (e.g., WorkflowPublishedToolDeletionError) for workflows published as tools to improve clarity in error handling instead of reusing WorkflowInUseError.
if workflow.tool_published:
api/test_workflow_deletion.py:114
- [nitpick] Consider using an 'in' assertion instead of strict equality for the error message to allow for potential additional context in the exception message.
assert str(excinfo.value) == "Cannot delete workflow that is published as a tool"
Enhances test reliability by using substring assertion for error messages, ensuring that variations in exception details do not cause test failures. Signed-off-by: -LAN- <[email protected]>
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.
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
api/services/workflow_service.py:521
- [nitpick] Consider including the workflow identifier or additional context in the error message to help with troubleshooting.
raise WorkflowInUseError("Cannot delete workflow that is published as a tool")
Signed-off-by: -LAN- <[email protected]>
Summary
Adds a check to prevent deletion of workflows published as tools. Introduces a test suite to ensure proper error handling for workflow deletion, including cases where workflows are drafts, in use by apps, or published as tools.
fixes #17193
Tip
Close issue syntax:
Fixes #<issue number>
orResolves #<issue number>
, see documentation for more details.Screenshots
Checklist
Important
Please review the checklist below before submitting your pull request.
dev/reformat
(backend) andcd web && npx lint-staged
(frontend) to appease the lint gods