Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-33381

Send emails to the commit author instead of the committer for specified committers

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Minor Minor
    • mailer-plugin
    • None

      The "Send separate e-mails to individuals who broke the build" option sends emails to the commit's committers. However, there are cases when it's better to send emails to the commit's authors instead.

      We use Gerrit for hosting our Git repositories and its workflow consists in pushing commits to pseudo-branches for review. After the commits have been approved they are submitted (integrated) automatically into the real branch, but this action is performed by Gerrit which may have to rebase the original commit in order to be able to tuck it on top of the current branch's HEAD. In these cases, the actual commit's committer becomes an administrative user. In our case we configured it to be a user called gerrit with an email like gerrit@ourdomain.com.

      So, for these commits it doesn's work to send notifications to the commit's committer. They should be sent to the commit's author instead.

      What I propose is that there should exist another configuration option where we could specify a list of emails (a Regexp would also do). If the committer's email matches one of the emails specified, then the notifications should be sent to the commit's author instead.

      This option should be subordinated to the "Send separate e-mails to individuals who broke the build" option.

          [JENKINS-33381] Send emails to the commit author instead of the committer for specified committers

          I just knew that Gerrit's latest version incorporated this fix which should preserve the commit's committer when performing an automatic rebase. With this (I'm not using the latest version yet) I think this proposal loses its appeal.

          Should I close the issue myself? I'm not sure which resolution to choose...

          Gustavo Chaves added a comment - I just knew that Gerrit's latest version incorporated this fix which should preserve the commit's committer when performing an automatic rebase. With this (I'm not using the latest version yet) I think this proposal loses its appeal. Should I close the issue myself? I'm not sure which resolution to choose...

          Is there still any life for this open ticket?

          Gerrit is not the only repo to rebase using admin users - GitHub integration suffers the same shortfall. I agree with gnustavo - a regex config for email re-routes to the author would really solve a lot of headaches.

          We are unable to email guilty parties when the build breaks, if commits are squashed from GitHub's web UI.

          Donovan Thatcher added a comment - Is there still any life for this open ticket? Gerrit is not the only repo to rebase using admin users - GitHub integration suffers the same shortfall. I agree with gnustavo - a regex config for email re-routes to the author would really solve a lot of headaches. We are unable to email guilty parties when the build breaks, if commits are squashed from GitHub's web UI.

          Ben Harper added a comment -

          This issue popped up recently for us, after people started using GitHub's relatively new "Squash and Merge" option on Pull Requests. In that case, GitHub preserves the Author of the commit, but the Committer is set to "noreply@github.com".

          Ben Harper added a comment - This issue popped up recently for us, after people started using GitHub's relatively new "Squash and Merge" option on Pull Requests. In that case, GitHub preserves the Author of the commit, but the Committer is set to "noreply@github.com".

          Brendan Mannix added a comment - - edited

          I'm having this issue with GitHub Enterprise 2.9.5 using "Squash and Merge".  Emails go to github-unmonitored-alias@<company> because to committer is GitHub.  Having the ability to distinguish between committer and author is needed.  Looking at https://github.com/jenkinsci/email-ext-plugin/blob/64641f05edafd8157ed50fb64238aa22d9f342af/src/main/java/hudson/plugins/emailext/plugins/recipients/RecipientProviderUtilities.java#L96 it seems that the intention of the code is to pull the author, but in fact the committer is being pulled.  Unfortunately this seems to come from hudson.scm.ChangeLogSet so I'm not sure this can be fixed in this plugin.

          Brendan Mannix added a comment - - edited I'm having this issue with GitHub Enterprise 2.9.5 using "Squash and Merge".  Emails go to github-unmonitored-alias@<company> because to committer is GitHub.  Having the ability to distinguish between committer and author is needed.  Looking at https://github.com/jenkinsci/email-ext-plugin/blob/64641f05edafd8157ed50fb64238aa22d9f342af/src/main/java/hudson/plugins/emailext/plugins/recipients/RecipientProviderUtilities.java#L96  it seems that the intention of the code is to pull the author, but in fact the committer is being pulled.  Unfortunately this seems to come from hudson.scm.ChangeLogSet so I'm not sure this can be fixed in this plugin.

            Unassigned Unassigned
            gnustavo Gustavo Chaves
            Votes:
            5 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: