I added the following in AggregatedWarningsProjectAction.java

@Exported
public List<WarningsResultAction> getWarningsResultAction() { List<WarningsResultAction> projectActions; // projectActions = this.getProject().getActions(WarningsResultAction.class); // can't use project, its actions list is allways empty // try getting the actions of the last build projectActions = this.getLastFinishedBuild().getActions(WarningsResultAction.class); return projectActions; }

Inside WarningsResultAction.java i then added the exported and visibility fields

@Exported(visibility = 2)
@Override
public String getUrlName() { return WarningsDescriptor.getResultUrl(parserName); }

/**

  • Returns the parser group this result belongs to.
    *
  • @return the parser group
    */
    @Exported(visibility = 2)
    public String getParser() { return parserName; }

@Exported(visibility = 2)
@Override
public String getDisplayName() { return ParserRegistry.getParser(parserName).getLinkName().toString(); }

the ../warnings/api/xml REST api then gives me:

<aggregatedWarningsProjectAction>
   <displayName>Compiler Warnings</displayName>
   <lastFinishedBuild>
      <number>344</number>
      <url>
http://localhost:8080/job/code_coverage/job/Build_L1PHY_el1c_task_test_MAT_gcc/344/
      </url>
   </lastFinishedBuild>
   <warningsResultAction>
      <displayName>GNU C Compiler Warnings</displayName>
      <parser>GNU C Compiler 4 (gcc)</parser>
      <urlName>warnings18Result</urlName>
   </warningsResultAction>
   <warningsResultAction>
      <displayName>PC-Lint Warnings</displayName>
      <parser>PC-Lint</parser>
      <urlName>warnings0Result</urlName>
   </warningsResultAction>
</aggregatedWarningsProjectAction>

So i now get the urlName and parser name i can use.

This is for a project, so to get the actual values for a particular build i can then do the calls to the particular parser urls.

if i do ../warnings/api/xml?depth=2 then i get the full value tree (for the last build)

<warningsResultAction>
<name>warnings</name>
<result>
<newSuccessfulHighScore>false</newSuccessfulHighScore>
<newZeroWarningsHighScore>false</newZeroWarningsHighScore>
<numberOfFixedWarnings>0</numberOfFixedWarnings>
<numberOfHighPriorityWarnings>0</numberOfHighPriorityWarnings>
<numberOfLowPriorityWarnings>0</numberOfLowPriorityWarnings>
<numberOfNewWarnings>0</numberOfNewWarnings>
<numberOfNormalPriorityWarnings>2</numberOfNormalPriorityWarnings>
<numberOfWarnings>2</numberOfWarnings>
<pluginResult>SUCCESS</pluginResult>
<referenceBuild>
<number>343</number>
<url>
http://localhost:8080/job/code_coverage/job/Build_L1PHY_el1c_task_test_MAT_gcc/343/
</url>
</referenceBuild>
<successfulHighScore>0</successfulHighScore>
<successfulSinceBuild>0</successfulSinceBuild>
<successfulSinceDate>0</successfulSinceDate>
<warning/>
<warning/>
<warningsDelta>0</warningsDelta>
<zeroWarningsHighScore>1200233384</zeroWarningsHighScore>
<zeroWarningsSinceBuild>0</zeroWarningsSinceBuild>
<zeroWarningsSinceDate>0</zeroWarningsSinceDate>
</result>
<successful>true</successful>
<displayName>GNU C Compiler Warnings</displayName>
<parser>GNU C Compiler 4 (gcc)</parser>
<urlName>warnings18Result</urlName>
</warningsResultAction>

if i call .../buildNumber/warningsResult/api/xml
then i get the collated values for a particular build.

where do i need to add code to get the list of warnings actions in the /warningsResult/ call ?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to