melexis / warnings-plugin

Command-line tool for marking builds with too many warnings as failed. A command-line alternative for https://github.com/jenkinsci/warnings-plugin. Useable with plugin-less CI systems like Gitlab-CI and even Travis-CI
Apache License 2.0
7 stars 3 forks source link

Statistics on solved and new errors disappeared for analysis in Cppcheck #139

Closed radiofox1 closed 6 months ago

radiofox1 commented 6 months ago

Hello,

I encountered the following issue:

After updating the Warnings plugin to version v11.0.0, statistics on solved and new errors disappeared for analysis in Cppcheck. Before update:

before_update

After update:

after_update

When I try to roll back to an older version of Warning-plugin, I get an error when analyzing: 20:24:14 java.lang.NullPointerException: Cannot invoke "io.jenkins.plugins.analysis.core.util.QualityGateStatus.isSuccessful()" because "this.qualityGateStatus" is null For the full log see the attachment warning_plugin_errors.log.

It feels like there is no comparison with the previous launch because there is no reference to it. In this case, the graphs are built correctly.

Jenkins version: 2.440.1

Updating to version 11.1.0 also did not help, but another problem appeared: When you go to the Types tab, all pages are not displayed, but only 1. This happened after updating the plugin to version 11.1.0. There is no such problem with other tabs.

problem_with_pages_num

But this is not such a critical problem as described above. The fact that statistics are not displayed greatly complicates the work. I have to manually compare the previous and new results.

I would be very grateful if you could solve this problem. Please feel free to ask additional questions.

Letme commented 6 months ago

I think you want to open this issue in the Jenkins Warnings plugin?

We are command line equivalent so you are more than welcome to also try out our program to keep your technical debt under control.

radiofox1 commented 6 months ago

I think you want to open this issue in the Jenkins Warnings plugin?

We are command line equivalent so you are more than welcome to also try out our program to keep your technical debt under control.

Yes, I have CI in Jenkins and I would like to see the correct display of results by the Warnings plugin in it

Letme commented 6 months ago

What you show is a Jenkins GUI, so I assume you want to open this on Jenkins warnings plugin page.

But as mentioned, if you want pure command line warnings control then you should try our plugin. I dont remeber anymore how Jenkins displays the warnings, but it might be simple integration.

radiofox1 commented 6 months ago

Hi, Thanks for your reply. Sorry, I seem to have mixed up the repositories for warnings-ng plugin (for jenkins) and warnings plugin (cli tool). I'll have to move my bug report there. Regarding your instrument, it would be interesting to try that too. But I still don’t quite understand what the result of error parsing will be and how I can use your cli to parse cppcheck analysis results (they are in xml format)

Letme commented 6 months ago

Results of error parsing is failed job (if limits are breached - return value of number of found warnings), or a passing job (return value 0) if they are within the expected values. The presentation is in command line print with usually a simple statement (no GUI) why job was marked as failed.

We currently do not support cppcheck XML output, so that would be a feature request if you are willing to help us specify what all you usually want to set the limits on:

(just for my reference from cppcheck manual):

XML output

Cppcheck can generate output in XML format. Use --xml to enable this format. A sample command to check a file and output errors in the XML format:

cppcheck --xml file1.cpp

Here is a sample report:

<?xml version="1.0" encoding="UTF-8"?>
<results version="2">
<cppcheck version="1.66"/>
<errors>
<error id="someError" severity="error" msg="short error text"
verbose="long error text" inconclusive="true" cwe="312">
<location file0="file.c" file="file.h" line="1"/>
</error>
</errors>
</results>

The <error> element Each error is reported in a <error> element. Attributes: id id of error, and which are valid symbolnames severity error/warning/style/performance/portability/information msg the error message in short format verbose the error message in long format inconclusive this attribute is only used when the error message is inconclusive cwe CWE ID for the problem; note that this attribute is only used when the CWE ID for the message is known

radiofox1 commented 6 months ago

Thanks, I already solved my problem in the Jenkins plugin. I think this ticket could be closed. Thank you for your quick response and for pointing me in the right direction on time :)

Letme commented 6 months ago

Glad to help.