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

Provide generic way to upload warnings descriptions

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • warnings-ng-plugin
    • Platform: All, OS: All

      Findbugs supports the use of external plugins such as fb-contrib
      (http://fb-contrib.sourceforge.net/) but they are not supported by the findbugs
      plugin for Hudson. Although the Hudson plugin can correctly parse the output of
      Findbugs generated while using a Findbugs plugin, the Hudson plugin cannot
      correlate the bug names with the bug descriptions. The Hudson findbugs plugin
      should be enhanced to be able to use such Findbugs plugins so that the
      descriptions show up in the report.

          [JENKINS-1528] Provide generic way to upload warnings descriptions

          moobob42 created issue -

          Ulli Hafner added a comment -

          Findbugs 2.4 includes the fbcontrib package. Did you try that version?

          Do you need other (or own) plugins to be integrated with the plugin?

          Ulli Hafner added a comment - Findbugs 2.4 includes the fbcontrib package. Did you try that version? Do you need other (or own) plugins to be integrated with the plugin?

          moobob42 added a comment -

          Ah, I hadn't noticed the latest release. It works with 2.4. I don't have any
          other plugins that I use but this may be a useful enhancement for others if they
          have their own plugins.

          moobob42 added a comment - Ah, I hadn't noticed the latest release. It works with 2.4. I don't have any other plugins that I use but this may be a useful enhancement for others if they have their own plugins.

          Ulli Hafner added a comment -

          Fixed in 2.4.

          If there is a requirement for someone to use plug-in messages of a self written
          plug-in, please re-open.

          Ulli Hafner added a comment - Fixed in 2.4. If there is a requirement for someone to use plug-in messages of a self written plug-in, please re-open.
          Ulli Hafner made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          lbrinkmann added a comment -

          In our projects the client is not allowed to use his own time. Instead it has to get the Servertime.

          We've created our own Findbugs-Rules for the use of e.g. new Date().
          The Findbugs-Plugin is set to fail the build as soon as a High-Priority-Bug is reported.

          The plugin is capable of reading our resulting findbugs.xml just fine but since it doesn't recognize the "bug" it's considered "experimental" with a "low priority" which is not failing the build.

          We've added our .jar to the "plugins/findbugs/WEB-INF/lib"-folder and editet the bugrank.txt, findbugs.xml and messages.xml in the library-2.0.0-hudson3a.jar.
          This is working for us but we have to redo this every time we update the plugin (at least that's what I believe. We configured this just now and of course updated everything before we did so).

          An easier way for us to reference external Rules would be appreciated.

          lbrinkmann added a comment - In our projects the client is not allowed to use his own time. Instead it has to get the Servertime. We've created our own Findbugs-Rules for the use of e.g. new Date(). The Findbugs-Plugin is set to fail the build as soon as a High-Priority-Bug is reported. The plugin is capable of reading our resulting findbugs.xml just fine but since it doesn't recognize the "bug" it's considered "experimental" with a "low priority" which is not failing the build. We've added our .jar to the "plugins/findbugs/WEB-INF/lib"-folder and editet the bugrank.txt, findbugs.xml and messages.xml in the library-2.0.0-hudson3a.jar. This is working for us but we have to redo this every time we update the plugin (at least that's what I believe. We configured this just now and of course updated everything before we did so). An easier way for us to reference external Rules would be appreciated.
          lbrinkmann made changes -
          Resolution Original: Fixed [ 1 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]

          Ulli Hafner added a comment -

          I think these are actually two points:

          1) Show the correct priority
          2) Show the messages of additional rules

          Shouldn't 1) be automatically resolved by the finddbugs library? Is the actual bug rank not part of the created findbugs.xml file? Or is the rank just part of the rules jar?

          Ulli Hafner added a comment - I think these are actually two points: 1) Show the correct priority 2) Show the messages of additional rules Shouldn't 1) be automatically resolved by the finddbugs library? Is the actual bug rank not part of the created findbugs.xml file? Or is the rank just part of the rules jar?

          lbrinkmann added a comment -

          Sorry for the late reply,
          I expected an email if there would occur any changes to this thread and since I got none I just saw your reply this morning.

          For our findbugs-run we are using a locally installed version of findbugs with our added rules.
          The resulting findbugs.xml contains the following BugInstance and BugPattern:
          <BugInstance type="TS_JAVA_UTIL_DATE_CTOR" priority="1" abbrev="TS" category="CORRECTNESS" instanceHash="d3576a048cadb3be35d6c865f2150532" instanceOccurrenceNum="0" instanceOccurrenceMax="0">
          <BugPattern type="TS_JAVA_UTIL_DATE_CTOR" abbrev="TS" category="CORRECTNESS">

          When using the plugin we thought that you would only parse the xml-file without the need of findbugs itself but that's obviously wrong.
          Reading about the "BugRank"-Concept introduced in Release 4.13 we tried just adding our entry to the bugrank.txt but that wasn't helping either.

          To make it easier for you to get at our problem I've performed a series of tests.
          The 4 relevant files are:

          1. bugrank.txt
          2. findbugs.xml
          3. messages.xml
          4. our jar

          During my tests I've added the files one by one to the library-2.0.0-hudson3a.jar found in the lib-folder of the plugin respectively our jar directly to that folder.
          As long as the findbugs.xml is missing the System considers the above BugInstance as "Low Priority" within the "Experimental"-Category.
          When inserting our bug-descriptions into the findbugs.xml the PluginLoader tries to instantiate the class resulting in:

          > Caused by: edu.umd.cs.findbugs.PluginException: Could not instantiate detector class: java.lang.ClassNotFoundException: de.findbugs.detector.TimeServiceDetector
          > at edu.umd.cs.findbugs.PluginLoader.init(PluginLoader.java:638)
          > at edu.umd.cs.findbugs.PluginLoader.loadPlugin(PluginLoader.java:254)
          > at edu.umd.cs.findbugs.PluginLoader.loadInitialPlugins(PluginLoader.java:1053)
          > ... 23 more
          > Caused by: java.lang.ClassNotFoundException: de.findbugs.detector.TimeServiceDetector
          > at java.net.URLClassLoader$1.run(URLClassLoader.java:200)

          Adding our jar to the libs-folder of the plugin it is missing the detector description:

          > Caused by: edu.umd.cs.findbugs.PluginException: Missing Detector description for detector de.findbugs.detector.TimeServiceDetector
          > at edu.umd.cs.findbugs.PluginLoader.findMessageNode(PluginLoader.java:907)
          > at edu.umd.cs.findbugs.PluginLoader.init(PluginLoader.java:625)
          > at edu.umd.cs.findbugs.PluginLoader.loadPlugin(PluginLoader.java:254)
          > at edu.umd.cs.findbugs.PluginLoader.loadInitialPlugins(PluginLoader.java:1053)

          Adding the messages.xml the System suddenly considers the BugInstance as "Normal Priority" whithin the choosen "Correctness"-Category.
          So we are nearly there, the only thing not working out is the priority. Adding the our information to the bugrank.txt resolves the last issue.

          The StackTraces are way longer if you need more of it feel free to ask.

          One minor issue remains. The BugPattern in the findbugs.xml lists as follows:
          <BugPattern type="TS_JAVA_UTIL_DATE_CTOR" abbrev="TS" category="CORRECTNESS">
          <ShortDescription>Direkter Zugriff auf new java.util.Date()</ShortDescription>
          <Details><![CDATA[

          <p>Long German Text</p>
          <p>LGT Part 2</p>

          ]]></Details>
          </BugPattern>

          The Results Page is missing the Details:
          > Zugriff auf new java.util.Date() ohne den TimeService gefunden in de.psi.passage3.kernel.test.gui.filter.AbstractTestFilterPanelVC$1.run().0 comments
          >
          > Keine Beschreibung vorhanden.

          I hope this helps you with our problem if I'm missing a majof point of plugin-installation, classpath etc. just tell me.

          BTW: Thanks a lot for your great plugins!

          lbrinkmann added a comment - Sorry for the late reply, I expected an email if there would occur any changes to this thread and since I got none I just saw your reply this morning. For our findbugs-run we are using a locally installed version of findbugs with our added rules. The resulting findbugs.xml contains the following BugInstance and BugPattern: <BugInstance type="TS_JAVA_UTIL_DATE_CTOR" priority="1" abbrev="TS" category="CORRECTNESS" instanceHash="d3576a048cadb3be35d6c865f2150532" instanceOccurrenceNum="0" instanceOccurrenceMax="0"> <BugPattern type="TS_JAVA_UTIL_DATE_CTOR" abbrev="TS" category="CORRECTNESS"> When using the plugin we thought that you would only parse the xml-file without the need of findbugs itself but that's obviously wrong. Reading about the "BugRank"-Concept introduced in Release 4.13 we tried just adding our entry to the bugrank.txt but that wasn't helping either. To make it easier for you to get at our problem I've performed a series of tests. The 4 relevant files are: bugrank.txt findbugs.xml messages.xml our jar During my tests I've added the files one by one to the library-2.0.0-hudson3a.jar found in the lib-folder of the plugin respectively our jar directly to that folder. As long as the findbugs.xml is missing the System considers the above BugInstance as "Low Priority" within the "Experimental"-Category. When inserting our bug-descriptions into the findbugs.xml the PluginLoader tries to instantiate the class resulting in: > Caused by: edu.umd.cs.findbugs.PluginException: Could not instantiate detector class: java.lang.ClassNotFoundException: de.findbugs.detector.TimeServiceDetector > at edu.umd.cs.findbugs.PluginLoader.init(PluginLoader.java:638) > at edu.umd.cs.findbugs.PluginLoader.loadPlugin(PluginLoader.java:254) > at edu.umd.cs.findbugs.PluginLoader.loadInitialPlugins(PluginLoader.java:1053) > ... 23 more > Caused by: java.lang.ClassNotFoundException: de.findbugs.detector.TimeServiceDetector > at java.net.URLClassLoader$1.run(URLClassLoader.java:200) Adding our jar to the libs-folder of the plugin it is missing the detector description: > Caused by: edu.umd.cs.findbugs.PluginException: Missing Detector description for detector de.findbugs.detector.TimeServiceDetector > at edu.umd.cs.findbugs.PluginLoader.findMessageNode(PluginLoader.java:907) > at edu.umd.cs.findbugs.PluginLoader.init(PluginLoader.java:625) > at edu.umd.cs.findbugs.PluginLoader.loadPlugin(PluginLoader.java:254) > at edu.umd.cs.findbugs.PluginLoader.loadInitialPlugins(PluginLoader.java:1053) Adding the messages.xml the System suddenly considers the BugInstance as "Normal Priority" whithin the choosen "Correctness"-Category. So we are nearly there, the only thing not working out is the priority. Adding the our information to the bugrank.txt resolves the last issue. The StackTraces are way longer if you need more of it feel free to ask. One minor issue remains. The BugPattern in the findbugs.xml lists as follows: <BugPattern type="TS_JAVA_UTIL_DATE_CTOR" abbrev="TS" category="CORRECTNESS"> <ShortDescription>Direkter Zugriff auf new java.util.Date()</ShortDescription> <Details><![CDATA[ <p>Long German Text</p> <p>LGT Part 2</p> ]]></Details> </BugPattern> The Results Page is missing the Details: > Zugriff auf new java.util.Date() ohne den TimeService gefunden in de.psi.passage3.kernel.test.gui.filter.AbstractTestFilterPanelVC$1.run().0 comments > > Keine Beschreibung vorhanden. I hope this helps you with our problem if I'm missing a majof point of plugin-installation, classpath etc. just tell me. BTW: Thanks a lot for your great plugins!

          Ulli Hafner added a comment -

          Ok, now I understand. What basically is missing is a way to upload (or configure) additional findbugs plug-ins. This will be quite complicated since Hudson may run in an application server and the classloading needs to be carefully done.

          One side note: since normally the findbugs.xml file contains only the warnings short message (and not the long one) the plug-in loads the bundles messages.xml files. This is the reason for the last problem in your description. I.e., this file needs to be added (resolved), too.

          Ulli Hafner added a comment - Ok, now I understand. What basically is missing is a way to upload (or configure) additional findbugs plug-ins. This will be quite complicated since Hudson may run in an application server and the classloading needs to be carefully done. One side note: since normally the findbugs.xml file contains only the warnings short message (and not the long one) the plug-in loads the bundles messages.xml files. This is the reason for the last problem in your description. I.e., this file needs to be added (resolved), too.

            Unassigned Unassigned
            moobob42 moobob42
            Votes:
            4 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated: