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

cc.xml reports incorrect "lastBuildLabel" and "lastBuildTime"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • Platform: All, OS: All

      To reproduce: open http://server:port/cc.xml and note the value of the
      lastBuildLabel and lastBuildTime elements. Start a new build of a project and
      immediately reload the cc.xml url (before the build is done). Notice that the
      lastBuildLabel and lastBuildTime has been incremented, but lastBuildStatus
      reports the status of the last complete build.

      The correct behavior would be to have lastBuildLabel, lastBuildTime and
      lastBuildStatus report the state of the latest /completed/ build.

      The current behavior causes CCTray to show a message reporting a successful
      build when Hudson starts building, and not giving any report when Hudson
      finishes building.

      A simple fix is to add
      public RunT getLastCompletedBuild()

      { RunT r = getLastBuild(); while(r!=null && r.isBuilding()) r=r.getPreviousBuild(); return r; }

      to Job and use that instead of lastBuild in cc.xml.jelly:
      <j:set var="lb" value="${p.lastBuild}"/>

            Unassigned Unassigned
            rfaber rfaber
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: