[MCHANGES-394] statusIds default value not overidden by pom.xml configuration.

Open
#264 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java

Research direction

Read RestJiraDownloader.resolveOneItem and trace how statusIds is populated from the plugin's ; compare that value with the default "Closed". Reproduce report generation with the shown statusIds and inspect the generated jira-report.xml; done means the configured IDs are used and the report is no longer empty.

Written by the indexing model from the issue text.

Description

bug priority:major

Patrice Rochemont opened MCHANGES-394 and commented

Hi, 
Even if the statusIds are changed in the configuration section of the plugin, le statusIds variable is still "Closed" : resulting in : 

 

[WARNING] 
org.apache.maven.plugin.MojoFailureException: Could not find status Closed.
at org.apache.maven.plugin.jira.RestJiraDownloader.resolveOneItem (RestJiraDownloader.java:275)
at org.apache.maven.plugin.jira.RestJiraDownloader.resolveList (RestJiraDownloader.java:256)
at org.apache.maven.plugin.jira.RestJiraDownloader.resolveIds (RestJiraDownloader.java:221)
at org.apache.maven.plugin.jira.RestJiraDownloader.doExecute (RestJiraDownloader.java:141)
at org.apache.maven.plugin.jira.AdaptiveJiraDownloader.doExecute (AdaptiveJiraDownloader.java:45)
at org.apache.maven.plugin.jira.JiraMojo.executeReport (JiraMojo.java:346)
at org.apache.maven.reporting.AbstractMavenReport.generate (AbstractMavenReport.java:255)
at org.apache.maven.reporting.AbstractMavenReport.generate (AbstractMavenReport.java:210)
at org.apache.maven.plugin.changes.AbstractChangesReport.execute (AbstractChangesReport.java:203)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[DEBUG] addRuleSet() with no namespace URI
[DEBUG] setDocumentLocator(org.apache.xerces.parsers.AbstractSAXParser$LocatorProxy@44eb2452)
[DEBUG] startDocument()
[DEBUG] startElement(,,tools)
[DEBUG] Pushing body text ''
[DEBUG] New match='tools'
[DEBUG] Fire begin() for SetPropertiesRule[]
[DEBUG] [SetPropertiesRule]{tools} Set org.apache.velocity.tools.config.XmlFactoryConfiguration properties
[DEBUG] BeanUtils.populate(


 

with a configuration section  like; 

<configuration>
<useJql>true</useJql>
<issueLinkTemplatePerSystem>
<default>%URL%/issues/%ISSUE%</default>
</issueLinkTemplatePerSystem>
<onlyCurrentVersion>false</onlyCurrentVersion>
<columnNames>Fix Version,Key,Summary,Type,Resolution,Status</columnNames>
<!-- Sort cols have to be reversed in JIRA 4 -->
<sortColumnNames>Key DESC,Type,Fix Version DESC</sortColumnNames>
<!-- Fixed = 1, 
Done = 10101 -->
<resolutionIds>1,10101</resolutionIds>
<!-- Status : CLOSED = 6, 
FINISHED = 10003
RESOLVED ?
--> 
<statusIds>6,10003</statusIds> 
<!-- Don't include sub-task -->
<!-- <typeIds>Bug,New Feature,Epic,Story,Task,Improvement,Wish,Test</typeIds> -->
<!-- <fixVersionIds>${jira.cdis.fixVersionIds}</fixVersionIds> -->
<!-- TODO add EpicId if possible or componentId. -->
<filter>project = MP102ICNXNET_BLM AND status in (CLOSED, FINISHED)</filter>
<versionPrefix>CDIS V</versionPrefix>
<maxEntries>500</maxEntries>

...
</configuration>

This following method call is performed when the client retrieve all status with /jira2/rest/api/2/status and the items is empty 

 


private String resolveOneItem( JsonNode items, String what, String nameOrId )
throws IOException, MojoExecutionException, MojoFailureException
{
for ( int cx = 0; cx < items.size(); cx++ )
{
JsonNode item = items.get( cx );
if ( nameOrId.equals( item.get( "id" ).asText() ) )
{
return nameOrId;
}
else if ( nameOrId.equals( item.get( "name" ).asText() ) )
{
return item.get( "id" ).asText();
}
}
throw new MojoFailureException( String.format( "Could not find %s %s.", what, nameOrId ) );
}

 

Thus, the jira-report.xml generated is empty :( 

Best regards.

 


Affects: 2.12.1

Dominant language
Java
Stars
15
Forks
22
Avg merge
1d 6h
Merged PRs (30d)
7

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/maven-changes-plugin

All issues in apache/maven-changes-plugin

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.