Page MenuHomePhabricator

Auto-generate profile images for sad psyducks
ClosedPublic

Authored by chad on Mar 5 2017, 12:36 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 22, 1:45 PM
Unknown Object (File)
Fri, Nov 22, 7:59 AM
Unknown Object (File)
Fri, Nov 22, 7:07 AM
Unknown Object (File)
Tue, Nov 19, 10:28 PM
Unknown Object (File)
Fri, Nov 15, 8:10 PM
Unknown Object (File)
Tue, Nov 12, 4:17 AM
Unknown Object (File)
Fri, Nov 8, 8:00 AM
Unknown Object (File)
Oct 21 2024, 3:55 AM
Subscribers

Details

Summary

Fixes T10319. This looks for custom profile image, then falls back to a generated profile image.

Test Plan

Create a new user, log in, and see new profile image. Note this seems to break bin/lipsum generate user

Diff Detail

Repository
rP Phabricator
Branch
master
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 15910
Build 21065: Run Core Tests
Build 21064: arc lint + arc unit

Unit TestsFailed

TimeTest
106 msPhabricatorAuthInviteTestCase::Unknown Unit Message ("")
Assertion failed, expected values to be equal (at PhabricatorAuthInviteTestCase.php:303): user=out, verified=0, primary=0, should_verify=0, exception=#1048: Column 'title' cannot be null Expected: 'PhabricatorAuthInviteVerifyException' Actual: 'AphrontQueryException'
92 msPhabricatorHandlePoolTestCase::Unknown Unit Message ("")
EXCEPTION (AphrontQueryException): #1048: Column 'title' cannot be null #0 /core/data/drydock/workingcopy-85/repo/libphutil/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php(289): AphrontBaseMySQLDatabaseConnection->throwQueryCodeException(1048, 'Column 'title' ...') #1 /core/data/drydock/workingcopy-85/repo/libphutil/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php(185): AphrontBaseMySQLDatabaseConnection->throwQueryException(Object(mysqli))
124 msPhabricatorObjectMailReceiverTestCase::Unknown Unit Message ("")
EXCEPTION (AphrontQueryException): #1048: Column 'title' cannot be null #0 /core/data/drydock/workingcopy-85/repo/libphutil/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php(289): AphrontBaseMySQLDatabaseConnection->throwQueryCodeException(1048, 'Column 'title' ...') #1 /core/data/drydock/workingcopy-85/repo/libphutil/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php(185): AphrontBaseMySQLDatabaseConnection->throwQueryException(Object(mysqli))
125 msPhabricatorObjectMailReceiverTestCase::Unknown Unit Message ("")
EXCEPTION (AphrontQueryException): #1048: Column 'title' cannot be null #0 /core/data/drydock/workingcopy-85/repo/libphutil/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php(289): AphrontBaseMySQLDatabaseConnection->throwQueryCodeException(1048, 'Column 'title' ...') #1 /core/data/drydock/workingcopy-85/repo/libphutil/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php(185): AphrontBaseMySQLDatabaseConnection->throwQueryException(Object(mysqli))
130 msPhabricatorObjectMailReceiverTestCase::Unknown Unit Message ("")
EXCEPTION (AphrontQueryException): #1048: Column 'title' cannot be null #0 /core/data/drydock/workingcopy-85/repo/libphutil/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php(289): AphrontBaseMySQLDatabaseConnection->throwQueryCodeException(1048, 'Column 'title' ...') #1 /core/data/drydock/workingcopy-85/repo/libphutil/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php(185): AphrontBaseMySQLDatabaseConnection->throwQueryException(Object(mysqli))
View Full Test Results (14 Failed · 326 Passed)

Event Timeline

src/applications/people/storage/PhabricatorUserProfile.php
17–18 ↗(On Diff #42005)

I AM SURE THIS IS WRONG

  • clean up peopleprofilepicturecontroller
epriestley added inline comments.
src/applications/people/cache/PhabricatorUserProfileImageCacheType.php
40

This means we'll auto-upgrade to v2 when users load pages, but not when users run bin/people profileimage, I think? I think either "auto-upgrade" or "no auto-upgrade" are reasonable, but we should probably make both the script and cache do the same thing unless there's some particular reason not to.

src/applications/people/controller/PhabricatorPeopleProfilePictureController.php
91–94 ↗(On Diff #42006)

It's possible this query could miss (if someone ran bin/remove destroy on the File, for example), so it would cover slightly more cases to do this:

if ($default_image) {
  $default_image = load file;
}

if (!$default_image) { // <-- instead of "else"
  $default_image = psyduck;
}
src/applications/people/storage/PhabricatorUserProfile.php
17–18 ↗(On Diff #42005)

NOPE IT'S CORRECT SORRY BUDDY YOU DID A GREAT JOB

This revision is now accepted and ready to land.Mar 5 2017, 10:20 AM
chad marked 2 inline comments as done.Mar 5 2017, 4:18 PM
This revision was automatically updated to reflect the committed changes.