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

Plugin doesn't support jenkins URL prefix (--prefix option)

      My jenkins is running behind an apache server, my configuration is very simple and look like this one : https://wiki.jenkins-ci.org/display/JENKINS/Running+Jenkins+behind+Apache

      The plugin doesn't work with this configuration because absolute URL are used into the javascript code, for example in html5-notification.js there is a

      ...new Ajax.Request('/html5-notifier-plugin/list')...

      that refer in my case to http://<HOST>/html5-notifier-plugin/list, but the real list is at http://<HOST>/jenkins/html5-notifier-plugin/list

      It might be a Jenkins way to get the server URL properly and inject it into js files or java generated js code.

      Ludovic.

          [JENKINS-13591] Plugin doesn't support jenkins URL prefix (--prefix option)

          I forked the project from GitHub and tried to fix this problem, If your want me to pull request my modifications you're welcome.

          https://github.com/LudoMeurillon/html5-notifier-plugin

          Ludovic Meurillon added a comment - I forked the project from GitHub and tried to fix this problem, If your want me to pull request my modifications you're welcome. https://github.com/LudoMeurillon/html5-notifier-plugin

          jieryn added a comment -

          I looked at your changes, but I think this will break when the user is not on the main page. Did you test this when inside a specific build's console output, e.g.?

          Once you confirm that this is fixed for all types of URLs, not just with and without a /jenkins context (e.g. behind a proxy) and for all types of pages the user could be on, send a pull request and we'll incorporate it!

          Your code looks good otherwise..

          jieryn added a comment - I looked at your changes, but I think this will break when the user is not on the main page. Did you test this when inside a specific build's console output, e.g.? Once you confirm that this is fixed for all types of URLs, not just with and without a /jenkins context (e.g. behind a proxy) and for all types of pages the user could be on, send a pull request and we'll incorporate it! Your code looks good otherwise..

          I tried my changes locally in two different contexts "mvn hpi:run" and "mvn hpi:run -Dhpi.prefix=jenkins"

          I also tested it on different pages like "Administration", sub menus, "show console" from last build etc...

          Does it seems enough from your point of view ? If you know some complex test case that could be broken, don't hesitate to challenge me

          I will use this version on my team's instance to test accross our views but if it's enough I'll do a pull request as soon as possible.

          Ludovic Meurillon added a comment - I tried my changes locally in two different contexts "mvn hpi:run" and "mvn hpi:run -Dhpi.prefix=jenkins" I also tested it on different pages like "Administration", sub menus, "show console" from last build etc... Does it seems enough from your point of view ? If you know some complex test case that could be broken, don't hesitate to challenge me I will use this version on my team's instance to test accross our views but if it's enough I'll do a pull request as soon as possible.

          jieryn added a comment -

          Thank you for teaching me about -Dhpi.prefix= .. I had never seen that before. I think your tests are exhaustive and good, please submit a pull request.

          jieryn added a comment - Thank you for teaching me about -Dhpi.prefix= .. I had never seen that before. I think your tests are exhaustive and good, please submit a pull request.

          Damien Finck added a comment -

          Damien Finck added a comment - I think we can close this ticket because it is solved here: https://github.com/jenkinsci/html5-notifier-plugin/commit/d190dc4f982124951428ad46ada50f800283fb32

          Gavin Mogan added a comment -

          I am closing this issue as per the last comment and the 1.3 release. Please reopen if it is still an issue.

          Gavin Mogan added a comment - I am closing this issue as per the last comment and the 1.3 release. Please reopen if it is still an issue.

          works as described

          Peter Eisentraut added a comment - works as described

            Unassigned Unassigned
            lmeur Ludovic Meurillon
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: