• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • timestamper-plugin
    • None

      Reported by dankirkd:

      Has the ability to switch between System clock time, Elapsed time and None been removed from the sidebar? I don't see it now that I've updated from 1.7.2 to the latest version 1.8.5.

          [JENKINS-38085] Settings not appearing in the sidebar

          I am still able to see it with Jenkins 2.21 and Timestamper 1.8.5. Can you provide a little more information?

          • Which version of Jenkins are you running?
          • Any stack trace in the Jenkins log?
          • Any message in the JavaScript console in the browser?
          • Are you running another plugin which alters the sidebar or changes the look of Jenkins?

          Steven G Brown added a comment - I am still able to see it with Jenkins 2.21 and Timestamper 1.8.5. Can you provide a little more information? Which version of Jenkins are you running? Any stack trace in the Jenkins log? Any message in the JavaScript console in the browser? Are you running another plugin which alters the sidebar or changes the look of Jenkins?

          • Which version of Jenkins are you running?
            1.658
          • Any stack trace in the Jenkins log?
            No
          • Any message in the JavaScript console in the browser?
            09:48:32.511 Blocked loading mixed active content "http://www.blablablah.com:8080/static/1.8.5/plugin/timestamper/annotator.js"
          • Are you running another plugin which alters the sidebar or changes the look of Jenkins?
            Not that I know of. Nothing changed on that front.

          So it seems like it might be due to trying to access the annotator.js script via HTTP instead of HTTPS?

          Daniel Kirkdorffer added a comment - Which version of Jenkins are you running? 1.658 Any stack trace in the Jenkins log? No Any message in the JavaScript console in the browser? 09:48:32.511 Blocked loading mixed active content "http://www.blablablah.com:8080/static/1.8.5/plugin/timestamper/annotator.js" Are you running another plugin which alters the sidebar or changes the look of Jenkins? Not that I know of. Nothing changed on that front. So it seems like it might be due to trying to access the annotator.js script via HTTP instead of HTTPS?

          Code changed in jenkins
          User: Steven Brown
          Path:
          src/main/java/hudson/plugins/timestamper/annotator/TimestampAnnotatorFactory2.java
          src/main/resources/hudson/plugins/timestamper/annotator/TimestampAnnotatorFactory2/script.js
          src/main/resources/hudson/plugins/timestamper/annotator/TimestampAnnotatorFactory2/style.css
          src/main/webapp/annotator.js
          src/main/webapp/style.css
          http://jenkins-ci.org/commit/timestamper-plugin/bb7e2ce76a86127ffa3de95a4aec9d6419a38412
          Log:
          JENKINS-38085 Revert to default way of loading the script and CSS

          A custom approach was previously used to load the script and CSS for displaying
          the timestamps. It caused the script and CSS to be reloaded when the Timestamper
          plugin is upgraded or downgraded, rather than being cached for the next day.

          It seems this doesn't work for everyone (JENKINS-38085), so I'm reverting back
          to the default behaviour. Note that it is known to work with HTTPS and through a
          HTTPS proxy (JENKINS-35315) at least for some users.

          As a result, the TimestampAnnotatorFactory class will have to be manually
          renamed each time the script or CSS is changed in a new release.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Steven Brown Path: src/main/java/hudson/plugins/timestamper/annotator/TimestampAnnotatorFactory2.java src/main/resources/hudson/plugins/timestamper/annotator/TimestampAnnotatorFactory2/script.js src/main/resources/hudson/plugins/timestamper/annotator/TimestampAnnotatorFactory2/style.css src/main/webapp/annotator.js src/main/webapp/style.css http://jenkins-ci.org/commit/timestamper-plugin/bb7e2ce76a86127ffa3de95a4aec9d6419a38412 Log: JENKINS-38085 Revert to default way of loading the script and CSS A custom approach was previously used to load the script and CSS for displaying the timestamps. It caused the script and CSS to be reloaded when the Timestamper plugin is upgraded or downgraded, rather than being cached for the next day. It seems this doesn't work for everyone ( JENKINS-38085 ), so I'm reverting back to the default behaviour. Note that it is known to work with HTTPS and through a HTTPS proxy ( JENKINS-35315 ) at least for some users. As a result, the TimestampAnnotatorFactory class will have to be manually renamed each time the script or CSS is changed in a new release.

          Daniel Kirkdorffer added a comment - - edited

          I'm not sure I understand the issue here, and why TimestampAnnotatorFactory has to be renamed. Why can't you add a "?t=<timestamp>" to your Javascript reference instead to ensure it is recognized as changed, or something similar? Or, why can't the reference you had to annotator.js include req.getScheme() so that HTTPS is used? Just throwing out ideas without understanding the problem completely.

          Daniel Kirkdorffer added a comment - - edited I'm not sure I understand the issue here, and why TimestampAnnotatorFactory has to be renamed. Why can't you add a "?t=<timestamp>" to your Javascript reference instead to ensure it is recognized as changed, or something similar? Or, why can't the reference you had to annotator.js include req.getScheme() so that HTTPS is used? Just throwing out ideas without understanding the problem completely.

          Steven G Brown added a comment - - edited

          Jenkins serves the script with this URL:

          https://my.jenkins.host/extensionList/hudson.console.ConsoleAnnotatorFactory/hudson.plugins.timestamper.annotator.TimestampAnnotatorFactory2/script.js
          

          and it expires after a day. This is a problem for plugins because the script from the previous version might still be cached.

          The only way this URL can be changed within the plugin is to rename the TimestampAnnotatorFactory2 class to something else. That's what I plan to do the next time the script changes.

          Other options:

          • Redirect to another URL using a relative path. This is what Timestamper 1.8.5 does, and the new URL includes the plugin version so that upgrading or downgrading the plugin causes the script to be re-downloaded. Now we know that it doesn't work on your system.
          • Redirect to another URL using an absolute path. However, if using a reverse proxy, it must be configured properly or the settings will not appear. (See Jenkins.getRootUrlFromRequest.) I'd rather pick another option that is not sensitive to how the proxy is configured.
          • Turn off the caching altogether by overridding ConsoleAnnotatorFactory.doScriptJs. I considered this, but it seems unfortunate to have the script downloaded every time.

          Ultimately, the best solution would be to have Jenkins include the plugin version or a timestamp in the URL. I've raised JENKINS-38719 to do this.

          Steven G Brown added a comment - - edited Jenkins serves the script with this URL: https://my.jenkins.host/extensionList/hudson.console.ConsoleAnnotatorFactory/hudson.plugins.timestamper.annotator.TimestampAnnotatorFactory2/script.js and it expires after a day. This is a problem for plugins because the script from the previous version might still be cached. The only way this URL can be changed within the plugin is to rename the TimestampAnnotatorFactory2 class to something else. That's what I plan to do the next time the script changes. Other options: Redirect to another URL using a relative path. This is what Timestamper 1.8.5 does, and the new URL includes the plugin version so that upgrading or downgrading the plugin causes the script to be re-downloaded. Now we know that it doesn't work on your system. Redirect to another URL using an absolute path. However, if using a reverse proxy, it must be configured properly or the settings will not appear. (See Jenkins.getRootUrlFromRequest .) I'd rather pick another option that is not sensitive to how the proxy is configured. Turn off the caching altogether by overridding ConsoleAnnotatorFactory.doScriptJs . I considered this, but it seems unfortunate to have the script downloaded every time. Ultimately, the best solution would be to have Jenkins include the plugin version or a timestamp in the URL. I've raised JENKINS-38719 to do this.

          Fix released with Timestamper 1.8.6.

          Steven G Brown added a comment - Fix released with Timestamper 1.8.6.

          Confirmed, although it appears the timestamps now render in inverted colors (black text on white), which is distracting to the eye.

          Daniel Kirkdorffer added a comment - Confirmed, although it appears the timestamps now render in inverted colors (black text on white), which is distracting to the eye.

          Confirmed, although it appears the timestamps now render in inverted colors (black text on white), which is distracting to the eye.

          This has been raised as JENKINS-38573.

          Steven G Brown added a comment - Confirmed, although it appears the timestamps now render in inverted colors (black text on white), which is distracting to the eye. This has been raised as JENKINS-38573 .

            stevengbrown Steven G Brown
            stevengbrown Steven G Brown
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: