[JIRA] (JENKINS-57312) Get Delta-Report in Pipeline

13 views
Skip to first unread message

christian.treczoks@continental-corporation.com (JIRA)

unread,
May 2, 2019, 11:40:02 AM5/2/19
to jenkinsc...@googlegroups.com
Christian Treczoks created an issue
 
Jenkins / New Feature JENKINS-57312
Get Delta-Report in Pipeline
Issue Type: New Feature New Feature
Assignee: Ulli Hafner
Attachments: image-2019-05-02-17-37-28-868.png
Components: warnings-ng-plugin
Created: 2019-05-02 15:39
Priority: Minor Minor
Reporter: Christian Treczoks

In my environment Jenkins currently sends automatically eMails to the Build-Requester with the status of the build incl. the link to the Job.

It would be great if it's possible to send directly the delta-report information of Warnings-NG, how many new warnings were introduced, how many solved, but I couldn't find out how to get this information within the pipeline.

In the web-interface I already can see this:

I don't think that all developers are clicking on the link in the mail, but they would if the notification mail would already say: "10 new warnings introduced, please check and correct!"

 

Thanks!

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

ullrich.hafner@gmail.com (JIRA)

unread,
May 12, 2019, 3:12:02 PM5/12/19
to jenkinsc...@googlegroups.com
Ulli Hafner commented on New Feature JENKINS-57312
 
Re: Get Delta-Report in Pipeline

You can either use the available token (see https://github.com/jenkinsci/warnings-ng-plugin/blob/master/doc/Documentation.md#token-macro-support) or directly work with the created object of the

{publishIssues}

step. Would that work for you?

ullrich.hafner@gmail.com (JIRA)

unread,
May 12, 2019, 3:13:02 PM5/12/19
to jenkinsc...@googlegroups.com
Ulli Hafner edited a comment on New Feature JENKINS-57312

christian.treczoks@continental-corporation.com (JIRA)

unread,
May 13, 2019, 5:09:02 AM5/13/19
to jenkinsc...@googlegroups.com

The ANALYSIS_ISSUES_COUNT is a very good idea, but when I understand the documentation correctly, it only delivers the number of all issues, not just the newly added. If there would be a Token-Macro-Parameter to select only the new warnings, it would be the perfect solution.

 

How can I get these information from the object? Is there a special method for getting this?

 

ullrich.hafner@gmail.com (JIRA)

unread,
May 13, 2019, 5:23:02 AM5/13/19
to jenkinsc...@googlegroups.com

Are you using a scripted pipeline? Then you just can call any public method on the returned objects.

def pmd = scanForIssues tool: pmdParser(pattern: '**/target/pmd.xml')
def action = publishIssues issues: [pmd]
def result = action.getResult()
def newSize = result.getNewSize()

scanForIssues returns an AnnotatedReport and publishIssues returns a ResultAction, see warnings-ng plugin source.

ullrich.hafner@gmail.com (JIRA)

unread,
May 13, 2019, 5:24:02 AM5/13/19
to jenkinsc...@googlegroups.com

(BTW: another option would be to use the remote API)

ullrich.hafner@gmail.com (JIRA)

unread,
May 13, 2019, 5:25:01 AM5/13/19
to jenkinsc...@googlegroups.com

Is it ok if I rephrase this issue so that it is only about creating another token (or parameter) so that you can obtain the number of new warnings as well? Or should we create an additional one for the token?

christian.treczoks@continental-corporation.com (JIRA)

unread,
May 13, 2019, 5:43:01 AM5/13/19
to jenkinsc...@googlegroups.com

yes, I'm using Scripted Pipeline. I will test this.

Yes, you can rephrase this issue. One issue is enough

Reply all
Reply to author
Forward
0 new messages