Option to send Pipeline notifications to Commit Author or specific user
Description
We are currently hosting a Jenkins instance in our company's LAN which is not accessible from outside.
The repositories of our customers are hosted as private repositories on gitlab.com.
In order to connect Jenkins and GitLab we are using the GitLab Plugin for Jenkins.
As the repositories are private, we need to use an API-Token of a project member, which is me in that case, as we don't want to clutter the Jenkins configuration with too many GitLab connections with separate API-Tokens and I'm involved in those projects anyway.
The problem now is, that every pipeline is using my API-Token as the "man in the middle" between gitlab.com and our Jenkins instance. That means that for every single failed build, I'm getting all the notification emails even if a colleague has caused the failure.
This leads to the issue, that my colleagues often don't notice that something went wrong if I don't forward the emails or the coincidentally check our Jenkins.
A nice side effect would be that the user, whose API-token is used, gets much less emails which are not of his concern.
Proposal
My proposal now is, that there should be an option in the project settings to change the notification recipient.
Currently it sends email to the user whose API-Token triggers the build.
If this gets implemented, there would be e.g. a dropdown in the Project -> Settings -> CI/CD
area to select, who is getting notificaitons.
Options would be e.g.:
- Commit Author
- Trigger user
- Specific user
Where the default would be the "Trigger user" as it is nowadays.
Links / references
See discussion in gitlab-ce#28755 where @dimitrieh stated, that the "Triggered by"-user should receive it instead of the commit author. (Not blaming you ;-))