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

[stable10] Store quota overrides in preferences table #34467

Merged
merged 1 commit into from
Feb 15, 2019

Conversation

tomneedham
Copy link
Member

Description

Currently the user management UI in stable10 uses this method, through setquota.php to update the quota of a user. However, if they are from another user backend, on sync the quota is just replaced.

New version of #32731

Setting the quota override should set it in the preferences table as well which is used as the manual override. On sync, the sync serivce checks this and uses this as an override instead. You can delete the key here to go back to the one supplied by the user backend.

Related Issue

#32731

Motivation and Context

Quota is replaced on every sync if you override the quota in owncloud 10 and use an external user backend.

How Has This Been Tested?

Manually in the UI.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • Backport (if applicable set "backport-request" label and remove when the backport was done)

@tomneedham
Copy link
Member Author

@pako81 This should solve issues with overriting quotas on sync.

@tomneedham tomneedham requested review from PVince81 and removed request for DeepDiver1975 February 12, 2019 14:07
@PVince81
Copy link
Contributor

@tomneedham hmm but wouldn't this code here also overwrite any value that was set by an admin as the override value during the next sync ?

@tomneedham
Copy link
Member Author

No. Sync sets on the account. https://github.com/owncloud/core/blob/master/lib/private/User/SyncService.php#L223

SyncSerice is the connector between the Account and the User Backend.

This convenince method is only used by the provisioning api and the UI to override the user quota that is provided by the user backend.

@PVince81
Copy link
Contributor

Right, I see. So you brought back something we deleted back then.

@PVince81
Copy link
Contributor

I agree with the change, let's see what CI says. I hope we do have some coverage here

@PVince81 PVince81 added this to the development milestone Feb 12, 2019
@codecov
Copy link

codecov bot commented Feb 12, 2019

Codecov Report

Merging #34467 into stable10 will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@              Coverage Diff               @@
##             stable10   #34467      +/-   ##
==============================================
+ Coverage       63.57%   63.57%   +<.01%     
  Complexity      19146    19146              
==============================================
  Files            1265     1265              
  Lines           75314    75315       +1     
  Branches         1291     1291              
==============================================
+ Hits            47884    47885       +1     
  Misses          27050    27050              
  Partials          380      380
Flag Coverage Δ Complexity Δ
#javascript 53.32% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 64.67% <100%> (ø) 19146 <0> (ø) ⬇️
Impacted Files Coverage Δ Complexity Δ
lib/private/User/User.php 88.88% <100%> (+0.05%) 73 <0> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f1c2c3...fd9df26. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Feb 12, 2019

Codecov Report

Merging #34467 into stable10 will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@              Coverage Diff               @@
##             stable10   #34467      +/-   ##
==============================================
+ Coverage       63.57%   63.57%   +<.01%     
  Complexity      19146    19146              
==============================================
  Files            1265     1265              
  Lines           75314    75315       +1     
  Branches         1291     1291              
==============================================
+ Hits            47884    47885       +1     
  Misses          27050    27050              
  Partials          380      380
Flag Coverage Δ Complexity Δ
#javascript 53.32% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 64.67% <100%> (ø) 19146 <0> (ø) ⬇️
Impacted Files Coverage Δ Complexity Δ
lib/private/User/User.php 88.88% <100%> (+0.05%) 73 <0> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f1c2c3...fd9df26. Read the comment docs.

@PVince81
Copy link
Contributor

@individual-it @phil-davis as we have some work regarding LDAP automated tests, we should include something to cover this override

@phil-davis
Copy link
Contributor

phil-davis commented Feb 12, 2019

@PVince81 @tomneedham looks like testing this was thought about recently: owncloud/user_ldap#368

@PVince81
Copy link
Contributor

ok let's cover that with LDAP then, merging

Copy link
Contributor

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

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

👍

@PVince81 PVince81 merged commit cd32e83 into stable10 Feb 15, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix/quota-override branch February 15, 2019 15:11
@PVince81 PVince81 changed the title Store quota overrides in preferences table [stable10] Store quota overrides in preferences table Feb 15, 2019
@PVince81
Copy link
Contributor

master: #34511

@micbar
Copy link
Contributor

micbar commented May 16, 2019

@micbar
Copy link
Contributor

micbar commented May 16, 2019

@pmaier1
Carlos re opened the ticket.

@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants