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

DevelopersRecipentProvider does not return value

    • Icon: Task Task
    • Resolution: Not A Defect
    • Icon: Major Major
    • email-ext-plugin
    • None
    •  Jenkins 2.32, Email-ext Plugin version 2.52, Git Client plugin 2.1.0, Git plugin 3.0.1

      email-ext-plugin
      This pipeline attempts to send some notifications when a build starts:
      https://github.com/bitwiseman/hermann/tree/issue/developers-recipient-provider

      The pipeline step looks like this:

      emailext (
            subject: "STARTED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'",
            body: """<p>STARTED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':</p>
              <p>Check console output at &QUOT;<a href='${env.BUILD_URL}'>${env.JOB_NAME} [${env.BUILD_NUMBER}]</a>&QUOT;</p>""",
            recipientProviders: [[$class: 'DevelopersRecipientProvider']]
          )
      

      This fails to send email. But it appears both of the following work:

      emailext (
            subject: "STARTED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'",
            body: """<p>STARTED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':</p>
              <p>Check console output at &QUOT;<a href='${env.BUILD_URL}'>${env.JOB_NAME} [${env.BUILD_NUMBER}]</a>&QUOT;</p>""",
            recipientProviders: [[$class: 'RequesterRecipientProvider']]
          )
      
      emailext (
            to: 'bitwiseman@bitwiseman.com', 
            subject: "STARTED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'",
            body: """<p>STARTED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':</p>
              <p>Check console output at &QUOT;<a href='${env.BUILD_URL}'>${env.JOB_NAME} [${env.BUILD_NUMBER}]</a>&QUOT;</p>""",
            recipientProviders: [[$class: 'DevelopersRecipientProvider']]
        )
      

          [JENKINS-40426] DevelopersRecipentProvider does not return value

          bitwiseman and davidvanlaatum:
          Since I just stumbled about this issue and had some naive suspicion, I quickly tried your example/reproducer (with everything extremely up to date, but using SVN instead of GIT):

          • My naive suspicion was confirmed, that it works as expected (and thus sends the email to the committer) – except for the very first build (and I assume also in case there was some severe SCM update problem in the previous build).
          • Why? Because in such a case (or cases considering the aforementioned assumption) the changes section of the build is AFAIK always empty and so the email-ext plugin cannot calculate the committing developers to notify at all.

          Therefore I guess this issue should be rather solved with "confirmed" or so?

          Reinhold Füreder added a comment - bitwiseman and davidvanlaatum : Since I just stumbled about this issue and had some naive suspicion, I quickly tried your example/reproducer (with everything extremely up to date, but using SVN instead of GIT): My naive suspicion was confirmed, that it works as expected (and thus sends the email to the committer) – except for the very first build (and I assume also in case there was some severe SCM update problem in the previous build). Why? Because in such a case (or cases considering the aforementioned assumption) the changes section of the build is AFAIK always empty and so the email-ext plugin cannot calculate the committing developers to notify at all. Therefore I guess this issue should be rather solved with "confirmed" or so?

            davidvanlaatum David van Laatum
            bitwiseman Liam Newman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: