Maven Changes Plugin
  1. Maven Changes Plugin
  2. MCHANGES-141

Jira Report fails to pick up issues that contain multiple fix-for elements.

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.4
    • Component/s: jira
    • Labels:
      None
    • Patch Submitted:
      Yes
    • Number of attachments :
      1

      Description

      When a jira ticket is associated with multiple versions in its fix-for list, the report fails to correctly report the issues.

      A patch is attached which collects each fix for into a List of strings, and updates the report to include them.

        Activity

        Hide
        Mark Derricutt added a comment -

        I've noticed on some of my modules/releases, the plugin with this patch applied seems to have an empty list of issues attached, but I've not yet had a chance to dive in and see why.

        Show
        Mark Derricutt added a comment - I've noticed on some of my modules/releases, the plugin with this patch applied seems to have an empty list of issues attached, but I've not yet had a chance to dive in and see why.
        Hide
        Christophe Lallement added a comment -

        Hello Mark

        I have the same problem (fix to more that one version produce an error on the changes:announcement-generate.
        Find below the error stacktrace.
        Could you reproduce this pb ? (very simple, just edit a case and choose many version to fix).
        It's a very common case when tou fix a bug on a production version: You want to fix on the prod branch and report them on the next dev branch.

        It's really a pb because when we have to patch a production branch, report already failed.

        And i don't know why but on console you do not find release 1.2.3, but it's really define into JIRa and have only on attached case (with 2 fixForVersion release: 1.2.3 and 1.3.0).

        [DEBUG] Downloading from JIRA was successful
        [INFO] Creating announcement file from JIRA releases...
        [DEBUG] Found 5 releases.
        [DEBUG] The release: 1.1.0 has 1 actions.
        [DEBUG] The release: 1.3.0 has 12 actions.
        [DEBUG] The release: 1.2.1 has 6 actions.
        [DEBUG] The release: 1.2.2 has 1 actions.
        [DEBUG] The release: 1.2.0 has 4 actions.
        [DEBUG] The release: 1.1.0 has 1 actions.
        [DEBUG] The release: 1.3.0 has 12 actions.
        [DEBUG] The release: 1.2.1 has 6 actions.
        [DEBUG] The release: 1.2.2 has 1 actions.
        [DEBUG] The release: 1.2.0 has 4 actions.
        

        example of xml extract from jira:

        ...
            <updated>Tue, 25 Aug 2009 15:01:45 +0200 (CEST)</updated>
        
                             <version>1.0.*</version>
                            <version>1.1.0</version>
        
                            <version>1.2.0</version>
                            <version>1.2.1</version>
                            <version>1.2.2</version>
                            <version>1.3.0</version>
                    
                             <fixVersion>1.2.3</fixVersion>
                            <fixVersion>1.3.0</fixVersion>
                        
                    <due></due>
        
        ...
        
        stack trace error
        org.apache.maven.lifecycle.LifecycleExecutionException: Couldn't find the release '1.2.3' among the supplied releases.
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:703)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
                at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
                at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
                at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
                at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:41)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
                at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
                at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
                at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
        Caused by: org.apache.maven.plugin.MojoExecutionException: Couldn't find the release '1.2.3' among the supplied releases.
                at org.apache.maven.plugin.announcement.AnnouncementMojo.getLatestRelease(AnnouncementMojo.java:460)
                at org.apache.maven.plugin.announcement.AnnouncementMojo.doGenerate(AnnouncementMojo.java:349)
                at org.apache.maven.plugin.announcement.AnnouncementMojo.doJiraGenerate(AnnouncementMojo.java:582)
                at org.apache.maven.plugin.announcement.AnnouncementMojo.execute(AnnouncementMojo.java:335)
                at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
                ... 17 more
        
        Show
        Christophe Lallement added a comment - Hello Mark I have the same problem (fix to more that one version produce an error on the changes:announcement-generate. Find below the error stacktrace. Could you reproduce this pb ? (very simple, just edit a case and choose many version to fix). It's a very common case when tou fix a bug on a production version: You want to fix on the prod branch and report them on the next dev branch. It's really a pb because when we have to patch a production branch, report already failed. And i don't know why but on console you do not find release 1.2.3, but it's really define into JIRa and have only on attached case (with 2 fixForVersion release: 1.2.3 and 1.3.0). [DEBUG] Downloading from JIRA was successful [INFO] Creating announcement file from JIRA releases... [DEBUG] Found 5 releases. [DEBUG] The release: 1.1.0 has 1 actions. [DEBUG] The release: 1.3.0 has 12 actions. [DEBUG] The release: 1.2.1 has 6 actions. [DEBUG] The release: 1.2.2 has 1 actions. [DEBUG] The release: 1.2.0 has 4 actions. [DEBUG] The release: 1.1.0 has 1 actions. [DEBUG] The release: 1.3.0 has 12 actions. [DEBUG] The release: 1.2.1 has 6 actions. [DEBUG] The release: 1.2.2 has 1 actions. [DEBUG] The release: 1.2.0 has 4 actions. example of xml extract from jira: ... <updated>Tue, 25 Aug 2009 15:01:45 +0200 (CEST)</updated> <version>1.0.*</version> <version>1.1.0</version> <version>1.2.0</version> <version>1.2.1</version> <version>1.2.2</version> <version>1.3.0</version> <fixVersion>1.2.3</fixVersion> <fixVersion>1.3.0</fixVersion> <due></due> ... stack trace error org.apache.maven.lifecycle.LifecycleExecutionException: Couldn't find the release '1.2.3' among the supplied releases. at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:703) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:41) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: org.apache.maven.plugin.MojoExecutionException: Couldn't find the release '1.2.3' among the supplied releases. at org.apache.maven.plugin.announcement.AnnouncementMojo.getLatestRelease(AnnouncementMojo.java:460) at org.apache.maven.plugin.announcement.AnnouncementMojo.doGenerate(AnnouncementMojo.java:349) at org.apache.maven.plugin.announcement.AnnouncementMojo.doJiraGenerate(AnnouncementMojo.java:582) at org.apache.maven.plugin.announcement.AnnouncementMojo.execute(AnnouncementMojo.java:335) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678) ... 17 more
        Hide
        Dennis Lundberg added a comment -

        I've had a look at the patch for this issue. Unfortunately it will not work. The problem is in JiraXML.getReleases() and this row:

        releasesMap.put( fixIssue, release );
        

        This means that only one of the releases for that issue will be in the List of releases that is returned from that method. The concept of using a Map keyed by issue doesn't work when you can have multiple releases per issue.

        Show
        Dennis Lundberg added a comment - I've had a look at the patch for this issue. Unfortunately it will not work. The problem is in JiraXML.getReleases() and this row: releasesMap.put( fixIssue, release ); This means that only one of the releases for that issue will be in the List of releases that is returned from that method. The concept of using a Map keyed by issue doesn't work when you can have multiple releases per issue.
        Hide
        Mark Derricutt added a comment -

        Rereading through the patch I still think it works fine, however - the variable name I used for fixIssue is badly named. As thats assigned inside a loop of the issue.getFixVersions() iterator, it contains the Sting value of a release, such as "1.2.7", if the releaseMap doesn't contain this string as a key, a new Release instance is created and put in the map.

        So the map isn't keyed by the issue, but the fixFor for the issue. Renaming it so say fixVersion makes it more clear. It'd be great to have this in the plugin.

        Show
        Mark Derricutt added a comment - Rereading through the patch I still think it works fine, however - the variable name I used for fixIssue is badly named. As thats assigned inside a loop of the issue.getFixVersions() iterator, it contains the Sting value of a release, such as "1.2.7", if the releaseMap doesn't contain this string as a key, a new Release instance is created and put in the map. So the map isn't keyed by the issue, but the fixFor for the issue. Renaming it so say fixVersion makes it more clear. It'd be great to have this in the plugin.
        Hide
        Dennis Lundberg added a comment -

        Patch applied with modifications in r1050525.
        I had to add the presentation part in the report generator.

        A new 2.4-SNAPSHOT has been deployed.

        Thanks!

        Show
        Dennis Lundberg added a comment - Patch applied with modifications in r1050525 . I had to add the presentation part in the report generator. A new 2.4-SNAPSHOT has been deployed. Thanks!

          People

          • Assignee:
            Dennis Lundberg
            Reporter:
            Mark Derricutt
          • Votes:
            5 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: