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

Implement undelete and purge API for users #8309

Merged
merged 14 commits into from
Aug 27, 2019
Merged

Implement undelete and purge API for users #8309

merged 14 commits into from
Aug 27, 2019

Conversation

cganote
Copy link
Contributor

@cganote cganote commented Jul 8, 2019

Refactored the controller vs. manager for the deletion and purge of users. Purge now wipes out the username (regardless of gdrp setting) and takes out histories. Undelete should now work.

@galaxybot galaxybot added this to the 19.09 milestone Jul 8, 2019
@martenson

This comment has been minimized.

@hexylena
Copy link
Member

hexylena commented Jul 8, 2019

Purge now wipes out the username...and takes out histories.

🎉❤️🎉❤️🎉❤️

Copy link
Contributor Author

@cganote cganote left a comment

Choose a reason for hiding this comment

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

Great, thank you!

@martenson martenson added area/API status/review kind/enhancement kind/refactoring cleanup or refactoring of existing code, no functional changes and removed triage labels Jul 11, 2019
@martenson
Copy link
Member

just now noticed #8299 :/

@martenson
Copy link
Member

I cherry picked the test commits from #8299 and fixed them. This PR now supersedes the other one.

@martenson

This comment has been minimized.

@martenson martenson changed the title PR for user purge doing real purgey things! implement undelete and purge API for users, refactor Jul 12, 2019
@hexylena
Copy link
Member

hexylena commented Aug 9, 2019

Fixes #930

@nsoranzo nsoranzo changed the title implement undelete and purge API for users, refactor Implement undelete and purge API for users Aug 9, 2019
lib/galaxy/managers/users.py Outdated Show resolved Hide resolved
lib/galaxy/managers/users.py Outdated Show resolved Hide resolved
lib/galaxy/managers/users.py Show resolved Hide resolved
lib/galaxy/managers/users.py Outdated Show resolved Hide resolved
@nsoranzo nsoranzo requested a review from hexylena August 9, 2019 18:35
@bernt-matthias
Copy link
Contributor

Any chance to cover this old one by me #3843

@martenson
Copy link
Member

@bernt-matthias I wouldn't tie it to this PR though

@bernt-matthias
Copy link
Contributor

I wouldn't tie it to this PR though

sure

juleengraham and others added 6 commits August 22, 2019 15:04
Because multiple inheritance will result in calling this class 'delete' method
which is not the correct target. This also avoid a database operation
I believe, since the PurgableManagerMixin.purge also calls delete before purging.
test/api/test_users.py Outdated Show resolved Hide resolved
test/api/test_users.py Outdated Show resolved Hide resolved
lib/galaxy/managers/users.py Outdated Show resolved Hide resolved
lib/galaxy/managers/users.py Outdated Show resolved Hide resolved
lib/galaxy/managers/users.py Outdated Show resolved Hide resolved
lib/galaxy/managers/users.py Outdated Show resolved Hide resolved
lib/galaxy/managers/users.py Outdated Show resolved Hide resolved
lib/galaxy/managers/users.py Outdated Show resolved Hide resolved
lib/galaxy/managers/users.py Outdated Show resolved Hide resolved
lib/galaxy/managers/users.py Outdated Show resolved Hide resolved
@martenson
Copy link
Member

@nsoranzo I think I'm not a fan of going from api to manager then to mixin, then same manager again, then same mixin again for one method. It feels confusing so I'd like to avoid that.

@nsoranzo
Copy link
Member

@nsoranzo I think I'm not a fan of going from api to manager then to mixin, then same manager again, then same mixin again for one method. It feels confusing so I'd like to avoid that.

I think these are good abstractions. For reference:

  • the API takes care of the communication with the client, checks the inputs and permissions, then invokes the methods of the right manager
  • the manager inherits and specialises some methods from superclasses and mixins, ensuring a consistent interface
  • the PurgableManagerMixin mixin implements a generic purge() method, which just calls the delete() method and sets the purged attribute of the item
  • for UserManager, we need to specialise both the delete() and purge() method, inherited from PurgableManagerMixin

@martenson
Copy link
Member

I don't think the path manager>mixin>manager>mixin>done is better than manager>done but at this point it seems like a matter of opinion and I will defer to yours.

Copy link
Member

@hexylena hexylena left a comment

Choose a reason for hiding this comment

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

Fine for me :)

@martenson martenson merged commit 94e08eb into galaxyproject:dev Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/API kind/enhancement kind/refactoring cleanup or refactoring of existing code, no functional changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants