zed/crates/git_graph
Augustus Otu 36e35f7df1
git: Use CDN endpoint for GitHub avatars to avoid rate limiting (#47894)
GitHub's commit API endpoint is rate limited to 60 requests/hour for
unauthenticated users. This causes avatar loading to fail after toggling
blame a few times.

This PR uses GitHub's CDN avatar endpoint
`https://avatars.githubusercontent.com/u/e?email={email}&s=128` instead,
which doesn't count against API rate limits. The author email is already
available from local git data (blame output), so
  no API calls are needed.

- When author email is available, constructs the CDN URL directly (zero
API calls)
  - Falls back to existing API-based behavior when email is unavailable
  - Adds unit tests for URL construction

  Closes #47590

  ## Test plan
  - [x] `./script/clippy` passes
- [x] `cargo test -p git_hosting_providers` passes (89 tests including 3
new ones i added)
- [ ] Manual test: Open a file, toggle git blame, verify avatars load
without hitting rate limits

  Release Notes:

- Fixed GitHub avatar rate limiting in git blame by using CDN endpoint
instead of API calls (#47590)
2026-01-31 13:49:42 -05:00
..
src git: Use CDN endpoint for GitHub avatars to avoid rate limiting (#47894) 2026-01-31 13:49:42 -05:00
Cargo.toml git_graph: Add feature graph (#47861) 2026-01-28 14:41:17 +00:00
LICENSE-GPL