• Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • git-plugin, trac-plugin
    • Jenkins 1.441, Trac Plugin 1.12

      In the Trac Plugin documentation the configuration is described as

      In the Source Code Management section, choose "Trac" for the "Repository browser" setting.

      This settings "Trac" is not available for when I use git as a SCM.

      Can this selection be added?


      The Trac-plugin code supports "TracGit" for the "Repository browser" setting. The given Trac URL at the top of the job settings will be used to generate links for git changesets, files and diffs to your Trac "Browse Source" area.

          [JENKINS-11887] Support Git for "Repository browser" setting

          Gerd Zanker added a comment - - edited

          Hello Rob,
          is there a Trac configuration to include the repository name or supports Trac multiple repositories?

          I only know Trac sites where one git repository is integrated, for example

          https://fedorahosted.org/eclipse-fedorapackager/

          and therefore file urls are e.g.

          https://fedorahosted.org/eclipse-fedorapackager/browser/pom.xml

          If the repository name would be included here it would result in this invalid url https://fedorahosted.org/eclipse-fedorapackager/browser/eclipse-fedorapackager/pom.xml.
          Do you have ideas?

          Bye, bye,
          Gerd

          Gerd Zanker added a comment - - edited Hello Rob, is there a Trac configuration to include the repository name or supports Trac multiple repositories? I only know Trac sites where one git repository is integrated, for example https://fedorahosted.org/eclipse-fedorapackager/ and therefore file urls are e.g. https://fedorahosted.org/eclipse-fedorapackager/browser/pom.xml If the repository name would be included here it would result in this invalid url https://fedorahosted.org/eclipse-fedorapackager/browser/eclipse-fedorapackager/pom.xml . Do you have ideas? Bye, bye, Gerd

          Rob Guttman added a comment -

          Our Trac setup is for multiple git repositories. And so the repo name must be included in the browser url. More details can be found here: http://trac.edgewall.org/wiki/0.12/TracRepositoryAdmin

          However, there is one exception to this which is a partial workaround. You can alias the default (i.e., nameless) path to go to a single git repo. This should mostly work for us as we have one main git repo that we care about most for jenkins. But this would just be a workaround for this special case. Full multi-repo support would be better.

          Rob Guttman added a comment - Our Trac setup is for multiple git repositories. And so the repo name must be included in the browser url. More details can be found here: http://trac.edgewall.org/wiki/0.12/TracRepositoryAdmin However, there is one exception to this which is a partial workaround. You can alias the default (i.e., nameless) path to go to a single git repo. This should mostly work for us as we have one main git repo that we care about most for jenkins. But this would just be a workaround for this special case. Full multi-repo support would be better.

          Gerd Zanker added a comment -

          Hi Rob,
          Thanks for the information. I'm no Trac admin and therefore did not know these "internals". After reading your link I checked the old open JENKINS-7032 issue and it looks like its describing the same problem for subversion repositories. What do you think?
          I can apply the patch of JENKINS-7032 to the subversion and git repository browser. But I can't test the changes because I found no a public Trac site with multiple repositories.

          Do you know a public Trac site or can you do some tests (I can provide a new Trac.hpi for testing)?

          Bye, Bye,
          Gerd

          Gerd Zanker added a comment - Hi Rob, Thanks for the information. I'm no Trac admin and therefore did not know these "internals". After reading your link I checked the old open JENKINS-7032 issue and it looks like its describing the same problem for subversion repositories. What do you think? I can apply the patch of JENKINS-7032 to the subversion and git repository browser. But I can't test the changes because I found no a public Trac site with multiple repositories. Do you know a public Trac site or can you do some tests (I can provide a new Trac.hpi for testing)? Bye, Bye, Gerd

          Rob Guttman added a comment -

          Gerd, sorry but I don't know of any public git multi-repository Trac instances. I would be willing to test locally here though.

          BTW, issue JENKINS-7032 does not seem to be the same issue as this one.

          Rob Guttman added a comment - Gerd, sorry but I don't know of any public git multi-repository Trac instances. I would be willing to test locally here though. BTW, issue JENKINS-7032 does not seem to be the same issue as this one.

          Gerd Zanker added a comment -

          Can you please explain why the two issues are different? From where to get the repo Name?
          In the old issue the User has to enter the repo name and it will be added to the url (after Browser, before file).
          Isn't this what you need too?

          – Posted from Bugbox for Android

          Gerd Zanker added a comment - Can you please explain why the two issues are different? From where to get the repo Name? In the old issue the User has to enter the repo name and it will be added to the url (after Browser, before file). Isn't this what you need too? – Posted from Bugbox for Android

          Gerd Zanker added a comment -

          I debugged the code from the other patch. You are right - issue JENKINS-7032 not the same as this one. It will remove a part from the URL and you want to add a part to the URL.

          So there is one question open: From where to get the repository Name?

          Shall the repo name be derived from the git URL setting in Job configuration? => I can access the URL but I need a matching pattern to get the name from the url.
          Is it always a the same repo name for one Jenkins Job? => I could add an optional text field to the Trac settings of the Job configuration to enter the name, which would be an easy task.

          Gerd Zanker added a comment - I debugged the code from the other patch. You are right - issue JENKINS-7032 not the same as this one. It will remove a part from the URL and you want to add a part to the URL. So there is one question open: From where to get the repository Name? Shall the repo name be derived from the git URL setting in Job configuration? => I can access the URL but I need a matching pattern to get the name from the url. Is it always a the same repo name for one Jenkins Job? => I could add an optional text field to the Trac settings of the Job configuration to enter the name, which would be an easy task.

          Gerd Zanker added a comment -

          Attached trac-1.14-SNAPSHOP build for testing. For Git it can add a string after the Trac URL for browsing the source code (http://trac.mycompany.com/browser/<append>) This shall support multiple repositories within one Trac site.

          Gerd Zanker added a comment - Attached trac-1.14-SNAPSHOP build for testing. For Git it can add a string after the Trac URL for browsing the source code ( http://trac.mycompany.com/browser/ <append>) This shall support multiple repositories within one Trac site.

          Gerd Zanker added a comment -

          Hello Rob,
          do you have any feedback about the SNAPSHOP version?
          Bye,
          Gerd

          Gerd Zanker added a comment - Hello Rob, do you have any feedback about the SNAPSHOP version? Bye, Gerd

          Bernhard T added a comment -

          Hi Gerd,
          I am looking for the identical feature for svn urls. The repository stays the same for one Jenkins job. Hence an additional settings input field for the trac repository name would do perfectly.

          Bernhard

          Bernhard T added a comment - Hi Gerd, I am looking for the identical feature for svn urls. The repository stays the same for one Jenkins job. Hence an additional settings input field for the trac repository name would do perfectly. Bernhard

          Gerd Zanker added a comment - - edited

          Wrap up (after times of testing and learning for me):
          This ticket was to get an initial git support for the Trac plugin. From my point of view this goal is reached.

          But two issues are open:

          1. Multiple repositories URL in the same job in combination with a Trac setup for multiple git repositories.
          2. Trac browser URL can not always be created by appending the Trac URL and the changed file path.
            Sometimes the file path must be truncated (see JENKINS-7032), sometime the file path must be extended by a prefix.

          I will now close this issue and create two new ones (JENKINS-13365 and JENKINS-13366) to follow up the two different concerns separately.
          Gerd

          Gerd Zanker added a comment - - edited Wrap up (after times of testing and learning for me): This ticket was to get an initial git support for the Trac plugin. From my point of view this goal is reached. But two issues are open: Multiple repositories URL in the same job in combination with a Trac setup for multiple git repositories. Trac browser URL can not always be created by appending the Trac URL and the changed file path. Sometimes the file path must be truncated (see JENKINS-7032 ), sometime the file path must be extended by a prefix. I will now close this issue and create two new ones ( JENKINS-13365 and JENKINS-13366 ) to follow up the two different concerns separately. Gerd

            gerd_zanker Gerd Zanker
            gerd_zanker Gerd Zanker
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: