multiple recordIssues for parallel steps

250 views
Skip to first unread message

Olivier Lamy

unread,
Nov 26, 2020, 3:48:14 AM11/26/20
to jenkin...@googlegroups.com
Hi,
I have a build with 3 parallel branch sort of matrix: same build with different jdk.
I'd like to have something such in parallel steps
mavenbuild
recordIssues id: "jdk8", enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle(), spotBugs(), pmdParser()]

mavenbuild
recordIssues id: "jdk11", enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle(), spotBugs(), pmdParser()]

mavenbuild
recordIssues id: "jdk15", enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle(), spotBugs(), pmdParser()]

But I turn to an issue such:

Also: java.lang.IllegalStateException: ID maven-warnings is already used by another action: io.jenkins.plugins.analysis.core.model.ResultAction for Maven java.lang.IllegalStateException: ID maven-warnings is already used by another action: io.jenkins.plugins.analysis.core.model.ResultAction for Maven at io.jenkins.plugins.analysis.core.steps.IssuesPublisher.ensureThatIdIsUnique(IssuesPublisher.java:156) at io.jenkins.plugins.analysis.core.steps.IssuesPublisher.attachAction(IssuesPublisher.java:107) at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.publishResult(IssuesRecorder.java:721) at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.record(IssuesRecorder.java:651) at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.perform(IssuesRecorder.java:617) at io.jenkins.plugins.analysis.core.steps.RecordIssuesStep$Execution.run(RecordIssuesStep.java:1024) at io.jenkins.plugins.analysis.core.steps.RecordIssuesStep$Execution.run(RecordIssuesStep.java:985)




Is there anyway to have multiple report for different jdks 
thanks
--
Olivier 

Ullrich Hafner

unread,
Nov 26, 2020, 6:48:43 AM11/26/20
to Jenkins Developers
This is possible, yes. One way is to create an aggregation for each JDK:

recordIssues aggregatingResults: true, id: "jdk8", enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle(), spotBugs(), pmdParser()]

Then you will get 3 results, one for each JDK.

Or if you want to get 15 results you need to write 15 calls (one for each single tool). Your approach does not work since it is just a shortcut to autogenerate 5 results with a single call (and that obviously does not create different IDs).

recordIssues id: „jdk8-maven", enabledForFailure: true, tool: mavenConsole()
recordIssues id: „jdk8-pmd", enabledForFailure: true, tool: pmdParser()



--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAPoyBqQdJES2XP0E80N-0iFF_vjXBoYA2MDfvJ0nmO%3DUS9y-cg%40mail.gmail.com.

Olivier Lamy

unread,
Nov 27, 2020, 1:23:20 AM11/27/20
to jenkin...@googlegroups.com
This works perfectly! Thanks a lot!

cheers
Olivier

Jesse Glick

unread,
Nov 29, 2020, 5:21:04 PM11/29/20
to Jenkins Dev
I would disable SpotBugs, Checkstyle, and PMD on all but one branch, since the results should be a function of the source code, not the build environment.

Ullrich Hafner

unread,
Nov 29, 2020, 6:02:45 PM11/29/20
to Jenkins Developers
SpotBugs actually works on the byte code level so there might be some different results due to the different compiler results (in theory). But I doubt that you get different results in practice. 
In Jenkins CI we also record issues only for the first environment and skip it for subsequent calls (at least the Jenkins Plugin is not running, maven still runs mvn verify).


Am 29.11.2020 um 23:20 schrieb Jesse Glick <jgl...@cloudbees.com>:

I would disable SpotBugs, Checkstyle, and PMD on all but one branch, since the results should be a function of the source code, not the build environment.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages