Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.2
    • Component/s: changes.xml
    • Labels:
      None
    • Environment:
      all
    • Number of attachments :
      2

      Description

      I have a pom where i defined the issueManagement part as follows:

      <issueManagement>
      <system>Redmine</system>
      <url>http://www.supose.org</url>
      </issueManagement>

      and in the configuration section of the maven-changes-plugin as follows:

      <issueLinkTemplatePerSystem>
      <Redmine>http://www.supose.org/issues/show/%ISSUE%</Redmine>
      </issueLinkTemplatePerSystem>

      but if i do a mvn changes:changes-report
      I get links with "viewissue.jspa/?key=..." ...assuming the entries in
      changes.xml used no type so type="default" is assumed here...but the default URL is used instead the
      above one.

      If i use
      <issueLinkTemplate>http://www.supose.org/issues/show/%ISSUE%</issueLinkTemplate>
      in the pom instead for configuration i got correct links but a DEPRECATED warning during site build.

      1. patch-mchanges-166.patch
        2 kB
        Karl-Heinz Marbaise
      2. patch-mchanges-166-incl-it.patch
        11 kB
        Karl-Heinz Marbaise

        Activity

        Hide
        Lukas Theussl added a comment -

        I guess it should be

        <issueLinkTemplatePerSystem>
          <default>http://www.supose.org/issues/show/%ISSUE%</default>
        </issueLinkTemplatePerSystem>
        

        I don't think the <issueManagement> is supposed to be used here, at least I can't find that documented...

        Show
        Lukas Theussl added a comment - I guess it should be <issueLinkTemplatePerSystem> <default> http://www.supose.org/issues/show/%ISSUE% </default> </issueLinkTemplatePerSystem> I don't think the <issueManagement> is supposed to be used here, at least I can't find that documented...
        Hide
        Karl-Heinz Marbaise added a comment -

        If i use your suggestion without the issueManagement entry in my pom the report does not contain any link which means the information is printed out but no html link is created.

        It seemed that in the method constructAction() in the ChangeReportGenerator Class

                        if ( !canGenerateIssueLinks( system ) )
                        {
                            constructIssueText( action.getIssue(), sink, action.getFixedIssues() );
                        }
                        else
                        {
                            constructIssueLink( action.getIssue(), system, sink, action.getFixedIssues() );
                        }
        

        The result of canGenerateIssueLink() is false...which seemed to be the problem...

        Show
        Karl-Heinz Marbaise added a comment - If i use your suggestion without the issueManagement entry in my pom the report does not contain any link which means the information is printed out but no html link is created. It seemed that in the method constructAction() in the ChangeReportGenerator Class if ( !canGenerateIssueLinks( system ) ) { constructIssueText( action.getIssue(), sink, action.getFixedIssues() ); } else { constructIssueLink( action.getIssue(), system, sink, action.getFixedIssues() ); } The result of canGenerateIssueLink() is false...which seemed to be the problem...
        Hide
        Karl-Heinz Marbaise added a comment - - edited

        The patch contains a fix for this issue.

        The main problem was that the setIssueLink() method overwrites the contents of the hashmap independent if the hash map contains already a value with the key "default" which has been set by issueTemplatesPerSystem.

        The method canGenerateIssueLinks( String system ) has checked the URL of the issueManagement if it was empty no links have been created. In my opinion the method should check the URL only if the URL_TOKEN is present in the issueLink otherwise it should left the link untouched.

        The private method parseIssueLink(...) should remove only the trailing slash from the URL if one exists. This prevents cases where we miss to give a trailing slash in the issueManagement.url.

        With this patch the earlier mentioned suggestion only to define <default>http://xxxx/%ISSUE%</default> will work without giving the issueManagement.url...

        We should not miss to add an appropiate unit Test(s) and of course not missing the documentation for that behaviour.

        Show
        Karl-Heinz Marbaise added a comment - - edited The patch contains a fix for this issue. The main problem was that the setIssueLink() method overwrites the contents of the hashmap independent if the hash map contains already a value with the key "default" which has been set by issueTemplatesPerSystem. The method canGenerateIssueLinks( String system ) has checked the URL of the issueManagement if it was empty no links have been created. In my opinion the method should check the URL only if the URL_TOKEN is present in the issueLink otherwise it should left the link untouched. The private method parseIssueLink(...) should remove only the trailing slash from the URL if one exists. This prevents cases where we miss to give a trailing slash in the issueManagement.url. With this patch the earlier mentioned suggestion only to define <default> http://xxxx/%ISSUE% </default> will work without giving the issueManagement.url... We should not miss to add an appropiate unit Test(s) and of course not missing the documentation for that behaviour.
        Hide
        Olivier Lamy added a comment - - edited

        Did you have a look at the it test which covered your use case : https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-changes-plugin/src/it/report-changes-system/pom.xml.

        If it's not your use case can you provide a simple project ?

        Show
        Olivier Lamy added a comment - - edited Did you have a look at the it test which covered your use case : https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-changes-plugin/src/it/report-changes-system/pom.xml . If it's not your use case can you provide a simple project ?
        Hide
        Karl-Heinz Marbaise added a comment -

        I have checked that and patched the source with my patch and run the integration-test without error. That means no change of current behaviour. So i think i should add an other integration-test with particular checking of the patch e.g. without issueLinkTemplate and/or without issueManagement.url.

        Show
        Karl-Heinz Marbaise added a comment - I have checked that and patched the source with my patch and run the integration-test without error. That means no change of current behaviour. So i think i should add an other integration-test with particular checking of the patch e.g. without issueLinkTemplate and/or without issueManagement.url.
        Hide
        Karl-Heinz Marbaise added a comment -

        This patch contains the fixes for the issue and the integration test.

        Show
        Karl-Heinz Marbaise added a comment - This patch contains the fixes for the issue and the integration test.
        Hide
        Olivier Lamy added a comment -

        fix in rev 797966
        Thanks!

        Show
        Olivier Lamy added a comment - fix in rev 797966 Thanks!

          People

          • Assignee:
            Olivier Lamy
            Reporter:
            Karl-Heinz Marbaise
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: