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

Triggers not reported in email

    XMLWordPrintable

Details

    Description

      Some interesting triggers were implemented in this plugin: improvement, regression. The problem is that they never appear in the subject of the emails.

      Example for the Improvement trigger, see the following log output:

       
      Email was triggered for: Unstable
      Email was triggered for: Improvement
      Email was triggered for: Still Unstable
      Trigger Unstable was overridden by another trigger and will not send an email.
      Trigger Unstable was overridden by another trigger and will not send an email.
      Trigger Still Unstable was overridden by another trigger and will not send an email.
      Sending email for trigger: Improvement
      

      The subject of the email were:

       PROJECT_1 #524: Still Unstable

      instead of :

       PROJECT_1 #524: Improvement

      And it's the same with the Regression trigger:

      Email was triggered for: Unstable
      Email was triggered for: Regression
      Trigger Unstable was overridden by another trigger and will not send an email.
      Trigger Still Unstable was overridden by another trigger and will not send an email.
      Sending email for trigger: Regression
      

      Result:

      PROJECT_2 #144: Unstable

      Instead of:

      PROJECT_2 #144: Regression

      As for the PROJECT_2, here is the end of the log:

      Testcase: pauseTest[5] took 0,406 sec
      Testcase: noTest took 0 sec
      Testcase: noTest[0] took 0,157 sec
      Testcase: noTest[1] took 0,655 sec
      Testcase: noTest[2] took 0 sec
      Test com.****.***.*** FAILED
         Done!
      Recording test results
      Build step 'Publish JUnit test result report' changed build result to UNSTABLE
      Email was triggered for: Unstable
      Email was triggered for: Regression
      Trigger Unstable was overridden by another trigger and will not send an email.
      Trigger Still Unstable was overridden by another trigger and will not send an email.
      Sending email for trigger: Regression
      Sending email to: ...@...
      Finished: UNSTABLE		
      

      Tell me if you need another part of the config.xml file. The whole thing were too long.

      build.xml
      <hudson.plugins.emailext.ExtendedEmailPublisher plugin="email-ext@2.32">
            <recipientList>...@...</recipientList>
            <configuredTriggers>
              <hudson.plugins.emailext.plugins.trigger.UnstableTrigger>
                <email>
                  <recipientList></recipientList>
                  <subject>$PROJECT_DEFAULT_SUBJECT</subject>
                  <body>$PROJECT_DEFAULT_CONTENT</body>
                  <sendToDevelopers>false</sendToDevelopers>
                  <sendToRequester>false</sendToRequester>
                  <includeCulprits>false</includeCulprits>
                  <sendToRecipientList>true</sendToRecipientList>
                  <attachmentsPattern></attachmentsPattern>
                  <attachBuildLog>false</attachBuildLog>
                  <compressBuildLog>false</compressBuildLog>
                  <replyTo></replyTo>
                </email>
              </hudson.plugins.emailext.plugins.trigger.UnstableTrigger>
              <hudson.plugins.emailext.plugins.trigger.StillFailingTrigger>
                <email>
                  <recipientList></recipientList>
                  <subject>$PROJECT_DEFAULT_SUBJECT</subject>
                  <body>$PROJECT_DEFAULT_CONTENT</body>
                  <sendToDevelopers>false</sendToDevelopers>
                  <sendToRequester>false</sendToRequester>
                  <includeCulprits>false</includeCulprits>
                  <sendToRecipientList>true</sendToRecipientList>
                  <attachmentsPattern></attachmentsPattern>
                  <attachBuildLog>false</attachBuildLog>
                  <compressBuildLog>false</compressBuildLog>
                  <replyTo></replyTo>
                </email>
              </hudson.plugins.emailext.plugins.trigger.StillFailingTrigger>
              <hudson.plugins.emailext.plugins.trigger.ImprovementTrigger>
                <email>
                  <recipientList></recipientList>
                  <subject>$PROJECT_DEFAULT_SUBJECT</subject>
                  <body>$PROJECT_DEFAULT_CONTENT</body>
                  <sendToDevelopers>false</sendToDevelopers>
                  <sendToRequester>false</sendToRequester>
                  <includeCulprits>false</includeCulprits>
                  <sendToRecipientList>true</sendToRecipientList>
                  <attachmentsPattern></attachmentsPattern>
                  <attachBuildLog>false</attachBuildLog>
                  <compressBuildLog>false</compressBuildLog>
                  <replyTo></replyTo>
                </email>
              </hudson.plugins.emailext.plugins.trigger.ImprovementTrigger>
              <hudson.plugins.emailext.plugins.trigger.FirstFailureTrigger>
                <email>
                  <recipientList></recipientList>
                  <subject>$PROJECT_DEFAULT_SUBJECT</subject>
                  <body>$PROJECT_DEFAULT_CONTENT</body>
                  <sendToDevelopers>false</sendToDevelopers>
                  <sendToRequester>false</sendToRequester>
                  <includeCulprits>false</includeCulprits>
                  <sendToRecipientList>true</sendToRecipientList>
                  <attachmentsPattern></attachmentsPattern>
                  <attachBuildLog>false</attachBuildLog>
                  <compressBuildLog>false</compressBuildLog>
                  <replyTo></replyTo>
                </email>
                <failureCount>1</failureCount>
              </hudson.plugins.emailext.plugins.trigger.FirstFailureTrigger>
              <hudson.plugins.emailext.plugins.trigger.StillUnstableTrigger>
                <email>
                  <recipientList></recipientList>
                  <subject>$PROJECT_DEFAULT_SUBJECT</subject>
                  <body>$PROJECT_DEFAULT_CONTENT</body>
                  <sendToDevelopers>false</sendToDevelopers>
                  <sendToRequester>false</sendToRequester>
                  <includeCulprits>false</includeCulprits>
                  <sendToRecipientList>true</sendToRecipientList>
                  <attachmentsPattern></attachmentsPattern>
                  <attachBuildLog>false</attachBuildLog>
                  <compressBuildLog>false</compressBuildLog>
                  <replyTo></replyTo>
                </email>
              </hudson.plugins.emailext.plugins.trigger.StillUnstableTrigger>
              <hudson.plugins.emailext.plugins.trigger.NotBuiltTrigger>
                <email>
                  <recipientList></recipientList>
                  <subject>$PROJECT_DEFAULT_SUBJECT</subject>
                  <body>$PROJECT_DEFAULT_CONTENT</body>
                  <sendToDevelopers>false</sendToDevelopers>
                  <sendToRequester>false</sendToRequester>
                  <includeCulprits>false</includeCulprits>
                  <sendToRecipientList>true</sendToRecipientList>
                  <attachmentsPattern></attachmentsPattern>
                  <attachBuildLog>false</attachBuildLog>
                  <compressBuildLog>false</compressBuildLog>
                  <replyTo></replyTo>
                </email>
              </hudson.plugins.emailext.plugins.trigger.NotBuiltTrigger>
              <hudson.plugins.emailext.plugins.trigger.RegressionTrigger>
                <email>
                  <recipientList></recipientList>
                  <subject>$PROJECT_DEFAULT_SUBJECT</subject>
                  <body>$PROJECT_DEFAULT_CONTENT</body>
                  <sendToDevelopers>false</sendToDevelopers>
                  <sendToRequester>false</sendToRequester>
                  <includeCulprits>false</includeCulprits>
                  <sendToRecipientList>true</sendToRecipientList>
                  <attachmentsPattern></attachmentsPattern>
                  <attachBuildLog>false</attachBuildLog>
                  <compressBuildLog>false</compressBuildLog>
                  <replyTo></replyTo>
                </email>
              </hudson.plugins.emailext.plugins.trigger.RegressionTrigger>
              <hudson.plugins.emailext.plugins.trigger.FailureTrigger>
                <email>
                  <recipientList></recipientList>
                  <subject>$PROJECT_DEFAULT_SUBJECT</subject>
                  <body>$PROJECT_DEFAULT_CONTENT</body>
                  <sendToDevelopers>false</sendToDevelopers>
                  <sendToRequester>false</sendToRequester>
                  <includeCulprits>false</includeCulprits>
                  <sendToRecipientList>true</sendToRecipientList>
                  <attachmentsPattern></attachmentsPattern>
                  <attachBuildLog>false</attachBuildLog>
                  <compressBuildLog>false</compressBuildLog>
                  <replyTo></replyTo>
                </email>
              </hudson.plugins.emailext.plugins.trigger.FailureTrigger>
              <hudson.plugins.emailext.plugins.trigger.FixedTrigger>
                <email>
                  <recipientList></recipientList>
                  <subject>$PROJECT_DEFAULT_SUBJECT</subject>
                  <body>$PROJECT_DEFAULT_CONTENT</body>
                  <sendToDevelopers>false</sendToDevelopers>
                  <sendToRequester>false</sendToRequester>
                  <includeCulprits>false</includeCulprits>
                  <sendToRecipientList>true</sendToRecipientList>
                  <attachmentsPattern></attachmentsPattern>
                  <attachBuildLog>false</attachBuildLog>
                  <compressBuildLog>false</compressBuildLog>
                  <replyTo></replyTo>
                </email>
              </hudson.plugins.emailext.plugins.trigger.FixedTrigger>
              <hudson.plugins.emailext.plugins.trigger.SecondFailureTrigger>
                <email>
                  <recipientList></recipientList>
                  <subject>$PROJECT_DEFAULT_SUBJECT</subject>
                  <body>$PROJECT_DEFAULT_CONTENT</body>
                  <sendToDevelopers>false</sendToDevelopers>
                  <sendToRequester>false</sendToRequester>
                  <includeCulprits>false</includeCulprits>
                  <sendToRecipientList>true</sendToRecipientList>
                  <attachmentsPattern></attachmentsPattern>
                  <attachBuildLog>false</attachBuildLog>
                  <compressBuildLog>false</compressBuildLog>
                  <replyTo></replyTo>
                </email>
                <failureCount>2</failureCount>
              </hudson.plugins.emailext.plugins.trigger.SecondFailureTrigger>
            </configuredTriggers>
            <contentType>default</contentType>
            <defaultSubject>$DEFAULT_SUBJECT</defaultSubject>
            <defaultContent>$DEFAULT_CONTENT</defaultContent>
            <attachmentsPattern></attachmentsPattern>
            <presendScript></presendScript>
            <attachBuildLog>false</attachBuildLog>
            <compressBuildLog>false</compressBuildLog>
            <replyTo>...@...</replyTo>
            <saveOutput>true</saveOutput>
          </hudson.plugins.emailext.ExtendedEmailPublisher>
      

      Attachments

        Activity

          slide_o_mix Alex Earl added a comment -

          The difficulty is the way that tokens are used. I think the easiest thing might to try and add it as an environment variable, but I'll look into it more.

          slide_o_mix Alex Earl added a comment - The difficulty is the way that tokens are used. I think the easiest thing might to try and add it as an environment variable, but I'll look into it more.

          Code changed in jenkins
          User: slide
          Path:
          src/main/java/hudson/plugins/emailext/AttachmentUtils.java
          src/main/java/hudson/plugins/emailext/ExtendedEmailPublisher.java
          src/main/java/hudson/plugins/emailext/ExtendedEmailPublisherContext.java
          src/main/java/hudson/plugins/emailext/plugins/ContentBuilder.java
          src/main/java/hudson/plugins/emailext/plugins/content/TriggerNameContent.java
          src/test/java/hudson/plugins/emailext/plugins/ContentBuilderTest.java
          http://jenkins-ci.org/commit/email-ext-plugin/a42c3152c5f0322082caf7dd8ffd979d7cef807c
          Log:
          FIXED JENKINS-20265

          Added TRIGGER_NAME token

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: slide Path: src/main/java/hudson/plugins/emailext/AttachmentUtils.java src/main/java/hudson/plugins/emailext/ExtendedEmailPublisher.java src/main/java/hudson/plugins/emailext/ExtendedEmailPublisherContext.java src/main/java/hudson/plugins/emailext/plugins/ContentBuilder.java src/main/java/hudson/plugins/emailext/plugins/content/TriggerNameContent.java src/test/java/hudson/plugins/emailext/plugins/ContentBuilderTest.java http://jenkins-ci.org/commit/email-ext-plugin/a42c3152c5f0322082caf7dd8ffd979d7cef807c Log: FIXED JENKINS-20265 Added TRIGGER_NAME token

          Code changed in jenkins
          User: slide
          Path:
          src/main/java/hudson/plugins/emailext/plugins/content/TriggerNameContent.java
          src/test/java/hudson/plugins/emailext/plugins/content/TriggerNameContentTest.java
          http://jenkins-ci.org/commit/email-ext-plugin/e2b1e77416cdecec9fa49fdc5334637be8f8b7ae
          Log:
          Fix JENKINS-20265

          Added new content TRIGGER_NAME that will be replaced with the name of the
          trigger that caused the email.

          Compare: https://github.com/jenkinsci/email-ext-plugin/compare/c70cb5482d03...e2b1e77416cd

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: slide Path: src/main/java/hudson/plugins/emailext/plugins/content/TriggerNameContent.java src/test/java/hudson/plugins/emailext/plugins/content/TriggerNameContentTest.java http://jenkins-ci.org/commit/email-ext-plugin/e2b1e77416cdecec9fa49fdc5334637be8f8b7ae Log: Fix JENKINS-20265 Added new content TRIGGER_NAME that will be replaced with the name of the trigger that caused the email. Compare: https://github.com/jenkinsci/email-ext-plugin/compare/c70cb5482d03...e2b1e77416cd
          slide_o_mix Alex Earl added a comment -

          Added TRIGGER_NAME token that can be used to display the trigger that caused the email.

          slide_o_mix Alex Earl added a comment - Added TRIGGER_NAME token that can be used to display the trigger that caused the email.

          Perfect, thank you!

          stephanebruckert Stéphane Bruckert added a comment - Perfect, thank you!

          People

            slide_o_mix Alex Earl
            stephanebruckert Stéphane Bruckert
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: