Slack Integration: Notify only default branch is not respected if tags present
Summary
Pipeline statuses for tags are reported to Slack integration even if "Notify only default branch" is selected.
This is a nitpick: the grammar around the "Notify only default branch" isn't accurate. I believe it should say "Notify for only default branch" or something along that line. In it's current state, it seems like one is notifying the branch, not the slack channel.
Steps to reproduce
Create a project Add Slack Integration for default branch (I used master) with Notify only default branch set to true Confirm slack integration works for default branch... Create tag, (pipeline run after tag will not send notification) Rerun pipeline associated with that tag (you should incorrectly receive notification)
Example Project
https://gitlab.com/aholland1/temp/
What is the current bug behavior?
Slack notifications are received for tags and default branch events.
What is the expected correct behavior?
I should only receive slack notifications for default branch events.
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com
Results of GitLab environment info
This bug happens on GitLab.com
Results of GitLab application Check
This bug happens on GitLab.com
Possible fixes
https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/models/project_services/chat_notification_service.rb#L161 @mdelaossa (Sorry, tagging the most recent developer who worked on this integration so it can get appropriately handled)