Skip to content

GitLab author pictures: ask about a pushed commit, survive slow servers (1.1.2) - #2

Merged
edoardopanichi merged 1 commit into
mainfrom
bugfix/gitlab-avatars-robust
Nov 27, 2026
Merged

edoardopanichi merged 1 commit into
mainfrom
bugfix/gitlab-avatars-robust

Conversation

@edoardopanichi

Copy link
Copy Markdown
Owner

With 1.1.1, GitLab repositories could still show initials only.

Causes

  • The page asks once per author, using the author's newest commit in the graph. That commit is often local-only or a merge, and GitLab doesn't know it, so only the public-email lookup was left.
  • A slow GraphQL answer (over 6 s) or a 5xx/429 was treated as "offline". Nothing was cached and the page never asked again.

Fix

  • Ask about the author's newest pushed non-merge commit (git log --remotes --no-merges --author=<email>, about 70 ms), then about the commit shown.
  • GraphQL now has 15 s. Any GraphQL failure falls back to the email lookup.
  • When the host can't be reached, the server answers 503 with Retry-After, and the page asks again (up to 3 tries).
  • LOOKUP_VERSION is now 3, so "no picture" answers cached by 1.1.1 are asked again.
  • Version 1.1.2. README and TESTING.md updated. New tests cover each change.

Tests

  • 101 passed, 2 skipped, on Windows.
  • Live lookup on a private self-hosted GitLab repo: picture found, about 1.1 s warm.

🤖 Generated with Claude Code

- Ask GitLab about the author's newest pushed non-merge commit (local-only commits and merges are unknown to GitLab), then the commit shown
- GraphQL gets 15 s; timeouts, 5xx and 429 fall back to the public-email lookup instead of "offline"
- Network trouble answers 503 + Retry-After and the page asks again (up to 3 tries) instead of keeping initials for good
- LOOKUP_VERSION 3: misses cached by 1.1.1 are asked again
- Version 1.1.2; README and TESTING.md updated; tests for all of the above

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@edoardopanichi
edoardopanichi merged commit 1f6a1ac into main Nov 27, 2026
5 checks passed
@edoardopanichi
edoardopanichi deleted the bugfix/gitlab-avatars-robust branch November 28, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant