Skip to content

Fix GitHub bot avatar URL - #55297

Merged
ChristopherBiscardi merged 4 commits into
zed-industries:mainfrom
tsutoringo:fix/github-bot-avatar-url
Apr 30, 2026
Merged

Fix GitHub bot avatar URL#55297
ChristopherBiscardi merged 4 commits into
zed-industries:mainfrom
tsutoringo:fix/github-bot-avatar-url

Conversation

@tsutoringo

@tsutoringo tsutoringo commented Apr 30, 2026

Copy link
Copy Markdown

Summary

  • Fix GitHub avatar URL generation for bot noreply commit authors

  • Fall back to the GitHub commit author API when the CDN email avatar endpoint cannot resolve bot noreply emails

  • Add tests covering bot noreply and regular user noreply author emails

  • Before
    image

  • After
    image

Test Plan

  • cargo test -p git_hosting_providers --features gpui/test-support

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Release Notes:

  • Fixed GitHub avatar lookup for bot noreply commit authors.

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Apr 30, 2026
@zed-community-bot zed-community-bot Bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Apr 30, 2026
@maxdeviant maxdeviant changed the title fix: github bot avatar url Fix GitHub bot avatar URL Apr 30, 2026

@ChristopherBiscardi ChristopherBiscardi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heya! thanks for the PR.

What is the source for the url construction here? Is there a github docs link that indicates this is how the urls should be handled?

@tsutoringo

Copy link
Copy Markdown
Author

Thanks for the review!
I couldn't find any official documentation for this endpoint as it was already being used this way before my changes.
e.g., https://avatars.githubusercontent.com/u/e?email={}&s=128
It seems to be a bit of a hacky workaround to avoid API limits, and it falls back to the API for bots.
Unfortunately, it doesn't seem to work correctly for bot emails.

Examples.
When using email:
https://avatars.githubusercontent.com/u/e?email=29139614+renovate[bot]@users.noreply.github.com&s=128

API called during fallback:
https://api.github.com/repos/zed-industries/zed/commits/bf185f7402dc7d0445f64d5d9af260f328af6eb9

Endpoint returned by the API called during fallback:
https://avatars.githubusercontent.com/in/2740?v=4

@ChristopherBiscardi ChristopherBiscardi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok yeah I see. This does what it is supposed to here.

image

@ChristopherBiscardi ChristopherBiscardi self-assigned this Apr 30, 2026
@ChristopherBiscardi
ChristopherBiscardi added this pull request to the merge queue Apr 30, 2026
Merged via the queue into zed-industries:main with commit 2ebc3b2 Apr 30, 2026
31 checks passed
@tsutoringo
tsutoringo deleted the fix/github-bot-avatar-url branch April 30, 2026 14:25
ebaah46 pushed a commit to ebaah46/zed that referenced this pull request May 6, 2026
## Summary

- Fix GitHub avatar URL generation for bot noreply commit authors
- Fall back to the GitHub commit author API when the CDN email avatar
endpoint cannot resolve bot noreply emails
- Add tests covering bot noreply and regular user noreply author emails

- Before 
<img width="305" height="117" alt="image"
src="https://github.com/user-attachments/assets/01f79e6c-cae6-4c28-a3e3-3ca506898f4f"
/>
- After
<img width="297" height="105" alt="image"
src="https://github.com/user-attachments/assets/3f387b62-e34a-41f5-b377-2afe2e895bf8"
/>


## Test Plan

- `cargo test -p git_hosting_providers --features gpui/test-support`


Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed GitHub avatar lookup for bot noreply commit authors.

---------

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
jonx pushed a commit to jonx/zed-aros that referenced this pull request Jul 17, 2026
## Summary

- Fix GitHub avatar URL generation for bot noreply commit authors
- Fall back to the GitHub commit author API when the CDN email avatar
endpoint cannot resolve bot noreply emails
- Add tests covering bot noreply and regular user noreply author emails

- Before 
<img width="305" height="117" alt="image"
src="https://github.com/user-attachments/assets/01f79e6c-cae6-4c28-a3e3-3ca506898f4f"
/>
- After
<img width="297" height="105" alt="image"
src="https://github.com/user-attachments/assets/3f387b62-e34a-41f5-b377-2afe2e895bf8"
/>


## Test Plan

- `cargo test -p git_hosting_providers --features gpui/test-support`


Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed GitHub avatar lookup for bot noreply commit authors.

---------

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
## Summary

- Fix GitHub avatar URL generation for bot noreply commit authors
- Fall back to the GitHub commit author API when the CDN email avatar
endpoint cannot resolve bot noreply emails
- Add tests covering bot noreply and regular user noreply author emails

- Before 
<img width="305" height="117" alt="image"
src="https://github.com/user-attachments/assets/01f79e6c-cae6-4c28-a3e3-3ca506898f4f"
/>
- After
<img width="297" height="105" alt="image"
src="https://github.com/user-attachments/assets/3f387b62-e34a-41f5-b377-2afe2e895bf8"
/>


## Test Plan

- `cargo test -p git_hosting_providers --features gpui/test-support`


Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed GitHub avatar lookup for bot noreply commit authors.

---------

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants