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

Add disallow deletion AdminFlag #6518

Merged
merged 5 commits into from
Sep 12, 2019

Conversation

calvin
Copy link
Contributor

@calvin calvin commented Aug 23, 2019

Add new AdminFlags which prevent projects/release from deletion or new uploads when enabled.

Closes #3218

@nlhkabu nlhkabu requested a review from di August 23, 2019 17:20
@calvin
Copy link
Contributor Author

calvin commented Aug 23, 2019

Testing upload:

python3 -m twine upload --repository-url http://warehouse/legacy/ dist/*
Enter your username: user
Enter your password:
Uploading distributions to http://warehouse/legacy/
Uploading itsdangerous-1.1.1-py2.py3-none-any.whl
100%|██████████████████████████████████████████████████████████████████████████████████████████████| 22.6k/22.6k [00:00<00:00, 83.0kB/s]
NOTE: Try --verbose to see response content.
HTTPError: 403 Client Error: New uploads are temporarily disabled. See http://warehouse/help/#admin-intervention for details for url: http://warehouse/legacy/

@calvin calvin marked this pull request as ready for review August 23, 2019 23:20
@calvin
Copy link
Contributor Author

calvin commented Aug 29, 2019

@di This PR is ready to review.

@brainwane
Copy link
Contributor

@calvin Thank you for this PR! Would you mind fixing the merge conflict and then say here when you've done that, and I'll try to find some reviewers to help move this along? Thanks!

@calvin
Copy link
Contributor Author

calvin commented Sep 9, 2019

@brainwane resolved conflicts.

Copy link
Member

@ewdurbin ewdurbin left a comment

Choose a reason for hiding this comment

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

Looks good, but I think we need to update templates as noted in comments.

We probably don't want to remove a chunk of html that users expect to see without explaining why.

warehouse/templates/manage/release.html Outdated Show resolved Hide resolved
warehouse/templates/manage/releases.html Outdated Show resolved Hide resolved
warehouse/admin/flags.py Outdated Show resolved Hide resolved
warehouse/templates/manage/release.html Outdated Show resolved Hide resolved
@ewdurbin
Copy link
Member

that was a really solid suggestion @di!

@ewdurbin ewdurbin merged commit 30f2389 into pypi:master Sep 12, 2019
@ewdurbin
Copy link
Member

Thank you @calvin!

woodruffw pushed a commit to trail-of-forks/warehouse that referenced this pull request Sep 16, 2019
* Add AdminFlagValue

* Add disallow deletion AdminFlag

See pypi#3218

* Add disallow new upload AdminFlag

* Convert `AdminFlagValue` to enum
@brainwane
Copy link
Contributor

@calvin I just want to note that this was great for a first PR not just in this repo but in PyPA as a whole. Thank you! If you're interested in helping more, we would welcome it, and I could suggest a couple things if you like!

@calvin
Copy link
Contributor Author

calvin commented Jan 27, 2020

@brainwane I do want to make more contributions. Please tell me more.

@brainwane
Copy link
Contributor

@calvin Would you take a look at #5837 ?

@brainwane
Copy link
Contributor

@calvin Or, if you want to do some more UI-only stuff, #6606?

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.

Implement an AdminFlag for halting project/release modifications
5 participants