-
Notifications
You must be signed in to change notification settings - Fork 636
fix: some issues with soft_delete #3657
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
base: master
Are you sure you want to change the base?
fix: some issues with soft_delete #3657
Conversation
|
/gemini review |
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.
Code Review
This pull request effectively addresses issues with sketch deletion by introducing index closing on soft delete and allowing admins to force-delete already soft-deleted sketches. The changes are well-implemented across the API, client, and database models. The accompanying e2e tests are thorough and provide good coverage for the new functionality. The documentation updates are also clear and will be very helpful for users. I have a few minor suggestions to improve maintainability and robustness.
| es = opensearchpy.OpenSearch( | ||
| [ | ||
| { | ||
| "host": interface.OPENSEARCH_HOST, | ||
| "port": interface.OPENSEARCH_PORT, | ||
| } | ||
| ], | ||
| http_compress=True, | ||
| ) |
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.
| sketch.id, | ||
| e, | ||
| ) | ||
| db_session.commit() |
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.
|
Multiple errors like: |
|
#3659 filed for the plaso error |
|
Closing OpenSearch Indices on Soft Delete:
SketchResource.deleteintimesketch/api/v1/resources/sketch.pyto close all associated OpenSearch indices when a sketch is soft-deleted. This saves cluster resources.Allowing Force Deletion of Soft-Deleted Sketches:
get_with_aclintimesketch/models/__init__.pyto accept an include_deleted parameter.This allows retrieving soft-deleted objects if the user is an admin and explicitly requests it.
timesketch/api/v1/resources/sketch.pyto move the force_deletedetection logic earlier and pass it to
get_with_acl(include_deleted=force_delete). This ensuresthat admins can find and permanently delete sketches that are already soft-deleted.
And adding e2e tests for both
This PR is dependend on #3661