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

Should be able to optionally prevent duplicate email notifications

    Details

    • Similar Issues:

      Description

      There should be a way to configure post-build email notifications such that if the same email address comes up more than once, the recipient won't receive multiple identical emails.

      Example: If 'user@domain.com' is added in the recipient list for a trigger and they are also determined to be one of the committers/culprits, it should be possible to ensure that only 1 email is sent to 'user@domain.com'.

        Attachments

          Activity

          csleight csleight created issue -
          Hide
          sinkha sinkha added a comment -

          This is a patch with the improvement suggested by csleight. He created the patch in response to his own request, but was unable to upload, so I'm attaching it for him.

          Show
          sinkha sinkha added a comment - This is a patch with the improvement suggested by csleight. He created the patch in response to his own request, but was unable to upload, so I'm attaching it for him.
          sinkha sinkha made changes -
          Field Original Value New Value
          Attachment src.patch [ 19973 ]
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in hudson
          User: : krwalker
          Path:
          trunk/hudson/plugins/email-ext/src/main/java/hudson/plugins/emailext/EmailRecepientUtils.java
          trunk/hudson/plugins/email-ext/src/main/java/hudson/plugins/emailext/ExtendedEmailPublisher.java
          trunk/hudson/plugins/email-ext/src/test/java/hudson/plugins/emailext/EmailRecepientUtilsTest.java
          http://jenkins-ci.org/commit/37048
          Log:
          JENKINS-8071 Use a Set instead of a List so email addresses are unique.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : krwalker Path: trunk/hudson/plugins/email-ext/src/main/java/hudson/plugins/emailext/EmailRecepientUtils.java trunk/hudson/plugins/email-ext/src/main/java/hudson/plugins/emailext/ExtendedEmailPublisher.java trunk/hudson/plugins/email-ext/src/test/java/hudson/plugins/emailext/EmailRecepientUtilsTest.java http://jenkins-ci.org/commit/37048 Log: JENKINS-8071 Use a Set instead of a List so email addresses are unique.
          Hide
          kenmorse kenmorse added a comment -

          It would be great to see this patch rolled into the next release of the extremely useful email-ext extension.

          Show
          kenmorse kenmorse added a comment - It would be great to see this patch rolled into the next release of the extremely useful email-ext extension.
          sogabe sogabe made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          slide_o_mix Alex Earl made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Hide
          vitorg Robert Cody added a comment -

          This patch wasn't committed and this useful feature is still absent.

          Show
          vitorg Robert Cody added a comment - This patch wasn't committed and this useful feature is still absent.
          vitorg Robert Cody made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Assignee Alex Earl [ slide_o_mix ]
          Hide
          vitorg Robert Cody added a comment - - edited

          Also if we have several triggers with the same user, there should be only 1 e-mail sent to each user.

          Show
          vitorg Robert Cody added a comment - - edited Also if we have several triggers with the same user, there should be only 1 e-mail sent to each user.
          Hide
          slide_o_mix Alex Earl added a comment -

          Yes, it was committed. This issue was for a single trigger. If the user shows up in multiple triggers, they will get multiple emails. That will not change.

          Show
          slide_o_mix Alex Earl added a comment - Yes, it was committed. This issue was for a single trigger. If the user shows up in multiple triggers, they will get multiple emails. That will not change.
          slide_o_mix Alex Earl made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          slide_o_mix Alex Earl made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Hide
          vitorg Robert Cody added a comment -

          This patch wasn't committed, see master branch on GitHub - changes are absent.

          Show
          vitorg Robert Cody added a comment - This patch wasn't committed, see master branch on GitHub - changes are absent.
          Hide
          slide_o_mix Alex Earl added a comment -

          A simpler change was made to use a Set instead of a List. It still only affects a single trigger.

          Show
          slide_o_mix Alex Earl added a comment - A simpler change was made to use a Set instead of a List. It still only affects a single trigger.
          Hide
          vitorg Robert Cody added a comment -

          I see now. Why there will be no change to make e-mails unique across all triggers?

          Show
          vitorg Robert Cody added a comment - I see now. Why there will be no change to make e-mails unique across all triggers?
          Hide
          slide_o_mix Alex Earl added a comment -

          The whole point of multiple triggers is to send multiple emails.

          Show
          slide_o_mix Alex Earl added a comment - The whole point of multiple triggers is to send multiple emails.
          Hide
          vitorg Robert Cody added a comment -

          It was already discussed somewhere? I can't find it. But as i see it - the whole point of multiple triggers is to trigger for multiple events and it doesn't refer to e-mails count at all.

          But in most cases triggers produce exactly the same e-mails (however it is just default) and there is no reason to send several same e-mails for the same person. With current UI it's not easy to make e-mails unique across triggers.

          Show
          vitorg Robert Cody added a comment - It was already discussed somewhere? I can't find it. But as i see it - the whole point of multiple triggers is to trigger for multiple events and it doesn't refer to e-mails count at all. But in most cases triggers produce exactly the same e-mails (however it is just default) and there is no reason to send several same e-mails for the same person. With current UI it's not easy to make e-mails unique across triggers.
          Hide
          slide_o_mix Alex Earl added a comment -

          The triggers each allow you to specify a list of people to send to, a different subject, a different body, even different attachment settings, so how is it hard to create a unique email per trigger?

          Show
          slide_o_mix Alex Earl added a comment - The triggers each allow you to specify a list of people to send to, a different subject, a different body, even different attachment settings, so how is it hard to create a unique email per trigger?
          Hide
          vitorg Robert Cody added a comment -

          Yes, that's my point - all trigger e-mails can be customized, so in current UI there is no clear way to resolve the problem. The problem is - there are many triggers and different subscribers, but some subscribers specified in several triggers and all triggers use base template (empty body, subject etc.), so if several triggers run in same time, user will receive several duplicate e-mails. And in current UI there is no way to prevent it.

          The good way to fix this is - if trigger doesn't override any field (so it generates completely same e-mail as another trigger), then there should be only 1 such e-mail for specific subscriber. In more general case - we need to collapse generated e-mails by hash(body/subject/etc.) and then make recipient list unique by passing it in set.

          Show
          vitorg Robert Cody added a comment - Yes, that's my point - all trigger e-mails can be customized, so in current UI there is no clear way to resolve the problem. The problem is - there are many triggers and different subscribers, but some subscribers specified in several triggers and all triggers use base template (empty body, subject etc.), so if several triggers run in same time, user will receive several duplicate e-mails. And in current UI there is no way to prevent it. The good way to fix this is - if trigger doesn't override any field (so it generates completely same e-mail as another trigger), then there should be only 1 such e-mail for specific subscriber. In more general case - we need to collapse generated e-mails by hash(body/subject/etc.) and then make recipient list unique by passing it in set.
          Hide
          slide_o_mix Alex Earl added a comment -

          That might meet YOUR specific need, but the general usage of the plugin would suffer from the change. Each trigger is treated completely separately on purpose.

          Show
          slide_o_mix Alex Earl added a comment - That might meet YOUR specific need, but the general usage of the plugin would suffer from the change. Each trigger is treated completely separately on purpose.
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 138174 ] JNJira + In-Review [ 204699 ]

            People

            • Assignee:
              slide_o_mix Alex Earl
              Reporter:
              csleight csleight
            • Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: