-
Notifications
You must be signed in to change notification settings - Fork 636
fix: Allow archived sketches with failed timelines to be unarchived #3656
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
|
/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 correctly implements the ability to force-delete archived sketches. The changes are applied consistently across the API client, the server-side resource, and the end-to-end tests. The logic is sound, preventing soft-deletion of archived sketches while allowing force-deletion, and the error messages have been updated to guide the user. The accompanying test modifications properly validate the new functionality. I've added a couple of comments regarding outdated docstrings that should be updated to reflect these changes.
* Server-side (`timesketch/api/v1/resources/archive.py`): Modified the unarchive logic to allow
sketches with failed or processing timelines to be unarchived. Instead of aborting with a 500
error, the system now logs a warning and proceeds to open all healthy indices. This enables
users to recover the sketch and then fix or delete the problematic timelines.
* `test_unarchive_sketch_with_failed_timeline`: Updated the docstring to clarify that the test
verifies unarchiving is allowed for sketches with failed timelines to enable recovery and subsequent
fixing.
* `test_unarchive_sketch_with_mixed_states`: Enhanced the docstring to explain that the test confirms
robustness against multiple problematic timeline states (fail and processing) during unarchive.
|
/gemini review |
force_delete to also delete archived sketchesThere 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 addresses an issue preventing sketches with timelines in 'fail' or 'processing' states from being unarchived, which is a great improvement. However, the pull request title and description are misleading. They claim that force_delete is now allowed on archived sketches, but the updated tests confirm the opposite: an archived sketch cannot be force-deleted and must be unarchived first. Please update the title and description to accurately reflect the changes, which are mainly about improving the unarchiving logic.
|
/gemini summary |
Summary of ChangesThis pull request resolves an issue where archived sketches containing failed timelines could not be unarchived, thereby preventing their proper management and deletion. The changes enable administrators to unarchive these sketches, allowing them to address the underlying timeline issues and ultimately facilitate the removal of the sketches. The update involves a modification to the unarchive API logic and the addition of new tests to ensure robustness across different timeline states. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
|
jkppr
left a comment
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.
First round. Please take a look below.
| "Timeline '%s' status set to 'ready'.", | ||
| timeline.id, | ||
| ) | ||
| # Only set timeline to ready if its index was successfully opened |
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.
I ran into the following issue:
- A searchindex can be shared between a "ready" and a "fail" timeline. E.g. when you have 1 Plaso file that works and 1 that does not.
- Somehow this situation leads to a "fail" timeline after unarchive where it was "ready" before.
Steps to reproduce:
- Create new Sketch
- Upload a working timeline
- Archive & unarchive work without issue.
- Now add a failing timeline.
- Try to archive the sketch will be prevented (as expected)
- Delete the broken timeline
- Archive sketch (now works)
- Unarchive sketch. But now the timeline that was working before is in a fail state! This should not happen.
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.
Ok I tried to reproduce it and it should be fixed now.
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.
PTAL
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.
I'm still able to reproduce this issue. Again here are the exact steps I did:
- Create new Sketch
- Upload a working Plaso timeline
- Upload a broken Plaso timeline (I have shared the one I use via DM)
- Delete the broken timeline
- Archive the sketch
- Unarchive sketch. But now the timeline that was working before is in a fail state! This should not happen.
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.
ok will try again, sorry for wasting your time :-/
jkppr
left a comment
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.
Still having the same issue.
| "Timeline '%s' status set to 'ready'.", | ||
| timeline.id, | ||
| ) | ||
| # Only set timeline to ready if its index was successfully opened |
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.
I'm still able to reproduce this issue. Again here are the exact steps I did:
- Create new Sketch
- Upload a working Plaso timeline
- Upload a broken Plaso timeline (I have shared the one I use via DM)
- Delete the broken timeline
- Archive the sketch
- Unarchive sketch. But now the timeline that was working before is in a fail state! This should not happen.
|
This pull request resolves an issue where
archivedsketches containing failed timelines could not be unarchived, thereby preventing their proper management and deletion. The changes enable administrators tounarchivethese sketches, allowing them to address the underlying timeline issues and ultimately facilitate the removal of the sketches. The update involves a modification to the unarchive API logic and the addition of new tests to ensure robustness across different timeline states.It changes how to tackle unarchiving indexes that have a OpenSearchIndex that is not found. I tiwll continue to unarchive but set the corresponding Timeline etc to
failso the Sketch is not in a blocked mode.