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

Column extensions: job.url in column.jelly is wrong in non-default views

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Not A Defect
    • core
    • None

    Description

      See https://issues.jenkins-ci.org/browse/JENKINS-23623, if you use ${job.url} in a column extension, it is working in the default view, but breaks in a non-default view.

      In the default view, the link is:
      http://localhost/job/test-job/lastSuccessfulBuild/jacoco/

      However in a different view, it is rendered as:
      http://localhost/view/Coverage/view/Coverage/job/test-job/lastSuccessfulBuild/jacoco/

      i.e. duplicating the "view/Coverage/" part.

      There are multiple extensions which currently break because of this, at least the jacococolumn in jacoco-plugin and a number of columns in the extra-columns-plugin, see https://github.com/jenkinsci/extra-columns-plugin/search?utf8=%E2%9C%93&q=job.url

      Workaround seems to be to use ${jobBaseUrl}${job.shortUrl} instead of ${job.url} as this leads to working URLs always.

      Attachments

        Issue Links

          Activity

            centic centic added a comment -

            Comments in related bugs indicate that this was introduced by JENKINS-19310

            centic centic added a comment - Comments in related bugs indicate that this was introduced by JENKINS-19310
            danielbeck Daniel Beck added a comment -

            Could you please explain why this is a core issue? Last Success / Last Failure links to builds work well even in non-default views. As does the 'Schedule a build' column.

            danielbeck Daniel Beck added a comment - Could you please explain why this is a core issue? Last Success / Last Failure links to builds work well even in non-default views. As does the 'Schedule a build' column.
            centic centic added a comment -

            It's not a plugin issues as far as I see as it did work before and broke with a newer version of Jenkings itself and I could not find any other matching component, also the issue that is reported to have introduced this was "core" as well.

            The problem happens if you use ${job.url}, it works fine if you use ${jobBaseUrl}${job.shortUrl} instead, so I expect Last Success/Last Failure use the combination that is still working.

            centic centic added a comment - It's not a plugin issues as far as I see as it did work before and broke with a newer version of Jenkings itself and I could not find any other matching component, also the issue that is reported to have introduced this was "core" as well. The problem happens if you use ${job.url}, it works fine if you use ${jobBaseUrl}${job.shortUrl} instead, so I expect Last Success/Last Failure use the combination that is still working.

            Code changed in jenkins
            User: Dominik Stadler
            Path:
            src/main/resources/hudson/plugins/jacococoveragecolumn/JaCoCoColumn/column.jelly
            http://jenkins-ci.org/commit/jacoco-plugin/44b5d298f3b36f57bc420d333b9ba56bbbac4850
            Log:
            JENKINS-23623: Fix URL in JaCoCo Coverage Column in non-default views, works around JENKINS-25113

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Dominik Stadler Path: src/main/resources/hudson/plugins/jacococoveragecolumn/JaCoCoColumn/column.jelly http://jenkins-ci.org/commit/jacoco-plugin/44b5d298f3b36f57bc420d333b9ba56bbbac4850 Log: JENKINS-23623 : Fix URL in JaCoCo Coverage Column in non-default views, works around JENKINS-25113
            danielbeck Daniel Beck added a comment -

            Not a defect: You're creating a relative link from a path fragment documented to contain the URL … relative to the context root of the application. Unless you're at the context root (e.g. /, /jenkins/) when clicking the link, you need luck for this to work.

            While its behavior changed in the context of a request, it's consistent with the documentation of Item.getUrl().

            danielbeck Daniel Beck added a comment - Not a defect: You're creating a relative link from a path fragment documented to contain the URL … relative to the context root of the application . Unless you're at the context root (e.g. / , /jenkins/ ) when clicking the link, you need luck for this to work. While its behavior changed in the context of a request, it's consistent with the documentation of Item.getUrl() .

            People

              Unassigned Unassigned
              centic centic
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: