Problems with email-ext messages after Jenkins upgrade, with both Perforce and Git SCM jobs

417 views
Skip to first unread message

Jim Lloyd

unread,
Jun 13, 2014, 2:29:35 PM6/13/14
to jenkins...@googlegroups.com
Hello. I am new to Jenkins and am trying to make configuration changes to support the addition of new jobs using Git for SCM. Previously the server only had jobs using Perforce for SCM. We were running Jenkins v1.499, which was too old to support the Git related plugins we wanted to install, so we upgraded to Jenkins v1.565, which was the current release at the time. Almost everything is working fine. Previous Perforce jobs and new Git jobs are able to run to successful completion. But we have noticed that emails now sent from jobs that use Perforce are now missing the changelist number and show an invalid date/timestamp. For example:

[null] Dec 31, 1969 3:59:59 PM joedev 
Bug 24409 - .....

Before the upgrade, the email was formated as:

[70468] 2014-05-30 14:56:00 janedev 
Fix for 24328 - ....

We didn't make any changes to either the global settings for Extended E-mail Notification, or for the project specific settings for Editable Email Notification.

We're using just "$DEFAULT_CONTENT" in the Editable Email Notification. The relevant section in our global settings for Extended E-mail Notification contains:

<h4><a href="${BUILD_URL}/changes">Changes:</a></h4>
${CHANGES_SINCE_LAST_SUCCESS, reverse=true, showPaths=true, format="%c<br />", changesFormat="[%r]  %d <strong>%a</strong><br />%m<br />%p", pathFormat="%p<br />"}

I have searched to try to understand why ${CHANGES_SINCE_LAST_SUCCESS} is now partially broken but have so far not found an answer. Can someone help?

Thanks,
Jim

Mark Waite

unread,
Jun 13, 2014, 2:39:29 PM6/13/14
to jenkins...@googlegroups.com
I don't have any help to offer for the specific problem you reported.

I have a general question you might consider.  Since you stayed on an older version that long, I suspect you prefer stability rather than the latest set of features.  You may want to consider choosing the "long term support" release (LTS) instead of the tip of the Jenkins development stream.  The current long term support release is 1.554.2, so it is not dramatically older than the version you chose, but it has been tested more deeply than 1.565.

Mark Waite


--
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.



--
Thanks!
Mark Waite

Slide

unread,
Jun 13, 2014, 3:28:42 PM6/13/14
to Jenkins User Mailing List
Did you upgrade the Perforce plugin at the same time? My guess is something in the Perforce plugin changed, but that is just a guess. Without more information on versions of all the plugins you have mentioned, it will be hard to help out.

slide

Rob Petti

unread,
Jun 15, 2014, 10:03:31 PM6/15/14
to jenkins...@googlegroups.com
Email-ext changed the functions used for getting changeset and timestamp information. Details are here:

Jim Lloyd

unread,
Jun 16, 2014, 2:30:03 PM6/16/14
to jenkins...@googlegroups.com
Thank you Rob, that's exactly the info I need. It's not clear to me when I can expect a public release of the fixed perforce plugin, but at least now I understand specifically what the problem is and see options for how to work around it until there is a new release of the plugin.

-Jim



--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/eZQsgfCSYM4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.

Niksan

unread,
Jun 17, 2014, 4:53:38 AM6/17/14
to jenkins...@googlegroups.com
Hi Jim,

This is what I used before I submitted the PR, just put the following as a system groovy script build step..

import hudson.model.*

///////////////////////////////////////////////////////////////////////////////////////////////////
// calculate all change lists and commiters of all changelists up until the last successful build
///////////////////////////////////////////////////////////////////////////////////////////////////
StringBuffer changeListBuffer = new StringBuffer(); 
AbstractBuild<?, ?> currentBuild = build; 
while( currentBuild!=null && currentBuild.getResult()!=Result.SUCCESS ) {
  def previousBuildCS = currentBuild.getChangeSet()
  if(previousBuildCS.history) {
    for( def entry : previousBuildCS.history ) {
      changeListBuffer.append( "Change <b>" + String.valueOf(entry.change.changeNumber)
                                            + "</b> by <b>" + entry.change.user + "</b> : <i>"
                                            + entry.change.description + "</i><br>" )
    }
  }
  currentBuild = currentBuild.getPreviousBuild(); 
}

def immutableString = changeListBuffer.toString().replace("\n","<br>") 
def paBrokenChangeLists = new ParametersAction([ new StringParameterValue("P4_BROKEN_CHANGELISTS", immutableString) ] )
build.addAction(paBrokenChangeLists)


then just put $P4_BROKEN_CHANGELISTS in your email content, you can add the date in the script also but I didn't need that.

Jim Lloyd

unread,
Jun 18, 2014, 4:36:54 PM6/18/14
to jenkins...@googlegroups.com
On Fri, Jun 13, 2014 at 11:39 AM, Mark Waite <mark.ea...@gmail.com> wrote:
I don't have any help to offer for the specific problem you reported.

I have a general question you might consider.  Since you stayed on an older version that long, I suspect you prefer stability rather than the latest set of features.  You may want to consider choosing the "long term support" release (LTS) instead of the tip of the Jenkins development stream.  The current long term support release is 1.554.2, so it is not dramatically older than the version you chose, but it has been tested more deeply than 1.565.

Mark Waite


Mark, this seems like excellent advice. However, as I have dug into this issue deeper it seems that the problem was introduced in 1.536, so I expect it would still be present in 1.554.2. Does this mean that perhaps I should install LTS 1.532.3? Also, it is not clear to me from the documentation for LTS which plugins would be offered/available with version 1.532.3 (assuming I use the advanced configuration settings for plugins to set the Update Site to  http://updates.jenkins-ci.org/stable/update-center.json). Would I be offered plugins that were stable as of 1.532.3, or would I be offered plugins that matched 1.554.2?

Thanks,
Jim
Reply all
Reply to author
Forward
0 new messages