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

[#5228] hard quota enforcement #5229

Merged
merged 202 commits into from
May 14, 2024
Merged

[#5228] hard quota enforcement #5229

merged 202 commits into from
May 14, 2024

Conversation

devincowan
Copy link
Contributor

@devincowan devincowan commented Oct 3, 2023

Resolves #5228 in conjunction with #5461

Pull Request Checklist:

  • Positive Test Case Written by Dev
  • Automated Testing
  • Sufficient User and Developer Documentation
  • Passing Jenkins Build
  • Peer Code review and approval

Positive Test Case

  1. Login as a non-admin user ("user") in one window
  2. Use a private window to login as an admin user ("admin")
  3. As "admin", use the admin panel to modify the UserQuota for "user", putting them over the hard quota limit that is set in the QuotaMessage (which you can also view in the admin panel)
  4. As "user," attempt the following actions:
  • uploading a file to a resource
  • creating a resource
  • copying a resource
  • versioning a resource
  • transferring ownership of a resource to "user"
  • ingesting a bag from the userZone
  • zipping a file without removing the original
  • unzipping a file
  1. All of the actions should fail
  2. Now test the Quota request actions: go to the Profile page using "user"
  3. Request additional quota. See the "email" printed to logs locally (depending on the email backend that you have set in settings.py)
  4. Use the link in the "email" to approve the request (or use the admin panel to find the QuotaRequest and approve it)
  5. See that the UserQuota allocated value for the "user" is incremented by the amount requested
  6. Verify that actions are now permitted (assuming the user is now below the hard quota allocated limit)
  7. All of these actions can also be tested in the API

@devincowan devincowan force-pushed the 5228-hard-quota-enforcement branch from 1bbae82 to 8f54dc1 Compare May 9, 2024 20:38
This commit adds a new management command `reset_quota.py` that allows for resetting the userzone quota by forcing the quota iRODS microservices to recalculate the quota for all users. This command is useful in scenarios where the quota needs to be recalculated due to changes in the system.
@devincowan devincowan force-pushed the 5228-hard-quota-enforcement branch from 87d37f9 to f4b85b8 Compare May 9, 2024 22:51
devincowan and others added 6 commits May 9, 2024 18:51
The migrations `0080_baseresource_quota_holder.py`, `0080_resourcefile_filesize_cache_updated.py`, `0081_alter_baseresource_quota_holder.py`, and `0082_merge_20240509_1646.py` are no longer needed and have been deleted. These migrations were related to the `baseresource` model's `quota_holder` field and the `resourcefile` model's `filesize_cache_updated` field. The changes made in these migrations have been consolidated into a new migration `0080_baseresource_quota_holder_squashed_0082_merge_20240509_1646.py`, which adds both fields to their respective models.
@devincowan devincowan requested a review from pkdash May 14, 2024 12:56
@devincowan
Copy link
Contributor Author

@pkdash requesting a final approval on this PR. You previously approved it at commit 6b605e3. Since then a few changes on the frontend and everything else contained in PR #5469 which you already reviewed.
So I believe this is less a request for review and more for a final approval

@devincowan devincowan merged commit 88f71c2 into develop May 14, 2024
1 check passed
@devincowan devincowan deleted the 5228-hard-quota-enforcement branch May 14, 2024 16:14
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.

Enforce file quota
3 participants