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

Trac plugin creates wrong links

    XMLWordPrintable

Details

    • Bug
    • Status: Reopened (View Workflow)
    • Minor
    • Resolution: Unresolved
    • trac-plugin
    • None
    • Trac plugin 1.10, Hudson 1.365, Trac 0.11.2.1

    Description

      I have a problem with the links in the changes page.

      In my subversion repository, the files are located in:

      svn://svn.xxx.com/Repo/Product/Trunk/subdir/file.txt

      The links will then point at:

      http://trac.xxx.com/trac-project/browser/Product/Trunk/subdir/file.txt

      But my Trac installation has its root at Product/Trunk/, so the only link that would work is:

      http://trac.xxx.com/trac-project/browser/subdir/file.txt

      It seems there is no way to tell the plugin that my Trac project has its root set at svn://svn.xxx.com/Repo/Product/Trunk/ instead of svn://svn.xxx.com/Repo/ .

      Attachments

        Activity

          dmoebius dmoebius added a comment -

          FYI, I created a patch to enhance the plugin with a new string parameter called "Trac source repository browser prefix" (couldn't come up with a better name). You may enter any path into this textfield. The plugin will subtract this prefix from the URL before opening the Trac browser.

          The online help for this new field needs more explanation.

          dmoebius dmoebius added a comment - FYI, I created a patch to enhance the plugin with a new string parameter called "Trac source repository browser prefix" (couldn't come up with a better name). You may enter any path into this textfield. The plugin will subtract this prefix from the URL before opening the Trac browser. The online help for this new field needs more explanation.
          mattis mattis added a comment -

          dmoebius: Thanks a lot for creating this patch, looking forward to seeing a fix.

          mattis mattis added a comment - dmoebius: Thanks a lot for creating this patch, looking forward to seeing a fix.

          Code changed in jenkins
          User: Gerd Zanker
          Path:
          pom.xml
          src/main/java/hudson/plugins/trac/TracRepositoryBrowser.java
          src/test/java/hudson/plugins/trac/TracSvnRepositoryBrowserTest.java
          src/test/resources/hudson/plugins/trac/changelog-with-deleted-file.xml
          src/test/resources/hudson/plugins/trac/changelog_unsorted.xml
          http://jenkins-ci.org/commit/trac-plugin/70dbb9210b77cf46c76dc2330b7d8d6dabd6293e
          Log:
          Added test for existing subversion TracRepositoryBrowser class to have a
          clean, tested base for JENKINS-7032 and JENKINS-13366

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gerd Zanker Path: pom.xml src/main/java/hudson/plugins/trac/TracRepositoryBrowser.java src/test/java/hudson/plugins/trac/TracSvnRepositoryBrowserTest.java src/test/resources/hudson/plugins/trac/changelog-with-deleted-file.xml src/test/resources/hudson/plugins/trac/changelog_unsorted.xml http://jenkins-ci.org/commit/trac-plugin/70dbb9210b77cf46c76dc2330b7d8d6dabd6293e Log: Added test for existing subversion TracRepositoryBrowser class to have a clean, tested base for JENKINS-7032 and JENKINS-13366
          gerd_zanker Gerd Zanker added a comment -

          Merged with pull request #5 into trac master branch.

          gerd_zanker Gerd Zanker added a comment - Merged with pull request #5 into trac master branch.
          generatz Generic Ratslaugh added a comment - - edited

          My Trac instance supports multiple Git repositories. The Trac 1.0.1 wiki "Start Page" is here:

          https://server.my.org:8000/GIT_REPOS/wiki/WikiStart 

          and the "Browse Source" button takes me to the Repository Index:

          https://server.my.org:8000/GIT_REPOS/browser

          This is very similar to the Trac 1.2.2 demo page at

          https://trac.edgewall.org/demo-1.2/browser

          When I configure the "Trac website" for my xy_code repository as follows:

          https://server.my.org:8000/GIT_REPOS/browser/xy_code

          the Jenkins project Trac link provides that link and that works as expected.

           

          However, with TracGit selected as the "Repository browser" the TracGit links are not created correctly. An example, TracGit link from a Jenkins "Changes" page to a particular changeset incorrectly gives:

          https://server.my.org:8000/GIT_REPOS /changeset/5c6e21f19164608b69aa205c014222f4b31e93bb

          instead of the correct link:

          https://server.my.org:8000/GIT_REPOS/changeset/5c6e21f19164608b69aa205c014222f4b31e93bb/xy_code

          Again, the structure of my correct link is similar to the structure of a changeset link in the Trac 1.2.2 demo:

          https://trac.edgewall.org/demo-1.2/changeset/16130/trac.svn

          Using Jenkins 2.60.1 and Trac Plugin 1.13

           

          generatz Generic Ratslaugh added a comment - - edited My Trac instance supports multiple Git repositories. The Trac 1.0.1 wiki "Start Page" is here: https://server.my.org:8000/GIT_REPOS/wiki/WikiStart   and the "Browse Source" button takes me to the Repository Index: https://server.my.org:8000/GIT_REPOS/browser This is very similar to the Trac 1.2.2 demo page at https://trac.edgewall.org/demo-1.2/browser When I configure the "Trac website" for my xy_code repository as follows: https://server.my.org:8000/GIT_REPOS /browser/xy_code the Jenkins project Trac link provides that link and that works as expected.   However, with TracGit selected as the "Repository browser" the TracGit links are not created correctly. An example, TracGit link from a Jenkins "Changes" page to a particular changeset incorrectly gives: https://server.my.org:8000/GIT_REPOS /changeset/5c6e21f19164608b69aa205c014222f4b31e93bb instead of the correct link: https://server.my.org:8000/GIT_REPOS /changeset/5c6e21f19164608b69aa205c014222f4b31e93bb/xy_code Again, the structure of my correct link is similar to the structure of a changeset link in the Trac 1.2.2 demo: https://trac.edgewall.org/demo-1.2/changeset/16130/trac.svn Using Jenkins 2.60.1 and Trac Plugin 1.13  

          I googled '"Powered by Trac 1.2" git' and followed the "Browse Source" links for several public Trac sites. It looks to me as if those sites that are NOT structured so as to have a "Default Repository" as well as a "Repository Index" on the top-level browser page are the sites that Jenkins is currently configured to support. See the differences, for example, for these two cases with svn repositories:

          https://josm.openstreetmap.de/browser

          https://josm.openstreetmap.de/changeset/12510/josm

           

          vs.

          https://trac.wildfiregames.com/browser

          https://trac.wildfiregames.com/changeset/19137/

          generatz Generic Ratslaugh added a comment - I googled '"Powered by Trac 1.2" git' and followed the "Browse Source" links for several public Trac sites. It looks to me as if those sites that are NOT structured so as to have a "Default Repository" as well as a "Repository Index" on the top-level browser page are the sites that Jenkins is currently configured to support. See the differences, for example, for these two cases with svn repositories: https://josm.openstreetmap.de/browser https://josm.openstreetmap.de/changeset/12510/josm   vs. https://trac.wildfiregames.com/browser https://trac.wildfiregames.com/changeset/19137/

          I'm pretty sure that the problem only occurs when using one of the repositories that is NOT considered the "Default Repository". There is a public git repository that allows demonstration of the problem at https://devel.rtems.org/ The rtems-docs repository is not the default repository, so I set the following two fields in the Jenkins configuration as follows:

          Trac website: https://devel.rtems.org/

          Repository URL: git://git.rtems.org/rtems-docs.git

          Then for the changeset 5ffa072 Jenkins incorrectly generates this TracGit link:

          https://devel.rtems.org/changeset/5ffa0722e449c780e07d4235d25b8c5356ee1797

          instead of the correct:

          https://devel.rtems.org/changeset/5ffa0722e449c780e07d4235d25b8c5356ee1797/rtems-docs

          generatz Generic Ratslaugh added a comment - I'm pretty sure that the problem only occurs when using one of the repositories that is NOT considered the "Default Repository". There is a public git repository that allows demonstration of the problem at  https://devel.rtems.org/  The rtems-docs repository is not the default repository, so I set the following two fields in the Jenkins configuration as follows: Trac website:  https://devel.rtems.org/ Repository URL: git://git.rtems.org/rtems-docs.git Then for the changeset 5ffa072 Jenkins incorrectly generates this TracGit link: https://devel.rtems.org/changeset/5ffa0722e449c780e07d4235d25b8c5356ee1797 instead of the correct: https://devel.rtems.org/changeset/5ffa0722e449c780e07d4235d25b8c5356ee1797/rtems-docs

          People

            gerd_zanker Gerd Zanker
            dmoebius dmoebius
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: