Update DropAllData mutation to delete new entities#1839
Conversation
- Added deletion logic for `ShellTask`, `Portal`, `Link`, `Tome`, `Asset`, and `Repository` in `DropAllData` resolver. - Ensured correct deletion order to satisfy Foreign Key constraints. - Updated `DropsData` test case with SQL INSERTs for the new entities to verify successful deletion. Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Summary
Previous Results
Insights
Slowest Tests
🎉 No failed tests in this run. | 🍂 No flaky tests in this run. Github Test Reporter by CTRF 💚 🔄 This comment has been updated |
| if _, err := client.Asset.Delete().Exec(ctx); err != nil { | ||
| return false, rollback(tx, fmt.Errorf("failed to delete assets: %w", err)) | ||
| } | ||
| if _, err := client.Repository.Delete().Exec(ctx); err != nil { |
There was a problem hiding this comment.
Don't delete repositories or assets in this method
There was a problem hiding this comment.
I have removed the deletion of repositories and assets as requested. The mutation will now only delete ShellTasks, Portals, Links, Tomes, and the other previously existing entities.
- Added deletion logic for `ShellTask`, `Portal`, `Link`, and `Tome` in `DropAllData` resolver. - Ensured correct deletion order to satisfy Foreign Key constraints. - Updated `DropsData` test case with SQL INSERTs for the new entities (including repositories and assets) to verify successful deletion of targets and preservation of non-targets. - Removed deletion of `Repository` and `Asset` based on code review feedback. Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>
| if _, err := client.Link.Delete().Exec(ctx); err != nil { | ||
| return false, rollback(tx, fmt.Errorf("failed to delete links: %w", err)) | ||
| } | ||
| if _, err := client.Tome.Delete().Exec(ctx); err != nil { |
There was a problem hiding this comment.
Don't delete tomes either
There was a problem hiding this comment.
I have removed the deletion of Tomes as well, as requested.
- Added deletion logic for `ShellTask`, `Portal`, and `Link` in `DropAllData` resolver. - Ensured correct deletion order to satisfy Foreign Key constraints. - Updated `DropsData` test case with SQL INSERTs for the new entities (including repositories, assets, and tomes) to verify successful deletion of targets and preservation of non-targets. - Removed deletion of `Repository`, `Asset`, and `Tome` based on code review feedback. Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>
This PR updates the
DropAllDataGraphQL mutation to include the deletion of recently added entities:ShellTask,Portal,Link,Tome,Asset, andRepository. It ensures that these entities are deleted in the correct order to prevent Foreign Key constraint violations. The corresponding test caseDropsData.ymlhas been updated to include instances of these new entities, verifying that the mutation can successfully clear the database state including them.PR created automatically by Jules for task 3027093438674069796 started by @KCarretto