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

"Open Task Trend" does not update automatically

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • tasks-plugin
    • None
    • Platform: All, OS: All

      The "Open Task Trend" does not update when fetching normally the project site,
      instead I have to do a full refresh (Ctrl-F5) to obtain a new rendered image. It
      seems that the browser caches the image, a generated query parameter should be
      appended.

          [JENKINS-795] "Open Task Trend" does not update automatically

          Ulli Hafner added a comment -

          From the DEV mailing list:

          Hafner Ullrich wrote:
          > Hi,
          >
          > In the findbugs and tasks plugins I currently update the trend images only for
          new successful builds.
          > There have been some request to change this behavior and always update the graph
          > (see issue https://hudson.dev.java.net/issues/show_bug.cgi?id=795). What is
          the desired
          > way to update these images in Hudson? I copied the code from the Test Report
          plugin, but
          > I'm not sure whether this is the right way? The guard I use is
          >
          > if (request.checkIfModified(owner.getTimestamp(), response) ||
          healthReportBuilder == null)

          { > return; // don't re-create image > }

          The code above is incorrect. The checkIfModified() method has a side
          effect. Namely, when it returns true, it also sets the HTTP Status code
          telling the browser that the browser can keep using its own cache.

          When the method evaluates to false but healtHReportBuilder==null, then
          you end up returning an empty response. You'd have to check this
          separately, and if helthReportBuilder is null you'd have to return 404
          or something.

          Ulli Hafner added a comment - From the DEV mailing list: Hafner Ullrich wrote: > Hi, > > In the findbugs and tasks plugins I currently update the trend images only for new successful builds. > There have been some request to change this behavior and always update the graph > (see issue https://hudson.dev.java.net/issues/show_bug.cgi?id=795 ). What is the desired > way to update these images in Hudson? I copied the code from the Test Report plugin, but > I'm not sure whether this is the right way? The guard I use is > > if (request.checkIfModified(owner.getTimestamp(), response) || healthReportBuilder == null) { > return; // don't re-create image > } The code above is incorrect. The checkIfModified() method has a side effect. Namely, when it returns true, it also sets the HTTP Status code telling the browser that the browser can keep using its own cache. When the method evaluates to false but healtHReportBuilder==null, then you end up returning an empty response. You'd have to check this separately, and if helthReportBuilder is null you'd have to return 404 or something.

          Ulli Hafner added a comment -

          Fixed refresh bug if there are build results from a previous tasks release
          (health report is null). This should fix this issue too (couldn't reproduce this
          bug).

          Ulli Hafner added a comment - Fixed refresh bug if there are build results from a previous tasks release (health report is null). This should fix this issue too (couldn't reproduce this bug).

          Ulli Hafner added a comment -

          Seems to be still present in 1.8.

          Ulli Hafner added a comment - Seems to be still present in 1.8.

          Ulli Hafner added a comment -

          Fixed in tasks plugin 1.9.

          Ulli Hafner added a comment - Fixed in tasks plugin 1.9.

            drulli Ulli Hafner
            danielgalan danielgalan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: