Page MenuHomePhabricator

Add a profileimage generation workflow for the cli
ClosedPublic

Authored by chad on Mar 4 2017, 9:31 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 17, 5:53 AM
Unknown Object (File)
Thu, Dec 12, 1:01 PM
Unknown Object (File)
Wed, Dec 11, 8:21 AM
Unknown Object (File)
Tue, Dec 10, 4:19 PM
Unknown Object (File)
Mon, Dec 9, 5:30 PM
Unknown Object (File)
Mon, Dec 9, 11:19 AM
Unknown Object (File)
Thu, Dec 5, 10:41 AM
Unknown Object (File)
Sat, Nov 23, 3:04 PM
Subscribers

Details

Summary

Ref T10319. This adds a basic means of generating default profile images for users. You can generate them for everyone, a group of users, or force updates. This only generated images and stores them in files. It does not assign them to users.

Test Plan

bin/people profileimage --all to generate all images.
bin/people profileimage --users chad to generate a user.
bin/people profileimage --all --force to force rebuilding all images.

pasted_file (1×1 px, 249 KB)

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

chad edited the test plan for this revision. (Show Details)
epriestley added inline comments.
scripts/people/manage_people.php
9–12

Since we'll probably add more stuff, maybe make this help text generic: "Manage user profiles and accounts" or similar.

src/applications/people/management/PhabricatorPeopleManagementWorkflow.php
32

Ideally, make sure that we loaded a user for each username. As written, I think profileimage alinkern bartty claire will "work": as long as you provide at least one valid username, we'll just ignore the invalid ones. Better would be to fatal explicitly before doing anything: "user alinkern is not a valid user".

src/applications/people/management/PhabricatorPeopleProfileImageWorkflow.php
10

Maybe **profileimage** --user __username__ or similar since running it without arguments doesn't work so it isn't a great example?

14–18

I think this is unused / doesn't work?

66

I think it would be OK to auto-regenerate if the version was old, too.

73–77

For consistency, prefer to format messages as full sentences (with punctuation) and quote parameters/usernames/etc where reasonable:

- Generating profile image for %s
+ Generating profile image for "%s".
78–83

I don't think this is possible -- getUserProfileImageFile() always throws on error and never returns null, I believe?

This revision is now accepted and ready to land.Mar 4 2017, 11:13 PM
src/applications/people/management/PhabricatorPeopleProfileImageWorkflow.php
66

Oh, I thought maybe we didn't want to force people to get a new image if we alter the formula?

Hmm, I guess we could go either way. I could see people liking their v1 images (or missing them if we overwrite them).

If we don't think we'll ever force-upgrade we could drop the version thing entirely, my thinking was just that we've doubled the size of images every ~6 months so they'll probably be 9600x9600 soon and we might want to force-upgrade the old blurry ones.

force-upgrade

Er, "auto-upgrade" I guess. If we probably wouldn't automatically rebuild default images for users (for example, when we make them bigger or tweak colors) we don't need the version stuff at all.

If we use the version stuff in the generate-at-Query-time logic we should probably use it here too, though, so that administrators can do that work ahead of time and avoid slow pages.

well at least with version in there, we can punt and have a fallback

This revision was automatically updated to reflect the committed changes.
chad marked 7 inline comments as done.