Non-members of a project can subscribe to new release notifications but they will not be sent to them

Summary

Custom notification setting New release is available to non-members of a project but they will not be sent to them.

Steps to reproduce

  • login as user1 & create a new public project
  • login as user2 who is not a member of this project, open the project, click bell icon, select Custom notification setting > New release
  • login as user1 again, go to Project overview > Releases > New release, submit all the fields and create a new release
  • user2 will not get a new release notification
  • add user2 as a project member and submit one more new release. After that user2 will get the release notification

Example Project

https://gitlab.com/atanayno/notifications-test/

What is the current bug behavior?

Non-members of a project can subscribe to new release notifications but they will not be sent to them.

What is the expected correct behavior?

New release notifications should be sent to non-members of a project, if the project is Public.

Proposal

Briefly investigating the problem, it looks like we're currently targeting project members only (This is also documented here). This should also target users who have subscribed to the project releases via Custom notification, in the way that @hcgrove commented above.

To do so, we need to fix the recipients logic to include such users. The weight would be 2-3, including the performance tuning and gradual rollout with a feature flag.

Relevant logs and/or screenshots

n/a

Output of checks

This bug happens on GitLab.com.

Edited by Shinya Maeda