-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Artisan command for updating avatars for existing users #4560
Conversation
Thanks @MarcHagen, this looks great! I've assigned to the next release. |
During review of #4560. - Simplified command to share as much log as possible across different run options. - Extracted out user handling to share with MFA command. - Added specific handling for disabled avatar fetching. - Added mention of avatar endpoint, to make it clear where these avatars are coming from (Protect against user expectation of LDAP avatar sync). - Simplified a range of the testing. - Tweaked wording and code formatting.
Thanks again @MarcHagen. I did follow this up with 4b4d8ba primarily to simplify the logic of this command, so it follows pretty the same path for all three options (I was nervous about the amount of logic for a command that's had very little demand), and to extract & share the user handling across commands, otherwise it's mostly simplification and formatting/style preference changes. |
Awesome stuff, follow up commit looks great. I'm not super familiar with Laravel. The
The I am curious why you are using the Thank you for the awesome experience you gave me on this PR. |
It can be, but I thought it's important to show users some quick-identifiable info about the user before they take action, especially since I merged the single-user flow into the bulk flow, since you previously had more info there (which I think is important for running for single user).
I have a habit of hard-coding stuff in tests quite a lot. Including text strings, URLs, expectations and commands. Ultimately, it's a preference. There'd always be a balance of purposeful test fragility and maintenance, and this is the balance I've landed on. |
Adding a console command to:
Adding check for avatar fetching if the response code is OK.
Having the #3232 (comment) in mind.
Please let me know if any changes or refactoring is needed!
Console outputs:
# php artisan bookstack:refresh-avatar --id=123 A user where id=123 could not be found.
# php artisan bookstack:refresh-avatar --users-without-avatars 2 user(s) found without avatars. ID 1 - Not updated ID 2 - Not updated Dry run, no avatars have been updated Run with -f or --force to perform the update
# php artisan bookstack:refresh-avatar --all 2 user(s) found. ID 1 - Not updated ID 2 - Not updated Dry run, no avatars have been updated Run with -f or --force to perform the update