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

Add support for Inter-trac style links

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Component/s: trac-plugin
    • Labels:
      None
    • Environment:
      Platform: All, OS: All

      Description

      Trac has support for what are called inter-trac links
      http://trac.edgewall.org/wiki/InterTrac

      They are useful because they allow for cross-referencing between two different
      Trac systems.

      We have two different trac systems in use, one for standard bug tracking use,
      and one we use for tracking changes (including software rolls) to our production
      environment. This means that our changelists have tokens like
      trac:ticket:113 and
      production:ticket:241

      With InterTrac configuration, Trac resolves these into links to the correct trac
      installation. However, the Hudson Trac plugin doesn't recognize these intertrac
      style links and instead would create (for the example above) a link to ticket
      113 in the trac system and a link to ticket 241 in the trac system.

      It would be helpful if the Trac configuration for a Hudson job would also
      support Inter-trac style links.

        Activity

        Hide
        ricq ricq added a comment -

        I have a patch ready for this issue in my sandbox, but I only implemented the
        short-style InterTrac ticket links (like #X123, where X is a reference to
        another Trac project).

        I will add the long format as described in the issue (trac:ticket:123) and
        submit my patch shortly (tonight or tomorrow).

        Show
        ricq ricq added a comment - I have a patch ready for this issue in my sandbox, but I only implemented the short-style InterTrac ticket links (like #X123, where X is a reference to another Trac project). I will add the long format as described in the issue (trac:ticket:123) and submit my patch shortly (tonight or tomorrow).
        Hide
        ricq ricq added a comment -

        Created an attachment (id=530)
        Patch to add InterTrac link support to TracLinkAnnotator

        Show
        ricq ricq added a comment - Created an attachment (id=530) Patch to add InterTrac link support to TracLinkAnnotator
        Hide
        ricq ricq added a comment -

        The patch that I've just attached adds support for InterTrac links to the the
        Trac plugin. The extra formats that are now supported:

        • #T123
        • trac:#123
        • trac:ticket:123
        • [T123]
        • trac:changeset:123
        • trac:wiki:PageName

        I've just noticed that there are even more InterTrac link syntaxes, like
        trac:report:123, but I've not implemented any other than the ones above. For
        now, I think this suffices. Otherwise it's not too much work to add more
        syntaxes.

        I've added quite some tests, to make sure I didn't break existing use cases. One
        of the things I ran into was that the simple non-InterTrac markup could become
        nested in the InterTrac links. Therefore I update the existing simple syntaxes
        to prevent matches if they are preceded by a semicolon. Also I've added a test
        to make sure multiple (non-nested) markups on a single line remain working.

        Last, I've slightly altered the code to make sure the processing loop is now
        tested instead of being duplicated in the test.

        Hope someone can include this patch in an upcoming release.

        Show
        ricq ricq added a comment - The patch that I've just attached adds support for InterTrac links to the the Trac plugin. The extra formats that are now supported: #T123 trac:#123 trac:ticket:123 [T123] trac:changeset:123 trac:wiki:PageName I've just noticed that there are even more InterTrac link syntaxes, like trac:report:123, but I've not implemented any other than the ones above. For now, I think this suffices. Otherwise it's not too much work to add more syntaxes. I've added quite some tests, to make sure I didn't break existing use cases. One of the things I ran into was that the simple non-InterTrac markup could become nested in the InterTrac links. Therefore I update the existing simple syntaxes to prevent matches if they are preceded by a semicolon. Also I've added a test to make sure multiple (non-nested) markups on a single line remain working. Last, I've slightly altered the code to make sure the processing loop is now tested instead of being duplicated in the test. Hope someone can include this patch in an upcoming release.
        Hide
        bradfritz bradfritz added a comment -

        Thank you for the patch.

        I would be happy to take a look, incorporate the changes, and release a new
        version of the Trac plugin later this week. (As far as I know, I still have
        commit and release permissions for the Trac plugin.)

        If anyone objects, just let me know.

        --Brad

        Show
        bradfritz bradfritz added a comment - Thank you for the patch. I would be happy to take a look, incorporate the changes, and release a new version of the Trac plugin later this week. (As far as I know, I still have commit and release permissions for the Trac plugin.) If anyone objects, just let me know. --Brad
        Hide
        scm_issue_link SCM/JIRA link daemon added a comment -

        Code changed in hudson
        User: : bradfritz
        Path:
        trunk/hudson/plugins/trac/src/main/java/hudson/plugins/trac/TracLinkAnnotator.java
        trunk/hudson/plugins/trac/src/test/java/hudson/plugins/trac/TracLinkAnnotatorTest.java
        http://fisheye4.cenqua.com/changelog/hudson/?cs=14990
        Log:
        JENKINS-2707 First part of Rick Riemer's patch. Add annotate()
        method so LinkMarkup inner class and MARKUPS no longer need to be
        package protected.

        Show
        scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : bradfritz Path: trunk/hudson/plugins/trac/src/main/java/hudson/plugins/trac/TracLinkAnnotator.java trunk/hudson/plugins/trac/src/test/java/hudson/plugins/trac/TracLinkAnnotatorTest.java http://fisheye4.cenqua.com/changelog/hudson/?cs=14990 Log: JENKINS-2707 First part of Rick Riemer's patch. Add annotate() method so LinkMarkup inner class and MARKUPS no longer need to be package protected.
        Hide
        scm_issue_link SCM/JIRA link daemon added a comment -

        Code changed in hudson
        User: : bradfritz
        Path:
        trunk/hudson/plugins/trac/src/test/java/hudson/plugins/trac/TracLinkAnnotatorTest.java
        http://fisheye4.cenqua.com/changelog/hudson/?cs=14991
        Log:
        JENKINS-2707 Second part of Rick Riemer's patch. Additional tests
        for annotations.

        Show
        scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : bradfritz Path: trunk/hudson/plugins/trac/src/test/java/hudson/plugins/trac/TracLinkAnnotatorTest.java http://fisheye4.cenqua.com/changelog/hudson/?cs=14991 Log: JENKINS-2707 Second part of Rick Riemer's patch. Additional tests for annotations.
        Hide
        scm_issue_link SCM/JIRA link daemon added a comment -

        Code changed in hudson
        User: : bradfritz
        Path:
        trunk/hudson/plugins/trac/src/main/java/hudson/plugins/trac/TracLinkAnnotator.java
        trunk/hudson/plugins/trac/src/test/java/hudson/plugins/trac/TracLinkAnnotatorTest.java
        http://fisheye4.cenqua.com/changelog/hudson/?cs=14992
        Log:
        JENKINS-2707 Remainder of Rick Riemer's patch. Adds support for Trac
        InterTrac links(1). The following formats are supported:

        Show
        scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : bradfritz Path: trunk/hudson/plugins/trac/src/main/java/hudson/plugins/trac/TracLinkAnnotator.java trunk/hudson/plugins/trac/src/test/java/hudson/plugins/trac/TracLinkAnnotatorTest.java http://fisheye4.cenqua.com/changelog/hudson/?cs=14992 Log: JENKINS-2707 Remainder of Rick Riemer's patch. Adds support for Trac InterTrac links(1). The following formats are supported:
        Hide
        bradfritz bradfritz added a comment -

        Patch applied with minor whitespace and formatting changes.

        I will try to get a new release of the Trac plugin cut Monday or Tuesday.

        Show
        bradfritz bradfritz added a comment - Patch applied with minor whitespace and formatting changes. I will try to get a new release of the Trac plugin cut Monday or Tuesday.
        Hide
        ricq ricq added a comment -

        Brad, thanks for committing the patch. I missed most of your activity because I
        seem not to get any emails on activity of this issue.

        Have you been able to create a new release yet?

        --ricq

        Show
        ricq ricq added a comment - Brad, thanks for committing the patch. I missed most of your activity because I seem not to get any emails on activity of this issue. Have you been able to create a new release yet? --ricq
        Hide
        ricq ricq added a comment -

        Add myself on the CC

        Show
        ricq ricq added a comment - Add myself on the CC
        Hide
        ricq ricq added a comment -

        Fixed in the 1.8 release of the plugin that Brad Fritz made last night. Closing
        as fixed.

        More info: http://www.nabble.com/Trac-plugin-release--td22053591.html

        Show
        ricq ricq added a comment - Fixed in the 1.8 release of the plugin that Brad Fritz made last night. Closing as fixed. More info: http://www.nabble.com/Trac-plugin-release--td22053591.html

          People

          • Assignee:
            bradfritz bradfritz
            Reporter:
            kedmison kedmison
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: