Skip to content
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

packaging: deletion window machinery #16813

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

woodruffw
Copy link
Member

This adds in_deletion_window to the File, Release, and Project models. The three models currently compose in deletion semantics as follows:

  1. A file is deletable iff it was uploaded within the last 7 days
  2. A release is deletable iff all of its files are deletable
  3. A project is deletable iff all of its releases are deletable

This results in no special casing: the deletability of releases and projects is entirely "driven" by the deletability of files, as files are the primary way in which users drive the creation of releases and projects.

This PR does not connect the deletion semantics to actual UI or view changes; I'll do that in a follow-up, to keep the patches small.

This adds `in_deletion_window` to the File, Release, and Project
models. The three models currently compose in deletion semantics
as follows:

1. A file is deletable iff it was uploaded within the last 7 days
2. A release is deletable iff all of its files are deletable
3. A project is deletable iff all of its releases are deletable

This results in no special casing: the deletability of
releases and projects is entirely "driven" by the deletability
of files, as files are the primary way in which users drive the
creation of releases and projects.

This PR does **not** connect the deletion semantics to actual
UI or view changes; I'll do that in a follow-up, to keep the
patches small.

Signed-off-by: William Woodruff <william@trailofbits.com>
@woodruffw woodruffw requested a review from a team as a code owner September 30, 2024 17:39
@woodruffw woodruffw self-assigned this Sep 30, 2024
@woodruffw woodruffw marked this pull request as draft September 30, 2024 17:51
@woodruffw woodruffw removed the request for review from a team September 30, 2024 18:06
Signed-off-by: Facundo Tuesca <facundo.tuesca@trailofbits.com>
Signed-off-by: Facundo Tuesca <facundo.tuesca@trailofbits.com>
@facutuesca
Copy link
Contributor

Added some changes to reflect the current PEP 763 draft. Specifically:

  • Deletion window changed from <= 7 days to <3 days
  • Pre-releases are always deletable

Relevant section from the PEP:

  • A file is deletable if and only if it was uploaded to PyPI less than 72 hours from the current time, or if it has a pre-release specifier.
  • A release is deletable if and only if all of its contained files are deletable.
  • A project is deletable if and only if all of its releases are deletable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants