dev@glassfish.java.net

FindBugs in GlassFish -- Developers Please Read

From: Ed Bratt <ed.bratt_at_oracle.com>
Date: Wed, 03 Jul 2013 10:40:00 -0700

Hi there,
I wanted to take a moment and congratulate everyone for the terrific job
you did, improving the quality of GlassFish in the 4.0 release. Thanks
to your efforts, and with Neil Kenig and Michael Chen's oversight, we
reduced the total count of FindBugs errors, in the open-source
repository, from over 4000 to 597, all priorities. That's a total
reduction of over 85%!

Congratulations and well done!

We don't want to lose any of the momentum we've built up. To help assure
this, we've created new Hudson jobs which keep track of the number of
FindBugs errors, in GlassFish.

The requirement going forward is: *No increase in FindBugs errors**,
regardless of priority.* This is being continuously monitored at the
module level and is effective immediately. These jobs will send warning
e-mails, if the count increases above the benchmark we attained at the
conclusion of GlassFish 4.0.

Some of you have already seen the new warnings and may have been
wondering, what this is about. Sorry, the implementation got ahead of
the management notification thanks to our crack RE team.

Here's how it works:
If you check in code that increases the number of FindBugs in a
particular module, the new 'count' job will turn unstable (yellow) and
you will be notified by mail. This notification will cascade if there
are subsequent integrations. Any committers after the initial increase,
will also be notified, until the 'count' job turns back to stable (this
is built into Hudson). If you get an "unstable" mail from this job,
please fix the FindBugs error that you created ASAP so we can get this
job back to stable again. Clicking on the FindBugs 'Count' report for
that build shows the "New" FindBugs errors for that build.

Here are the jobs that monitor the GlassFish FindBugs Count:

    http://gf-hudson.us.oracle.com/hudson/view/FindBugs/job/gf-trunk-findbugs-closed-count/
    http://gf-hudson.us.oracle.com/hudson/view/FindBugs/job/gf-trunk-findbugs-count/

(If you are an external developer, sorry, we don't yet have a way to
export the results of these jobs right now)

To run FindBugs on your module:
% mvn ..... -Dfindbugs.threshold=Low findbugs:findbugs

The Hudson e-mail notifications are generic:
------------------------------------------------------------------------
Subject: [Hudson] Hudson build became unstable: <repository>-count #NNN
From: GF_RELEASE_WW_GRP_at_oracle.com
Body:
See
<http://gf-hudson.us.oracle.com/hudson/job/<repository>-count/NNN/changes>
------------------------------------------------------------------------
when you receive one of these, click on the gf-hudson link in the
e-mail. You can find the specific module (or modules) which are caused
this notification by browsing into the console output then search for
the string: "increased FindBugs errors".

If you receive one of these e-mails, and you have questions, send them
to gf-build_us_grp_at_oracle.com. You can also review the instructions and
suggestions on the GF Findbugs wiki page:
https://wikis.oracle.com/display/GlassFish/FindBugs

I've been given the task of continuing where Neil left off. I am working
out details of a plan which will further improve the quality, as
measured by FindBugs. We will be implementing this plan over the course
of the next release.

For now, let's hold on to the gains we have made and not let anything
creep in.

Thanks,

-- Ed