Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-62198

Warnings Next Generation: Links not created for SpotBugs

    XMLWordPrintable

Details

    Description

      I have two Jobs using Warnings Next Generation Plugin for code analysis purposes. Both use the following analysis tools:

      • Checkstyle
      • CPD
      • PMD
      • SpotBugs

      The project is built with maven using the corresponding plugins for the tools.

      One of the Jobs is analyzing the master branch of a Git repository, the other one analyzes ticket branches and compares the result against the first job using a quality gate. As I need to send a mail to the author of the last git commit of the ticket branch, I had to switch to a pipeline job for the second job, while the first is still a classic jenkins job configured through the ui.

      Now I have noticed that for SpotBugs the links to the issues in the code is not set, while it is working for the first job for creating the baseline. I made second version for the first job using a pipeline job and can reproduce the same problem, so it seems that:

      • The problem is not related with the comparism between the two jobs.
      • The problem occurs only with pipeline jobs.

      There is nothing special with the recordIssues-statement IMO:

      recordIssues(
                  aggregatingResults: true, enabledForFailure: true, ignoreQualityGate: true, sourceCodeEncoding: 'UTF-8', sourceDirectory: 'src/main/java',
                  tools: [
                      checkStyle(pattern: 'target/checkstyle-result.xml', reportEncoding: 'UTF-8'),
                      mavenConsole(),
                      java(),
                      cpd(pattern: 'target/cpd.xml', reportEncoding: 'UTF-8'),
                      pmdParser(pattern: 'target/pmd.xml', reportEncoding: 'UTF-8'),
                      spotBugs(pattern: 'target/spotbugsXml.xml', reportEncoding: 'UTF-8', useRankAsPriority: true)
                  ]
              )
      

      In the logs of the alternative version of job one, I can see that the files are found to be not in the workspace anymore, yet they are there and there is nothing special about them.

      As of the other tools, their links all work correctly in both jobs. That is, if I use sed commands to relativize the paths to the issues in their resulting files as otherwise they are not recognized as being in the workspace. However, there is no such command for SpotBugs as the links seemed to work at first sight.

      BTW: the plugin should provide a way to relativize the paths for the other tools in future. The tools use absolute paths, there's nothing the users could do about it. Having to trick with sed commands feels nasty, the plugin should be able to deal with that.

      Attachments

        Activity

          thedentist Daniel Kepes created issue -

          People

            drulli Ulli Hafner
            thedentist Daniel Kepes
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: