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

Triggers two mails: UNSTABLE and REGRESSION

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • email-ext-plugin
    • Jenkins 1.513
      Email-ext 2.28

      In my job configuration, I selected all triggers, because I want as much information as possible (see screenshot). But I received two emails for the same build. IMHO, this is not the expected behavior (or it is a bug) because a build with REGRESSIONS inevitably means that the build is UNSTABLE.

      Build step 'Publish JUnit test result report' changed build result to UNSTABLE
      Email was triggered for: Unstable
      Email was triggered for: Regression
      Sending email for trigger: Unstable
      Sending email to: stephane.bruckert@........
      Sending email for trigger: Regression
      Sending email to: stephane.bruckert@........
      Finished: UNSTABLE

      REGRESSION has a reason to be triggered because new unit tests failed.
      However, UNSTABLE shouldn't be triggered because REGRESSION should override it. The same applies to STILL UNSTABLE.

      The problem looks to be in src/main/java/hudson/plugins/emailext/plugins/trigger/RegressionTrigger.java. Contrary to NthFailureTrigger.java or StillUnstableTrigger.java, it doesn't call the method addTriggerNameToReplace in order to discard the previous triggers.

      So, the descriptor of RegressionTrigger.java should have a constructor with the following content:

      RegressionTrigger.java
      public DescriptorImpl() {
          addTriggerNameToReplace(UnstableTrigger.TRIGGER_NAME);
          addTriggerNameToReplace(StillUnstableTrigger.TRIGGER_NAME);
      }
      

      I am waiting for you to agree that this is a bug, before letting me correct it on the repository, if you agree.

      Thank you very much!

      Edit:
      It is the same between the "Still Unstable" and "Improvement" triggers:

      Build step 'Publish JUnit test result report' changed build result to UNSTABLE
      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.
      Sending email for trigger: Still Unstable
      Sending email to: stephane.bruckert@........
      Sending email for trigger: Improvement
      Sending email to: stephane.bruckert@........
      Finished: UNSTABLE

      The improvement trigger is only triggered when there are LESS failing tests. So it is meant to be UNSTABLE or STILL UNSTABLE. Otherwise it would be SUCCESS or FIXED.

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

              Created:
              Updated:
              Resolved: