GitLab Broadcast Messages not appearing in Git remote responses
Summary
GitLab Broadcast Messages not appearing in Git remote responses when the messages are configured to show only to users with specific roles on groups/project pages.
Steps to reproduce
-
Create a Broadcast Message:
- Go to Admin > Messages.
- Create a new broadcast message, making sure to select "Show the broadcast message in a command-line interface as a Git remote response."
-
Test with "Show to all users on all pages":
- Set the broadcast message to show to all users.
- Push to or pull from a repository via the command line (
git push
orgit pull
). - The broadcast message should appear in the Git remote response.
-
Test with "Show only to users with specific roles":
- Modify the broadcast message to target only specific roles on groups/project pages (e.g., Developers, Maintainers).
- Optionally, set a target path such as
/project/
,/group/my-project
, or simply*
. - Push to or pull from a repository again.
- Expected behaviour: The broadcast message should appear in the Git remote response.
- Actual behaviour: The message does not appear in the Git remote response.
Workaround
Workaround identified from a comment in an old related bug report which was subsequently fixed. Adding a /
in front of the target path and using a wildcard /path/*
resolves the issue
What is the current bug behaviour?
- When the broadcast message is configured to show to all users on all pages, it appears in the Git remote response as expected.
- When the broadcast message is set to show only to specific users who have roles on groups or project pages, the message does not appear in the Git remote response. However, it shows correctly in the web UI.
What is the expected correct behaviour?
- Broadcast messages should appear in the Git remote response when users push or pull changes to a repository, especially when targeted to specific users or roles.
Relevant logs and/or screenshots
GitLab environment info
Issue reproduced in GitLab SM 17.3.1