warehouse
warehouse copied to clipboard
Implement soft deletes for projects, releases and files
What's the problem this feature will solve? Currently there is some user frustration/friction about PyPI's policy of disallowing the reuse of filenames for distributions. I.e., once you delete a given distribution or release, it cannot be re-uploaded.
Describe the solution you'd like One way we can improve this experience without reversing our policy is to allow for "soft" deletes. This would allow a maintainer to "delete" a file, release or project (same behavior as currently exist), but have the ability to see "deleted" files/releases/projects in the management UI, and be able to reverse the deletion.
Because we are currently not removing the actual files from our storage service, this will not result in significantly increased disk space. And while this will result in a slight increase in data in our database, it should be negligible because deletes happen relatively infrequently.
~This feature is slightly complicated by the fact that currently we hook into the SQLAlchemy creation/deletion events to determine when to purge various pages from the cache. Removing true deletion of database objects will necessitate finding another way to initiate the purges.~
Additional context See also https://github.com/pypa/packaging-problems/issues/74, where this was originally described in https://github.com/pypa/packaging-problems/issues/74#issuecomment-137775034.