jenkinsci / build-timeout-plugin

Jenkins build-timeout plugin
https://plugins.jenkins.io/build-timeout/
31 stars 80 forks source link

Fixed findbugs issues #41

Closed rsandell closed 9 years ago

rsandell commented 9 years ago

Configured findbugs for xml output so Jenkins can pick them up. And updated the maven release plugin.

@reviewbybees

ghost commented 9 years ago

This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation.

jtnord commented 9 years ago

:bee:

stephenc commented 9 years ago

:bee:

rsandell commented 9 years ago

@reviewbybees done

ghost commented 9 years ago

This pull request has completed our internal processes and we now respectfully request the maintainers of this repository to consider our proposal contained within this pull request for merging.

ikedam commented 9 years ago

I want to see how findbug works. Could you let me know how to do that?

I could not get bug reports with mvn findbugs:findbugs even removing SuppressFBWarnings.

ikedam commented 9 years ago

@reviewbybees Please consider to make a guideline for your employees to create good pull requests. Some additional information in pull requests helps developers much.

  1. Contexts of requests.
  2. What is findbugs? How does the change work?
    • Showing an example build failed with findbugs makes developers to know what findbugs is.
  3. Why do you request the change?
ikedam commented 9 years ago

I found that I had to generate class files first.

mvn package -Dmaven.test.skip=true
mvn findbugs:findbugs -Dfindbugs.jvmArgs="-Duser.language=en -Duser.country=US"

works well. Please let me know if there's an easier way.

And I found that findbug fails with following errors on Windows, Japanese locale:

[Fatal Error] findbugsXml.xml:2:21349: Invalid byte 1 of 1-byte UTF-8 sequence.

findbugsXml.xml looks generated with ShiftJIS (a Japanese character encoding). It'll annoy me if findbug works even for releasing. I may have to define outputEncoding for findbugs.

ikedam commented 9 years ago

This looks good to me. I found fingbugs really useful.

jtnord commented 9 years ago

@ikedam the output encoding should default to project.reporting.outputEncoding. It looks like this is not set in the parent and is falling back to the platform default - and hence why you are getting Japanese encoding.

As we can't change old releases of the parent the following may work.

  <properties>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  </properties>

Note: - there presumably exists the same issue for the generated javadoc.

To view findbugs - you can do this in your IDE (eclipse, and intellij - I would guess that netbeans has something similar) or you can use mvn findbugs:gui

ikedam commented 9 years ago

@jtnord Thanks for the comment! I'll try that.

ikedam commented 9 years ago

Would someone enable findbugs feature on jenkins.ci.cloudbees.com for build-timeout-plugin?

I found that I had to ask that before merging this...I worked in a bad way, sorry.

jtnord commented 9 years ago

@ikedam enabled and set threshold to zero bugs. build 88 has been kicked off to verify the changes.

ikedam commented 9 years ago

@jtnord Thanks a lot! Some warnings look introduced in #40, and I'll work for that.

jtnord commented 9 years ago

@ikedam ok. It also reports that the source encoding has not been set.

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
rsandell commented 9 years ago

Sorry @ikedam , FindBugs is such a popular tool that I just assumed everyone knew about it and didn't need much explanation. I'll try to do better next time. Those 7 new warnings that showed up in build 88 didn't when I ran it locally on my machine, I thought that I had fixed them all.

ikedam commented 9 years ago

findbugs-maven-plugin 3.0.1 looks contain a bug in encoding handling. gleclaire/findbugs-maven-plugin#18 That reproduced also in my environment.

rsandell commented 9 years ago

Well its findbugs.xml that is the interesting one, findbugsXml.xml is IIUC of an older format that Jenkins can't use anyways.