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

[WIP] Project reservations #12527

Closed
wants to merge 15 commits into from

Conversation

woodruffw
Copy link
Member

@woodruffw woodruffw commented Nov 10, 2022

This is still a WIP; just putting something up for visibility and early feedback.

Outstanding items:

  • POSTing the reservation form should actually reserve the project name
  • The user's manage/projects list should include a "reserved" chip on any reserved project(s)
  • Scheduled job for periodically removing reservations that have gone stale
  • Unit tests
  • The upload endpoint needs to remove Project.reserved_until, if present
  • The project's own settings page should display the fact that it's reserved

Closes #11296.

cc @di

Comment on lines +200 to +204
return (
self.has_primary_verified_email
and self.has_two_factor
and self.date_joined <= ninety_days_ago
and not has_already_reserved_project
Copy link
Member Author

Choose a reason for hiding this comment

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

Flagging for review: do I need to check User.is_frozen here as well? I don't think I do since I believe that frozen users can't log in to begin with, but I could be wrong about that.

@woodruffw woodruffw self-assigned this Nov 10, 2022
Reservations actually work, events are emitted, etc.

Signed-off-by: William Woodruff <[email protected]>
@woodruffw
Copy link
Member Author

  • Scheduled job for periodically removing reservations that have gone stale

Just making a note for myself: this'll go under warehouse.packaging.tasks, with the timer/cron configured in warehouse.packaging (i.e. __init__.py).

Also add a TODO and a sanity check.

Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
This handles cascades correctly, preventing FK errors when the project's
events are orphaned.

Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
@woodruffw
Copy link
Member Author

@di given the change in design in #11296, I think I'm going to close this out and start anew. Any objections to that? 🙂

@di
Copy link
Member

di commented Nov 18, 2022

@woodruffw Whatever is easiest for you!

@woodruffw woodruffw closed this Nov 18, 2022
@woodruffw
Copy link
Member Author

(I'll leave this branch undeleted, since I think the groundwork here might be interesting/useful if the project reservation idea is ever revived.)

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.

"De novo" project creation via API tokens/OIDC
2 participants