feat: new page in snuba admin to do deletes #6168
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this is a redo of #6157
This PR adds a page to snuba admin that we can use to test deletes in prod.
major changes
static/delete_tool/index.tsx
is the new react UI, it callsapi_client.tsx:runLightweightDelete
api_client.py:runLightweightDelete
sends the input via http request to/delete
endpoint. (note: i think it would have been equally valid to just send the http request from index.tsx rather than having this separate function, but I did it like this bc everyone else in the codebase did)data.tsx
adds the new page to the Nav bar/delete
endpoint in snuba adminadmin/views.py:delete
As said in bullet 1, the react UI sends the input to
/delete
. This is a new endpoint we created, it mostly just callsdelete_from_storage
(what Meredith implemented that actually does the delete)/delete
endpoint and UItool_policies.py
It just goes into AllTools by default which is the most restrictive role, only snuba team and people with access to everything can use it. I think this should be good.
delete_query.py
changesdelete_query.py:delete_from_storage
in order to make the interface more strict/clear.columns
input.considerations
This tool is pretty much just a layer on top of
delete_from_storage
meaning it can do anything thatdelete_from_storage
can do. Hence it will be able to delete in any environment, and any dataset that has deletes enabled. Is this fine or should we add additional strictness to this interface, so that it can only be used for search_issues in s4s no matter what.