-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Add profile data listing and editing to occ command #52760
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 profile data listing and editing to occ command #52760
Conversation
provokateurin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found the first commit to be really hard to review, but I think your refactoring is good and I trust you and the tests that the changes are correct :)
Could you please add some tests for the added functionality? Please also squash the last two commits so the changes are atomic, in case anyone in the future has to bisect the changes.
|
Hi @provokateurin thank you for your review! I'm sorry my first commit was hard to review. I wanted to keep the refactoring in one commit, but I see that it would've been better to split the changes more, at least for the sake of the review. If you have other suggestions for me about this, please let me know! Regrding the fixes, do you prefer separate commits per item to be fixed, and then squash them with the relevant commits once the review is over, or something else? Also, while reading and implementing my changes, I noticed a few oddities and I'm not sure whether those should be discussed in this PR or in another place:
What do you think? |
dedc5aa to
dcd82c5
Compare
Like I said it's not that bad, especially given how bad the code was before. Sometimes rewriting is the only solution to make it clean.
Ideally you only do fixup commits, so the reviewers can easily check what you changed, and then squash once at the end when everything was approved and is ready to be merged.
You could fix them here, but that might a bit too much. If you don't mind, please open some issues about your findings so we can fix them later. |
|
@provokateurin I finally managed to finish and push the updated/new tests 🎉 I decided to edit the get/list ones, since the test code would be not too complex, but added new versions for the set and delete ones since adding the new case to the old tests would make them a bit too complex and way harder to read. Regarding my previous comment about the |
provokateurin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally you use strong types for all parameters and maybe you can also try setting declare (strict_types=1); and check if everything still works with that.
fb53a1a to
f6176bc
Compare
|
Hey @provokateurin thanks again for the loops of review! I addressed everything up to your latest comments but I noticed that the fix to avoid returning the "settings" values is still in the branch. I want to confirm that I should remove it, correct? That would mean removing the if statement from the following code but keeping the assignment (Setting.php:302). if (!$app || $app === 'settings') {
// Only add the display name if the user exists
$settings['settings']['display_name'] = $user->getDisplayName();
} |
TBH I'm not knowledgeable about how it is supposed to work. I would think the check makes sense, but maybe you can elaborate a bit why you think it should be removed. |
I would love to keep the fix, since it leads to a more correct output for the |
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
14b6b81 to
d41653f
Compare
|
Nice stuff! 🎉 |
|
@provokateurin I adapted the |
Ok, I'll adapt the code to not fail when trying to edit a non-existing user and check how comes I was not testing for the user not being null. |
What would be the expected behaviour when using For example, in the implementation that existed for |
94e8cf7 to
cfc6b6d
Compare
|
@provokateurin under suggestion from @come-nc, I moved the profile settings under The latest push has the following changes:
The fixes for the issues with |
c211e25 to
94f10f5
Compare
st3iny
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a lot of unrelated autoloader changes. Please revert them.
94f10f5 to
1ca6690
Compare
|
Rebased the branch on master and squashed all commits that could be squashed. |
This change adds support for reading profile information through the occ command, and updates the corresponding test. Signed-off-by: Salvatore Martire <[email protected]>
Signed-off-by: Salvatore Martire <[email protected]>
Signed-off-by: Salvatore Martire <[email protected]>
1ca6690 to
74dd770
Compare
st3iny
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works
|
Merged in #53540 |
occ user:settingretrieve/manipulate user profile properties #49744Summary
This PR adds the ability to list, edit or delete profile properties through the
occcommand.Before:
After:
TODO
occ user:setting [uid] settingsand decide whether to open a new ticket or fix in this context.Checklist