Repository navigation
fallback to Gravatar for rendering avatar icons - #3513
Conversation
| } | ||
|
|
||
| /** | ||
| * Fetch an avatar associated to associate with a user, using graceful fallback |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Visually, this is what our current GitHub Enterprise repositorySome Other repository (in this case it's Desktop)With this change, things get a bit more personal: GitHub Enterprise repositorySome Other repositoryI don't think it's worth trying to get Identicons working as a fallback for those people who don't have Gravatar setup for their email addresses. Also, this solution involves a fair bit of blacklisting of GitHub Enterprise avatars 😢 I have ideas for rolling this back later but it requires us to know about the version of GitHub Enterprise you're talking to - a job for a follow-up PR. |
| const gitHubUser = | ||
| this.props.gitHubUsers.get(commit.author.email.toLowerCase()) || null | ||
| let avatarUser = null | ||
| if (gitHubUser) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Looks good and works on my machine 🤞 |
In GitHub Enterprise, the avatarUrl endpoints that the APIs return require authentication in standard configuration. There is currently no way to do token authentication to these endpoints, so a fallback is necessary to render an image. The interface was previously coded to handle fallback to the Gravatar service (just like GitHub Desktop [did](desktop/desktop#3513)), but this behavior was disabled in 13ab0a7 and 6769dd4 because of end-user preference for making this feature configurable. A new setting has been added * `githubPullRequests.defaultGravatarsStyle` is an `enum` of the Gravatar supported fallback styles plus an internal value of `none` to disable the integration These settings provide a richer user experience for GitHub Enterprise pull requests, allowing users to opt-in/out on avatar rendering via a third-party service with multiple options for the default fallback image style. For consistency in multiple interface areas where `<Avatar>` is rendered, the graphQL queryies (and matching typescript interfaces) have been updated to include the necessary `email` property for integration with Gravatar. REST provided actors are missing email. If missing email and using GitHub Enterprise, make another REST API call to the user endpoiint to get email. This allows a fallback avatar to be generated. This fixes GitHub Enterprise avatars not being rendered in the tree views.




Fixes #821
This changes up the strategy for rendering avatars in a few ways, because who knew rendering an image on screen could be so fascinating.
text/html- handle this and skip itHTTP 429ourselves