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

plugin takes developers for culprits only from first upstream build if build was triggered by more than one upstream task

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: email-ext-plugin
    • Labels:
      None
    • Environment:
      jenkins 2.7.4, email ext plugin 2.58
    • Similar Issues:
    • Released As:
      2.79

      Description

      I have downstream job. When this job is triggered by more than one upstream builds it takes developers only from first build.

      My setup is jobA->jobB

      If jobB with some run number x is triggered by jobA with number y and number y+1, and jobB x fails ext email plugin takes developers from jobA x build for culprits list and developers from joB x+1 build do not receive email about failed downstream job. 

        Attachments

          Issue Links

            Activity

            Hide
            slide_o_mix Alex Earl added a comment -

            I'm not sure I understand the issue here. jobA is run twice and it triggers TWO runs of jobB or just one? Which recipient provider are you using in your jobB? If I assume UpstreamCommitters, then the following code is used: https://github.com/jenkinsci/email-ext-plugin/blob/master/src/main/java/hudson/plugins/emailext/plugins/recipients/UpstreamComitterRecipientProvider.java#L51

             

            This uses the UpstreamCause to determine what triggered the build, this should resolve to the correct upstream instance of jobA if two jobB's are triggered (one for each trigger of jobA). If only one jobB is triggered, then only one jobA will be the upstream cause.

            Show
            slide_o_mix Alex Earl added a comment - I'm not sure I understand the issue here. jobA is run twice and it triggers TWO runs of jobB or just one? Which recipient provider are you using in your jobB? If I assume UpstreamCommitters, then the following code is used:  https://github.com/jenkinsci/email-ext-plugin/blob/master/src/main/java/hudson/plugins/emailext/plugins/recipients/UpstreamComitterRecipientProvider.java#L51   This uses the UpstreamCause to determine what triggered the build, this should resolve to the correct upstream instance of jobA if two jobB's are triggered (one for each trigger of jobA). If only one jobB is triggered, then only one jobA will be the upstream cause.
            Hide
            mixail_ianchikov Mikhail Ianchikov added a comment -

            It looks like this:

            Show
            mixail_ianchikov Mikhail Ianchikov added a comment - It looks like this:
            Hide
            slide_o_mix Alex Earl added a comment -

            Hmmm, interesting. I'll try and figure out how to create a test that does this.

            Show
            slide_o_mix Alex Earl added a comment - Hmmm, interesting. I'll try and figure out how to create a test that does this.
            Hide
            andreybelyaevskiy Andrey Belyaevskiy added a comment - - edited

            Oh=) it very easy.

            What we have: 

            1. #14345, #14356 - 2 consecutive runs of our jobA - its our build job (build of c++ project)
            2. #9579 - first failed run of our jobB - its test job (runs some tests on build from jobA)

            We have limited resources and our jobA takes much time (for our resources), so to make more builds (for further testing) I setup 

            • jobA - allow simultaneous builds (on different nodes - with throttle concurrent build option enabled), not waiting for downstream job completion
            • jobB  - same settings

            While reading your comment I feel that issue can be in triggering jobB by 2 jobAs' runs but by the moment it was ok for us - except of issues with emailing in failure cases. Its ok for me to combine commiters of #14356 and #14357  to send them email to notify some broke tests.

            Show
            andreybelyaevskiy Andrey Belyaevskiy added a comment - - edited Oh=) it very easy. What we have:  #14345, #14356 - 2 consecutive runs of our jobA - its our build job (build of c++ project) #9579 - first failed run of our jobB - its test job (runs some tests on build from jobA) We have limited resources and our jobA takes much time (for our resources), so to make more builds (for further testing) I setup  jobA - allow simultaneous builds (on different nodes - with throttle concurrent build option enabled), not waiting for downstream job completion jobB  - same settings While reading your comment I feel that issue can be in triggering jobB by 2 jobAs' runs but by the moment it was ok for us - except of issues with emailing in failure cases. Its ok for me to combine commiters of #14356 and #14357  to send them email to notify some broke tests.
            Hide
            slide_o_mix Alex Earl added a comment -

            The issue I think is that I use context.getRun().getCause(Cause.UpstreamCause.class). This will return the first occurrence of the Cause.UpstreamCause instance in the causes list. This is most likely only going to be the first jobA. I may need to switch to Run<?,?>.getCauses and loop over looking for all UpstreamCause instances. I'll play around with it.

            Show
            slide_o_mix Alex Earl added a comment - The issue I think is that I use context.getRun().getCause(Cause.UpstreamCause.class). This will return the first occurrence of the Cause.UpstreamCause instance in the causes list. This is most likely only going to be the first jobA. I may need to switch to Run<?,?>.getCauses and loop over looking for all UpstreamCause instances. I'll play around with it.
            Hide
            basil Basil Crow added a comment -

            Fixed in jenkinsci/email-ext-plugin#254.

            Incremental build 2.79-rc1402.c6a343a16f6c is available for testing. The incremental build is available from: https://repo.jenkins-ci.org/incrementals/org/jenkins-ci/plugins/email-ext/2.79-rc1402.c6a343a16f6c/

            Andrey Belyaevskiy, can you please test the incremental build and confirm the issue is resolved? For instructions on how to install a custom build, see: https://www.jenkins.io/doc/book/managing/plugins/#advanced-installation

            Show
            basil Basil Crow added a comment - Fixed in jenkinsci/email-ext-plugin#254 . Incremental build 2.79-rc1402.c6a343a16f6c is available for testing. The incremental build is available from: https://repo.jenkins-ci.org/incrementals/org/jenkins-ci/plugins/email-ext/2.79-rc1402.c6a343a16f6c/ Andrey Belyaevskiy , can you please test the incremental build and confirm the issue is resolved? For instructions on how to install a custom build, see: https://www.jenkins.io/doc/book/managing/plugins/#advanced-installation
            Hide
            basil Basil Crow added a comment -

            Released in 2.79.

            Show
            basil Basil Crow added a comment - Released in 2.79 .

              People

              Assignee:
              basil Basil Crow
              Reporter:
              andreybelyaevskiy Andrey Belyaevskiy
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: