Reports get wrong links and cannot be found in Jenkins - jenkins

In the build.xml of my Jenkins (PHP) project (hosted on a Windows Server) multiple reports are defined (PMD Warnings, Duplicate Code, JDepend, Checkstyle Warnings, Coverage Summary Report, PHPUnit_Code_Coverage, PHPDox). All the needed plug-ins are installed and the links of the most of the reports in the menu and on the dashboard
lead to the appropriate report pages.
Only two links (PHPUnit Code Coverage and PHPDox) don't work and show a 404 page:
Though they seem to be set correctly:
Why does this issue occurs and how to make Jenkins add the reports correctly to the project's menu/dashboard?

Related

File coverage tab is always loading and never shows coverage files when using OpenCover plugin in Jenkins

Background
I'm using OpenCover 4.7.1221 to run vstest.console.exe in a Jenkins pipeline via bat script in a steps block to generate a coverage.xml file. Then, I'm running the Code Coverage API plugin with the OpenCover plugin adapter (```publishCoverage adapters: [opencoverAdapter```) to generate the code coverage from the coverage.xml file. My setup is very similar to the setup used in the following [this blog post][1].
When the job is complete, a Coverage Report link displays on the menu. When I click the Coverage Report link, there is a Coverage Overview chart and a Coverage Trend chart. Below the two charts, there's a Coverage Details section that has two tabs. The default selected tab is File Coverage and the other tab is Package Overview.
If I click Package Overview, a code coverage heat map displays with the heading, "OpenCover coverage: coverage.xml". However, when I click the File Coverage tab, it displays a DataTables.net table that just says, "Loading - please wait ...". This table never changes and never shows any files or source code as I'm guessing it's supposed to.
I have searched for answers and found nothing. I searched images and found nothing. Most articles, forum posts, or blogs use ReportGenerator.exe to create an HTML report and import that into Jenkins, and I have done that successfully, but I'm curious why nothing ever loads on the File Coverage tab.
Question
Does this not work and is that why I'm only seeing the ReportGenerator.exe output in my searches? I'm primarily interested in whether or not this ever works so I can decide whether to continue spending time on it. If it does work and someone has a working example, that would be great, too.
Thanks!
The same issue occurs with llvm-cov, so it appears that the plugin is currently broken. With an older version of the plugin, the data was all visible.

Sonar-Gerrit Jenkins plugin ambiguous results

I use Gerrit-Sonar plugin in my Jenkins jobs.
When I run the job, I get an exact result in the logs, that "n issues were found" and the report was sent to Gerrit. However, when I watch the review in Gerrit, it says that "No issues were found" and review gets a +1 score.
What could be the cause of this behaviour?
I assume this issue is related to your filter settings.
So, what are the possible reasons of so many issues being ignored?
First, sonar report contains all issues of the project.
If you have your flag "Report new issues only", then all the issues that are already exist in sonar database will be omitted.
Next, flag "Add comments to changed lines only" allows plugin to ignore all issues that belongs to lines of code not changed in current commit. (For example, if sonar database refreshes once a day, all issues created in all commits during that day will be new, but only author of each of them supposed to care - so they are only visible to the author.
Finally, by default only issues with Major (and higher) severity will mark build as failed.
You may change filter settings. See project Wiki for details on how to do that.
This behaviour could also be related to the issue JENKINS-43047 with nested modules. If your project has several nested levels, the path of module component in the exported sonar-report.json is not the full path but the path component of the module. The plugin hasn't process it correctly before the version 1.0.8.
Another issue is JENKINS-43730, if you have 0 project configurations added. Add default configuration so your sonar report could be found by plugin

Jenkins Plugin that Aggregates/Summarizes Reports for a Build

I'm searching for an existing Jenkins plugin or something close to it. This is my ideal:
Provides a link to the side on a build page
Clicking the link will open up a page with a summary of the various reports (ideally configured)
Reports could include:
Cobertura
Surefire
Static analysis
Security
Other
There will be links to the full report pages from the other plugins as well as a few columns providing basic info like Status, Details, and another column or two maybe
This seems basic enough that I would think it already exists, but I haven't found anything yet.
The existing Cobertura, JUnit and various Static Analysis plugins for Jenkins will already add links to each build page, pointing to a summary of the results of each tool.
For other tools, you can use the HTML Publisher plugin to add more links to each build page.
But I don't believe there is another plugin which will build some sort of summary from a list of arbitrary reports.

SonarQube C# Runner and Visual Studio report different CA results

I am trying to setup SonarQube to report on our C# projects. I have created a new Quality Profile in SQ which only include the Code Analysis rules (225 in total). I have made sure that these rules are in sync with the projects in source in Visual Studio.
When SonarQube analysis is run, different results are reported. Visual Studio tends to pick up more than the SonarQube runner.
For example, here are 3 results from SonarQube about rule CA1704:
and for the same solution in VS, there are many more:
The 3 that I have highlighted are the 3 that SonarQube is picking up.
This is the same for a number of different rules. I want SQ and VS to report the same results. I run analysis on TFS build (vNext), can I simply pass the results from the build to SonarQube? I mean, if I don't have to run it twice then great.
Do I need to modify the SonarQube rules themselves? Has anyone experienced this problem before?
UPDATE
I have enable verbose logging on the sonar publish and I have found that it is skipping some issues found:
2016-01-08T14:33:53.5086817Z 14:33:53.430 DEBUG - Skipping the FxCop issue at line 10 which has no associated file.
2016-01-08T14:33:53.5243155Z 14:33:53.430 DEBUG - Skipping the FxCop issue at line 19 which has no associated file.
There are lots of these for every project in my solution and the gap matches exactly, e.g. in the above case, VS reports 47 issues but SonarQube reports 45. I cannot yet find a correlation and Google doesn't have much info on it. This is going to be a big problem as one of my solutions has 18.5k issues but SonarQube is only reporting 13k.
Are the CA1704 violations that aren't showing up in SonarQube for classes or for members that are declared as fields, as opposed to properties? If so, you've run into one of the more "interesting" behaviours of the FxCop plug-in for SonarQube, which is that it ignores any violations that do not include a file and line number (see the relevant source file at https://github.com/SonarSource/sonar-fxcop-library/blob/master/src/main/java/org/sonar/plugins/fxcop/FxCopSensor.java, of which current version is c518065 for the details if you're interested).
Line numbers in FxCop reports are taken from the PDB for the target assembly. However, the PDB only contains lines for executable code, so violations that aren't associated with executable lines of code (or at least with a method that FxCop can tie to its first line) won't have a file name or line number in the FxCop report. These will all end up getting ignored by SonarQube.
If you're dependent on SonarQube reporting of your FxCop results, you may wish to consider submitting a bug report.

In a TFS 2010 build summary, how do I a show a link to the logs from a custom MSBuild task?

In my TFS 2010 build definition, I call MSBuild on my own custom my.targets MSBuild project. It does all the compilation, testing, etc. that I need. Its log file is specified, as is a log drop location, and the log appears properly in that place. However I can't see it in the TFS Build Summary report. The "View Log File" link is grayed out. It seemed to work when the project I was building was a ".sln" file. What magic voodoo is baked deep in to the heart of the common MSBuild files to make this log link work properly, and how can I reproduce it?
You may find your answer in these posts from Jason Prickett:
TFS2010 – Changing The Way Build Information IS Displayed
TFS2010 – Customizing the Build Details View – Summary View
Important to note is that the MSBuild Log File will only appear if you enabled inside the build definition to copy output to the Drop Folder. If that option is disabled, the link will not appear in the build log view.

Resources