fix: delete knowledge pipeline but pipeline and workflow don't delete#29591
fix: delete knowledge pipeline but pipeline and workflow don't delete#29591
Conversation
Summary of ChangesHello @JohnJyong, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves an issue where deleting a knowledge pipeline did not correctly remove its corresponding pipeline and workflow entries from the system. The changes introduce a mechanism to cascade these deletions, ensuring that all related components are cleaned up when a dataset is removed. This improves data integrity and system hygiene by preventing stale or orphaned records. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request fixes an issue where deleting a knowledge pipeline did not delete the associated pipeline and workflow records. The changes involve passing the pipeline_id to the cleanup task and adding logic to delete the Pipeline and Workflow entities. A comprehensive test suite has also been added for the cleanup task.
My review identifies a critical logical issue in the new deletion logic. The code attempts to find a Workflow by comparing its app_id with the pipeline_id, which is likely incorrect and could lead to not deleting the workflow or deleting the wrong one. I've provided a suggestion to fix this by first fetching the pipeline to get its associated app_id and then using that to correctly identify and delete the workflow before deleting the pipeline itself.
…#29591) Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Important
Fixes #<issue number>.Summary
fix:delete knowledge pipeline but pipeline and workflow don't delete
Screenshots
Checklist
dev/reformat(backend) andcd web && npx lint-staged(frontend) to appease the lint gods