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

Added file fields for a release's tarball and checksum #1801

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bmispelon
Copy link
Member

@bmispelon bmispelon commented Dec 7, 2024

This is in preparation for https://code.djangoproject.com/ticket/35980 which will likely change the naming scheme of build files (tarballs and checksums).

To prepare the migration operation I looked in the production server, dumped all versions, tarballs, and checksums and semi-manually wrote the mapping between the two.

TODO:

  • Fix tests (Release objects created in tests need a tarball attached to them
  • Make checksum a mandatory field in the admin form (it's only optional for legacy releases)
  • Figure out if we also want a field for the wheel file. They're not visible on the site but are uploaded as part of the documented release process (and included in the checksum file).

@bmispelon bmispelon self-assigned this Dec 7, 2024
Copy link
Contributor

@nessita nessita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good! Added a comment, but I think it makes sense.

# These are put at the end to avoid excessive scrolling when trying to read
# the actual migration operations

VERSION_TO_TARBALL = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we programmatically generate this list instead of defining line by line? And if there are a couple of exception to the rule, let's only define that as an explicit dict.

I think we could use F on the update to use each row major, minor, and version? Something like (untested):

Release.objects.update(
    tarball=Concat(
        Value("releases/"), F("major"), Value("."), F("minor"), Value("/Django-"), F("version"), Value(".tar.gz")
    )
)

@nessita
Copy link
Contributor

nessita commented Dec 9, 2024

On a second look, and after some local testing, I wonder why we don't spare the new fields and just make them a property? That seems simpler and that it scales better...

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