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

Settings not appearing in the sidebar

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Reported by Daniel Kirkdorffer:

      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.

        Attachments

          Issue Links

            Activity

            Hide
            stevengbrown 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?
            Show
            stevengbrown 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?
            Hide
            dankirkd 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?

            Show
            dankirkd 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?
            Hide
            scm_issue_link 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.

            Show
            scm_issue_link 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.
            Hide
            dankirkd 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.

            Show
            dankirkd 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.
            Hide
            stevengbrown 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.

            Show
            stevengbrown 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.
            Hide
            stevengbrown Steven G Brown added a comment -

            Fix released with Timestamper 1.8.6.

            Show
            stevengbrown Steven G Brown added a comment - Fix released with Timestamper 1.8.6.
            Hide
            dankirkd 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.

            Show
            dankirkd 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.
            Hide
            stevengbrown 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.

            Show
            stevengbrown 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 .

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: