-
-
Notifications
You must be signed in to change notification settings - Fork 988
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
Conversation
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.
Overall looks good! Added a comment, but I think it makes sense.
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... |
@bmispelon Hi! Do you think you'd have any availability to continue your work on this? |
@bmispelon Hi! Could you please help me understand whether you'd have availability to keep on this? Otherwise, no worries, I can take it: |
I've picked this up again, thanks for the ping. I've rebased the branch, fixed the CI, and updated the first comment with a list of what's left for me to do. |
4c33cc8
to
4980546
Compare
18805ea
to
99a8aa6
Compare
1c7225e
to
7aa4135
Compare
@nessita I think this is ready for a re-review. I've taken your advice and simplified the migration a bit so that only exceptions to the general naming rule are listed explicitly. I've always made a few quality-of-life improvements to the admin form (fieldsets, custom validation) but if you think that's going to get in the way of your work please let me know. |
3a3e863
to
b43854b
Compare
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.
Thank you @bmispelon for this work, I have applied my suggestions locally and I have made other changes based on what we talked during the DSF Office Hours (pushing that now).
I haven't fixed the tests, would you have any availability to fix them? 🌟
releases/admin.py
Outdated
for fieldname, accept in _ARTIFACT_FILE_EXTENSIONS.items(): | ||
self.fields[fieldname].widget.attrs["accept"] = accept |
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 think we should remove this and put it in the model using a FileExtensionValidator. I will add a suggest there.
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.
The accept
attribute on the <input>
also had the benefit of filtering the list of visible files in the file picker, it's not just about validation (which should be done server side, I agree).
I've fixed the tests and pushed a few changes:
I think we should restore the Otherwise, I like the changes you made to keep the case of the uploaded artifact, I think it makes sense. |
ca24abb
to
ac20809
Compare
@bmispelon I pushed an update where the
|
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.
Looks good!
8c2b2ef
to
3a1456b
Compare
@sarahboyce This is a good idea and I have reverted this change in a separated commit that we can later squash. The rest of the feedback was addressed. Thank you! |
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.
This looks great to me!
Three new file fields (tarball, wheel, checksum) were added, making the link generation to these files more robust to changes like the one mandated by PEP625 (changing of file case). A new is_active boolean field was also added, making it easier to start work on a release without it being public.
Now we just need a fresh new Django version to test things out. Wanna roll out an unplanned release just for fun? 🙊 |
This is in preparation for https://code.djangoproject.com/ticket/35980 which will likely change the naming scheme of build files (tarballs and checksums).
Here's a summary of the changes in this PR:
Release
model:tarball
,wheel
, andchecksum
tarball
field mandatory when a release is active (ie it has a release date). This is because the template indownload.html
assumes that all published/active releases have at least a tarball attached to them.accept
attribute on the admin form file widgets to make it easier to pick the right file for eachRelease
model can now be used)Screenshots
I've also prepared a companion PR to the documentation of the release process over at django/django#19178