Incorrect URI for default avatar in commit messages
Summary
Default avatar is not displayed for users mentioned in commit messages (e.g. Reviewed-by).
Error message is displayed (not every time) at the top of the page which is displayed next.
The bug is reproducible only with Gravatar disabled.
The bug is present for both:
- existing Gitlab users with no avatar set
- for unknown identities
Steps to reproduce
- Run latest Gitlab CE in a container
export GITLAB_OMNIBUS_CONFIG="external_url = 'http://localhost:8080'
gitlab_rails['gitlab_shell_ssh_port'] = 2222"
podman run --detach --hostname localhost --publish 2222:22 --publish 8080:80 --name gitlab --restart always -e GITLAB_OMNIBUS_CONFIG gitlab/gitlab-ce:latest
-
Set a root password and log in to Gitlab at https://localhost:8080/
-
Disable Gravatar by unchecking Admin Area/Settings/General/Account and limit/Gravatar enabled
-
Create a new project (initialized with readme).
-
Edit README.md in Gitlab while setting the following commit message:
Update README.md
Reviewed-by: John Doe <john@example.com>
-
Look at the commit description (click at 3 dots) on the created project home page or on the commit list.
-
You'll see an
<img>
placeholder instead of a default avatar.
Example Project
Gitlab.com uses Gravatar. The above steps lead to a Gravatar based avatar displayed.
What is the current bug behavior?
Incorrect URI for default avatar in commit messages is generated (seems like the avatar is expected in the current repo content). In my case:
<img alt="default avatar" src="/root/test/-/blob/master/assets/no_avatar-849f9c04a3a0d0cea2424ae97b27447dc64a7dbfae83c036c45b403392f0e8ba.png" class="avatar s16 avatar-inline">
What is the expected correct behavior?
Default avatar is not saved in the current repo, so no base path should be prepended to the avatar image path. A proper default avatar should look something like this:
<img alt="default avatar" src="/assets/no_avatar-849f9c04a3a0d0cea2424ae97b27447dc64a7dbfae83c036c45b403392f0e8ba.png" class="avatar s16 avatar-inline">