Email-ext + GitHub Pull Request Builder: Getting empty "developers" and "culprits" lists

564 views
Skip to first unread message

James Chao

unread,
Jul 31, 2014, 6:43:02 PM7/31/14
to jenkins...@googlegroups.com
Hi,

I'm currently using the GitHub Pull Request Builder plugin together with the Email-ext plugin.

For my post-build email, I'm not able to get emails to be sent to "developers" and "culprits". "Requestor" and "Recipient List" (the project default) do work though...

Has anyone else run into this?

====================

Here are the versions of the relevant plugins:
  • GIT client plugin: 1.10.1   
  • GIT plugin: 2.2.3   
  • GitHub API Plugin: 1.55            
  • GitHub plugin: 1.9.1   
  • GitHub Pull Request Builder: 1.12
  • Email Extension Plugin: 2.38.1
Here is my post-build notification set up:



Slide

unread,
Jul 31, 2014, 6:45:06 PM7/31/14
to Jenkins User Mailing List
Can you provide a build log with debug mode enabled in the global config for email-ext? Culprits uses Jenkins core to determine who did what, but uses its own stuff for determining developers (looks at the changelist from the SCM for the job). Is this job kicked off by another job that does the SCM stuff, or is the SCM part of this job?


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Website: http://earl-of-code.com

James Chao

unread,
Jul 31, 2014, 6:53:35 PM7/31/14
to jenkins...@googlegroups.com
Hi slide,

This is kicked off by the Github pull request builder in this job.

Here's the output. Thanks.

FAILURE: At least one test failed.
Build step 'Execute shell' marked build as failure
Checking for post-build
Performing post-build step
Checking if email needs to be generated
Email was triggered for: Always
Email was triggered for: Failure - Any
Sending email for trigger: Failure - Any
NOT overriding default server settings, using Mailer to create session
messageContentType = text/html; charset=UTF-8
Request made to attach build log
Adding recipients from project recipient list
Adding recipients from trigger recipient list
Setting In-Reply-To since last build was not successful
Successfully created MimeMessage
Sending email for trigger: Always
NOT overriding default server settings, using Mailer to create session
messageContentType = text/html; charset=UTF-8
Request made to attach build log
Adding recipients from trigger recipient list
Setting In-Reply-To since last build was not successful
Successfully created MimeMessage
An attempt to send an e-mail to empty list of recipients, ignored.
Some error occured trying to send the email...check the Jenkins log
Finished: FAILURE

Slide

unread,
Jul 31, 2014, 7:18:39 PM7/31/14
to Jenkins User Mailing List
I'm not familiar with the GitHub Pull Request Builder plugin, does it integrate with the Git plugin at all? If you look in the config.xml for the job, is there anything in the SCM section? The email-ext plugin uses the SCM for the build to determine the developers.

James Chao

unread,
Jul 31, 2014, 9:19:07 PM7/31/14
to jenkins...@googlegroups.com
Hi slide,

I do see this scm section in the config.xml file. Does this look right?

  <scm class="hudson.plugins.git.GitSCM" plugin="g...@2.2.3">
    <configVersion>2</configVersion>
    <userRemoteConfigs>
      <hudson.plugins.git.UserRemoteConfig>
        <refspec>+refs/pull/*:refs/remotes/origin/pr/*</refspec>
        <url>g...@github.com:[MY REPO NAME].git</url>
        <credentialsId>[MY CREDENTIALS]</credentialsId>
      </hudson.plugins.git.UserRemoteConfig>
    </userRemoteConfigs>
    <branches>
      <hudson.plugins.git.BranchSpec>
        <name>${sha1}</name>
      </hudson.plugins.git.BranchSpec>
    </branches>
    <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
    <browser class="hudson.plugins.git.browser.FisheyeGitRepositoryBrowser">
      <url></url>
    </browser>
    <submoduleCfg class="list"/>
    <extensions>
      <hudson.plugins.git.extensions.impl.WipeWorkspace/>
      <hudson.plugins.git.extensions.impl.RelativeTargetDirectory>
        <relativeTargetDir>[MY DIR NAME]</relativeTargetDir>
      </hudson.plugins.git.extensions.impl.RelativeTargetDirectory>
      <hudson.plugins.git.extensions.impl.SubmoduleOption>
        <disableSubmodules>false</disableSubmodules>
        <recursiveSubmodules>true</recursiveSubmodules>
        <trackingSubmodules>false</trackingSubmodules>
      </hudson.plugins.git.extensions.impl.SubmoduleOption>
    </extensions>
  </scm>

Slide

unread,
Jul 31, 2014, 10:26:03 PM7/31/14
to Jenkins User Mailing List
Yes, that looks correct. In your email templates, are you adding the change information? If so, does it come out correct?

Jon Schewe

unread,
Aug 1, 2014, 8:01:03 AM8/1/14
to jenkinsci-users
Something else to be aware of. If this is a new branch there will be an empty list of developers and culprits because the plugin only builds up a list of authors on the list of changes. The list of changes comes from the git plugin and on a new branch the list of changes is empty because it can't determine which changes to include.

Slide

unread,
Aug 1, 2014, 7:40:10 PM8/1/14
to Jenkins User Mailing List
If there are no changes, then there is no way for the email-ext to determine developers.

James Chao

unread,
Aug 4, 2014, 11:14:13 AM8/4/14
to jenkins...@googlegroups.com
Hm, yeah this is really strange. $CHANGES is definitely totally empty...this is even for an existing branch (where I just pushed additional changes...).

Jon: can you confirm that changes should not be empty for an existing branch? I'm wondering if it's a limitation of the plugins or if I'm doing something wrong...

David Antliff

unread,
Apr 3, 2016, 10:25:31 PM4/3/16
to Jenkins Users

On Tuesday, August 5, 2014 at 3:14:13 AM UTC+12, James Chao wrote:
Hm, yeah this is really strange. $CHANGES is definitely totally empty...this is even for an existing branch (where I just pushed additional changes...).

Sorry to awaken an old thread. I'm looking into a way for Jenkins to generate emails when a Pull Request job created by the GitHub Pull Request Builder fails. My understanding is that when a pull request is created on github, the changes are put on a brand new branch, even if the target of the PR is an existing branch. If at least two commits are required to determine CHANGES, could this explain why emails are not generated for contributors who "broke the build"?

I'm looking for suggestions of an alternative way for Jenkins to notify contributors in this circumstance, short of putting their email addresses in the default mailing list.

-- David.


Slide

unread,
Apr 4, 2016, 10:55:23 AM4/4/16
to Jenkins Users

You could use the SCRIPT token in the recipient list and then write a groovy script that resolved to the addresses of those who contributed to the build.


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages