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

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

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: core
    • Labels:
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      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}"/>

        Attachments

          Activity

          Hide
          rfaber rfaber added a comment -

          Created an attachment (id=265)
          Fix

          Show
          rfaber rfaber added a comment - Created an attachment (id=265) Fix
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in hudson
          User: : kohsuke
          Path:
          trunk/hudson/main/core/src/main/java/hudson/model/Job.java
          trunk/hudson/main/core/src/main/resources/hudson/model/View/cc.xml.jelly
          http://fisheye4.cenqua.com/changelog/hudson/?cs=9592
          Log:
          [FIXED JENKINS-1734] applied a patch from rfaber@dev.java.net. In 1.219

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : kohsuke Path: trunk/hudson/main/core/src/main/java/hudson/model/Job.java trunk/hudson/main/core/src/main/resources/hudson/model/View/cc.xml.jelly http://fisheye4.cenqua.com/changelog/hudson/?cs=9592 Log: [FIXED JENKINS-1734] applied a patch from rfaber@dev.java.net. In 1.219
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in hudson
          User: : kohsuke
          Path:
          trunk/www/changelog.html
          http://fisheye4.cenqua.com/changelog/hudson/?cs=9593
          Log:
          noting JENKINS-1734 fix.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : kohsuke Path: trunk/www/changelog.html http://fisheye4.cenqua.com/changelog/hudson/?cs=9593 Log: noting JENKINS-1734 fix.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: