NOTICE! This is a static HTML version of a legacy ImageJ Trac ticket.

The ImageJ project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Ticket #1794 (closed enhancement: fixed)

Opened 2013-04-10T10:53:54-05:00

Last modified 2013-05-31T16:12:19-05:00

Improve the Stable-Fiji job

Reported by: dscho Owned by: dscho
Priority: minor Milestone: imagej2-b7-ndim-data
Component: Updater Version:
Severity: minor Keywords:
Cc: curtis Blocked By:
Blocking: #1901


At the moment, the Stable-Fiji job runs too often, listing even builds without any changes. Use a ScriptTrigger to avoid superfluous builds.

Speaking of changes: the Groovy Postbuild should allow us to list the changed files in the Recent Changes section by using removeSummary and createSummary (see

Change History

comment:1 Changed 2013-04-24T11:01:11-05:00 by dscho

  • Status changed from new to closed
  • Resolution set to fixed

This was solved in a slightly different way, because the changes are *not* summary entries. Instead, Jenkins'  Changes link triggers a Jelly script that accumulates the  ChangeLogSets of all the  Builds which are parsed by a  ChangeLogParser that gets set by the current Build's  SCM.

Unfortunately, all of this is not really accessible and the ChangeLogParser is persisted via its class name in the build.xml file. Therefore, we cannot simply add a ChangeLogParser class in the Groovy Postbuild script. Further, build.xml only gets written after the Groovy script is executed, and likewise, the ChangeLogParser in that file is ignored; whatever the current Build's SCM said the changes are get put into Jenkins' cache (in case of no SCM, an empty ChangeLogSet is created and the  NullChangeLogParser that simply ignores anything in the changelog.xml file is persisted).

Therefore, we have to play really nasty games, pretending that we're Subversions and faking/accessing all kinds of things.

// This is a deliciously convoluted and fragile hack to force Jenkins to show the
// updated files

// fake a Subversion changelog.xml file
updated = new File(, "../../workspace/updated.txt")
changelog = new File(, "changelog.xml")
changelog.withWriter {
  out ->
    out.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?><log>"
      + "<logentry revision=\""
      + + "\"><date>"
      + new java.util.Date() + "</date><paths>")
    updatedMessage  = ""
    updated.eachLine {
       line ->
         if (line.startsWith("./")) line = line.substring(2)
         if (!".checksums".equals(line)) {
           out.println("<path action=\"M\">" + line + "</path>")
           updatedMessage += line + "\n"
  out.println("</paths><msg>" + updatedMessage + "</msg></logentry></log>")

// get an instance of the SubversionChangeLogParser
baseDir = new File(jenkins.model.Jenkins.getInstance().getRootDir(),
urls = new URL[2]
urls[0] = new File(baseDir, "classes/").toURI().toURL() 
urls[1] = new File(baseDir, "lib/svnkit-1.3.4-hudson-2.jar").toURI().toURL() 
loader = new URLClassLoader(urls,  manager.getClass().getClassLoader())
svn = loader.loadClass("hudson.scm.SubversionChangeLogParser").newInstance()

// force the current build to take that parser, parse the changelog.xml and
// force it down AbstractBuild's throat, too
abstractBuildClass =
scmField = abstractBuildClass.getDeclaredField("scm")
scmField.set(, svn)

changeSet = svn.parse(, changelog)
changeSetField = abstractBuildClass.getDeclaredField("changeSet")
import java.lang.ref.WeakReference
if (changeSetField.getDeclaringClass().isAssignableFrom(WeakReference.class))
  changeSet = new WeakReference(changeSet)
changeSetField.set(, changeSet)

comment:2 Changed 2013-05-31T16:07:49-05:00 by bdezonia

  • Blocking 1901 added; 1347 removed

comment:3 Changed 2013-05-31T16:12:19-05:00 by bdezonia

  • Milestone changed from imagej2-b8-analysis to imagej2-b7-ndim-data