[JIRA] (JENKINS-61383) warning-ng reports warning to be new based on false git forensics report

27 views
Skip to first unread message

idooph@checkpoint.com (JIRA)

unread,
Mar 8, 2020, 6:35:03 AM3/8/20
to jenkinsc...@googlegroups.com
Why Name created an issue
 
Jenkins / Bug JENKINS-61383
warning-ng reports warning to be new based on false git forensics report
Issue Type: Bug Bug
Assignee: Ulli Hafner
Attachments: blames_screen.JPG, blame_cmd2.JPG, new_report_head.JPG
Components: git-forensics-plugin, warnings-ng-plugin
Created: 2020-03-08 10:34
Environment: Jenkins 2.204.5
warning-ng 8.1.0
Priority: Critical Critical
Reporter: Why Name

Warning-ng  reports different ages for lines that have the same commit.

As a result when the reported age is 1 it also reports it as "new" warning which is wrong.

here  you can see that for the same commit we get different ages. 

 

which cause it to be reported as new 

but all lines were committed at the same time (only part of the line is shown) and were not changed in the last years. 

 

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

idooph@checkpoint.com (JIRA)

unread,
Mar 8, 2020, 7:29:03 AM3/8/20
to jenkinsc...@googlegroups.com
Why Name updated an issue
Change By: Why Name
Environment: Jenkins  2.204.5
warning-ng 8.1.0
Git Forensics 0.7.0

ullrich.hafner@gmail.com (JIRA)

unread,
Mar 8, 2020, 11:51:02 AM3/8/20
to jenkinsc...@googlegroups.com

idooph@checkpoint.com (JIRA)

unread,
Mar 8, 2020, 12:03:03 PM3/8/20
to jenkinsc...@googlegroups.com
Why Name commented on Bug JENKINS-61383

not sure I understand the question. The file is changed from time to time, I can run raw git command on this commit and report the result to help track the issue. I run the git blame both on build system and on the jenkins slave that runs the cppcheck and got the same results therefore I tend to think it is a problem in the plugin and not in our setup.

It seems that there is a problem in the way the plugin calculate the age for different lines. Moreover when I do rebuilt for the same job again - i got different lines that were reported with age 1 and therefore are reported new, which is another indication of a problem.

 

ullrich.hafner@gmail.com (JIRA)

unread,
Mar 8, 2020, 1:04:03 PM3/8/20
to jenkinsc...@googlegroups.com

I see. Then a warning has been marked as new due to a refactoring, am I right? But the warning actually was not new...

idooph@checkpoint.com (JIRA)

unread,
Mar 8, 2020, 1:17:02 PM3/8/20
to jenkinsc...@googlegroups.com
Why Name edited a comment on Bug JENKINS-61383
not sure I understand the question. The file is changed from time to time, I can run raw git command on this commit and report the result to help track the issue. I run the git blame both on build system and on the jenkins slave that runs the cppcheck and got the same results therefore I tend to think it is a problem in the plugin and not in our setup.

It seems that there is a problem in the way the plugin calculate the age for different lines. Moreover when I do did rebuilt for the same job again - i got *different* lines that were reported with age 1 and therefore are reported new, which is another indication of a problem.

 

idooph@checkpoint.com (JIRA)

unread,
Mar 8, 2020, 1:19:04 PM3/8/20
to jenkinsc...@googlegroups.com
Why Name commented on Bug JENKINS-61383

AFAIU The warning has been marked as new due to the fact that the line age was reported (incorrectly) as 1 by the git forensics module. 

ullrich.hafner@gmail.com (JIRA)

unread,
Mar 8, 2020, 2:33:04 PM3/8/20
to jenkinsc...@googlegroups.com

This is not possible, detection of new warnings is based on comparing the warning sets of the current and the reference build. Are there some unrelated source code changes in sim_mgr.c (9264 +-5 lines) in the current build with respect to the reference?

idooph@checkpoint.com (JIRA)

unread,
Mar 8, 2020, 2:47:04 PM3/8/20
to jenkinsc...@googlegroups.com
Why Name commented on Bug JENKINS-61383

i think that some lines were added. I will check again tomorrow.

all the adjacent lines had the same warning and some lines were added so the warnings shifted while some of the message were still valid for the new line. 

idooph@checkpoint.com (JIRA)

unread,
Mar 8, 2020, 2:50:02 PM3/8/20
to jenkinsc...@googlegroups.com
Why Name commented on Bug JENKINS-61383

regardless of the new mechanism. How come git forensics report different age for the same commit id?

 

ullrich.hafner@gmail.com (JIRA)

unread,
Mar 8, 2020, 3:08:02 PM3/8/20
to jenkinsc...@googlegroups.com

The age has nothing to do with the Git blames. It is only computed from the properties of the warning. Two warnings are considered the same if they are equal with respect to all properties, or if the source code context is the same. The context is currently computed by the +-5 lines of the warning line.

The Git blame is computed afterwards: for every warning file and line git blame will be called. Seems that Git blame still can map the moved line of the old position.

idooph@checkpoint.com (JIRA)

unread,
Mar 9, 2020, 2:28:02 AM3/9/20
to jenkinsc...@googlegroups.com

idooph@checkpoint.com (JIRA)

unread,
Mar 9, 2020, 2:29:02 AM3/9/20
to jenkinsc...@googlegroups.com
Why Name edited a comment on Bug JENKINS-61383
 
Re: warning-ng reports warning to be new based on false git forensics report
Thanks, now it makes more sense to me. Somehow I was thought that that the age is related to the commit so I was confused. Maybe the name should somehow reflect that this is reference age. 

Anyway I collected
that the data to answer your question. The only change in the file was that 2 lines were added before the relevant line. I created an excel with all the relevant data per my understanding. Please let me know if it helps.

See the excel for more details. 

[^502_diff.xlsx]

What warning properties are compared, I assume type, details without line code itself am I correct?

How is the source code context comparison done is it git diff or free comparison?

BTW. Where in the source code this comparison is done?

 

idooph@checkpoint.com (JIRA)

unread,
Mar 9, 2020, 2:29:02 AM3/9/20
to jenkinsc...@googlegroups.com
Why Name commented on Bug JENKINS-61383

Thanks, now it makes more sense to me. Somehow I was thought that that the age is related to the commit so I was confused. Maybe the name should somehow reflect that this is reference age. 

Anyway I collected that data to answer your question. The only change in the file was that 2 lines were added before the relevant line. I created an excel with all the relevant data per my understanding. Please let me know if it helps.

See the excel for more details. 

What warning properties are compared, I assume type, details without line code itself am I correct?

How is the source code context comparison done is it git diff or free comparison?

BTW. Where in the source code this comparison is done?

 

idooph@checkpoint.com (JIRA)

unread,
Mar 9, 2020, 3:04:05 AM3/9/20
to jenkinsc...@googlegroups.com
Why Name edited a comment on Bug JENKINS-61383
Thanks, now it makes more sense to me. Somehow I was thought that that the age is related to the commit so I was confused. Maybe the name should somehow reflect that this is reference age. 

Anyway I collected the data to answer your question. The only change in the file was that 2 lines were added before the relevant line. I created an excel with all the relevant data per my understanding. Please let me know if it helps.


See the excel for more details. 

[^502_diff.xlsx]

What warning properties are compared, I assume type, details without line code itself am I correct?
Maybe comparing the actual line can help? 

How is the source code context comparison done is it git diff or free comparison?

BTW. Where in the source code this comparison is done?

 

ullrich.hafner@gmail.com (JIRA)

unread,
Mar 9, 2020, 3:37:03 AM3/9/20
to jenkinsc...@googlegroups.com

Thanks for the detailed analysis: this is exactly what I assumed. The warning lines changed from #502 to #503. Therefore the warning delta is using the context of the warning (+-5 lines) to track new warnings. This does not work in all cases.
This algorithm just uses the texts of the source code from both builds (it is independent of any source code management system).

The source code is located here: https://github.com/jenkinsci/analysis-model/blob/master/src/main/java/edu/hm/hafner/analysis/IssueDifference.java

ullrich.hafner@gmail.com (JIRA)

unread,
Mar 9, 2020, 3:42:02 AM3/9/20
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages