multiple recordIssues for parallel steps

瀏覽次數:277 次
跳到第一則未讀訊息

Olivier Lamy

未讀,
2020年11月26日 凌晨3:48:142020/11/26
收件者: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

未讀,
2020年11月26日 清晨6:48:432020/11/26
收件者: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

未讀,
2020年11月27日 凌晨1:23:202020/11/27
收件者:jenkin...@googlegroups.com
This works perfectly! Thanks a lot!

cheers
Olivier

Jesse Glick

未讀,
2020年11月29日 下午5:21:042020/11/29
收件者: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

未讀,
2020年11月29日 下午6:02:452020/11/29
收件者: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.
回覆所有人
回覆作者
轉寄
0 則新訊息