[Dev] Showing Build Results on the Build Page

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[Dev] Showing Build Results on the Build Page

Ulli Hafner-2
Hi,

I'm trying to write a findbugs plugin, that scans the build workspace
for
findbugs.xml files, counts the number of warnings (optionally marks a
build
as unstable) and displays the results on the build page.

While it was quite easy, to write the Publisher classes (Thanks for the
hello
world example!) I have some problems on how to show the results of the
publisher.
Currently I have a Publisher class, that records the results in the
builds directory
and fails the build if a threshold is reached. In the Publisher I
register
a HealthReportingAction and a ProminentProjectAction, like this was done
in
the emma and clover plug-ins. When I use simple classes that implement
these interfaces,
then I get an Icon and Link in Hudson Project Page Side Panel and Main
Page. However,
in the project build page, I only get an Icon and Link on the side
panel, but not on
the build main page.

I assume that I have to write a jelly floating box here? Does someone
have a small example on
how to add a simple Text Box on the build page (I never worked with JSP
or jelly...).
I looked at the graph examples, but these jelly files don't fit. E.g., I
would like to
have the analysis results printed in the same way as the Changelog: An
Icon on the left
and some text (number of warnings) on the right side.

Best regards, Ulli
--
Avaloq - essential for banking.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Dev] Showing Build Results on the Build Page

Stephen Connolly-2

Hafner Ullrich wrote
Hi,

I'm trying to write a findbugs plugin, that scans the build workspace
for
findbugs.xml files, counts the number of warnings (optionally marks a
build
as unstable) and displays the results on the build page.

While it was quite easy, to write the Publisher classes (Thanks for the
hello
world example!) I have some problems on how to show the results of the
publisher.
Currently I have a Publisher class, that records the results in the
builds directory
and fails the build if a threshold is reached. In the Publisher I
register
a HealthReportingAction and a ProminentProjectAction, like this was done
in
the emma and clover plug-ins. When I use simple classes that implement
these interfaces,
then I get an Icon and Link in Hudson Project Page Side Panel and Main
Page. However,
in the project build page, I only get an Icon and Link on the side
panel, but not on
the build main page.

I assume that I have to write a jelly floating box here? Does someone
have a small example on
how to add a simple Text Box on the build page (I never worked with JSP
or jelly...).
I looked at the graph examples, but these jelly files don't fit. E.g., I
would like to
have the analysis results printed in the same way as the Changelog: An
Icon on the left
and some text (number of warnings) on the right side.

Best regards, Ulli
--
Avaloq - essential for banking.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@hudson.dev.java.net
For additional commands, e-mail: users-help@hudson.dev.java.net
This is something I would like to see as well.  At present, if you want some detail, you need to do some hacking in how you return your action name (I've held back on that as it's not in keeping with how most plugins work) but I would like to see a two .jelly files that gets automatically included for all ProminentProjectAction's and displays after the action name.  This would allow removal of the Unit Test "hack" in the code at present.

One jelly file would be included on the job screen.  The second would be included on the project screen.

[Kohsuke] I can make the changes if I knew what they were.  (Or is the code now factored so that this can be done automatically and we just don't know what the jelly file names are supposed to be!)

I want to have on the build and main pages, e.g.

Coverage Report Conditionals 75%.  Methods 86%. Statements 79%.

Just like we have

Test Results (no failures)
Reply | Threaded
Open this post in threaded view
|

Re: [Dev] Showing Build Results on the Build Page

Stephen Connolly-2
In reply to this post by Ulli Hafner-2
Hafner Ullrich wrote
Hi,

I'm trying to write a findbugs plugin, that scans the build workspace
for findbugs.xml files, counts the number of warnings (optionally marks a
build as unstable) and displays the results on the build page.

While it was quite easy, to write the Publisher classes (Thanks for the
hello world example!) I have some problems on how to show the results of the
publisher. Currently I have a Publisher class, that records the results in the
builds directory and fails the build if a threshold is reached.
I think you want a number of thresholds:

100% health threshold (i.e. if # of bugs < this, report health as 100%) you need this for legacy projects that have lots of bugs and you want a target that gives health feedback.

0% health threshold (i.e. if # of bugs > this, report health as 0%) for the same reason as 100% health.  in between I would recommend linear interpolation

Unstable threshold (i.e. if # of bugs > this, mark build as unstable)

Fail threshold (i.e. if # of bugs > this, mark build as broken)
Reply | Threaded
Open this post in threaded view
|

Re: [Dev] Showing Build Results on the Build Page

Kohsuke Kawaguchi
Administrator
In reply to this post by Ulli Hafner-2
Hafner Ullrich wrote:
> Hi,
>
> I'm trying to write a findbugs plugin, that scans the build workspace
> for
> findbugs.xml files, counts the number of warnings (optionally marks a
> build
> as unstable) and displays the results on the build page.

Great to hear that you are working on the findbugs plugin. Any chance
you can move the source code to hudson CVS? If so, let me know your
java.net id so that I can add you.

> While it was quite easy, to write the Publisher classes (Thanks for the
> hello
> world example!) I have some problems on how to show the results of the
> publisher.
> Currently I have a Publisher class, that records the results in the
> builds directory
> and fails the build if a threshold is reached. In the Publisher I
> register
> a HealthReportingAction and a ProminentProjectAction, like this was done
> in
> the emma and clover plug-ins. When I use simple classes that implement
> these interfaces,
> then I get an Icon and Link in Hudson Project Page Side Panel and Main
> Page. However,
> in the project build page, I only get an Icon and Link on the side
> panel, but not on
> the build main page.
>
> I assume that I have to write a jelly floating box here? Does someone
> have a small example on
> how to add a simple Text Box on the build page (I never worked with JSP
> or jelly...).
There are two three things that action can contribute to the build top
page like http://server/hudson/job/JOBNAME/51/

   1. link on the side panel
   2. floating box
   3. "summary" icon and text in the center

Emma plugin for example does (2) by adding floatingBox.jelly. If you do
"find . -name floatingBox.jelly" you'll find quite a few of them in
various places.

(3) allows you to list the items along the same level with changelog,
artifacts, test results etc. This is done by writing summary.jelly. You
can see the example of this in JIRA plugin (although the actual stuff is
commented out.) Again, try "find . -name summary.jelly".


> I looked at the graph examples, but these jelly files don't fit. E.g., I
> would like to
> have the analysis results printed in the same way as the Changelog: An
> Icon on the left
> and some text (number of warnings) on the right side.


--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Dev] Showing Build Results on the Build Page

Kohsuke Kawaguchi
Administrator
In reply to this post by Stephen Connolly-2
Stephen Connolly wrote:
> This is something I would like to see as well.  At present, if you want some
> detail, you need to do some hacking in how you return your action name (I've
> held back on that as it's not in keeping with how most plugins work) but I
> would like to see a two .jelly files that gets automatically included for
> all ProminentProjectAction's and displays after the action name.  This would
> allow removal of the Unit Test "hack" in the code at present.

Is the "summary.jelly" I explained what you need? Or are you saying that
you'd like to see something else?

It looks like TestResultAction is not using this hook, and I guess
that's what you mean by the unit test hack. We should be able to fix
that to use summary.jelly  mechanism.

> [Kohsuke] I can make the changes if I knew what they were.  (Or is the code
> now factored so that this can be done automatically and we just don't know
> what the jelly file names are supposed to be!)
>
> I want to have on the build and main pages, e.g.
>
> Coverage Report  Conditionals 75%.  Methods 86%. Statements 79%.
>
> Just like we have
>
> Test Results  (no failures)
Yeah, that sounds exactly like what summary.jelly is designed for.

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: [Dev] Showing Build Results on the Build Page

Ulli Hafner-2
Hi,

thanks, the summary.jelly was the missing link! Now the findbugs results
summary is shown on the build page.

Best regards, Ulli

> -----Original Message-----
> From: Kohsuke Kawaguchi [mailto:[hidden email]]
> Sent: Thursday, July 19, 2007 5:58 PM
> To: [hidden email]
> Subject: Re: [Dev] Showing Build Results on the Build Page
>
> Stephen Connolly wrote:
> > This is something I would like to see as well.  At present, if you
> > want some detail, you need to do some hacking in how you
> return your
> > action name (I've held back on that as it's not in keeping with how
> > most plugins work) but I would like to see a two .jelly files that
> > gets automatically included for all ProminentProjectAction's and
> > displays after the action name.  This would allow removal
> of the Unit Test "hack" in the code at present.
>
> Is the "summary.jelly" I explained what you need? Or are you
> saying that you'd like to see something else?
>
> It looks like TestResultAction is not using this hook, and I
> guess that's what you mean by the unit test hack. We should
> be able to fix that to use summary.jelly  mechanism.
>
> > [Kohsuke] I can make the changes if I knew what they were.  
> (Or is the
> > code now factored so that this can be done automatically
> and we just
> > don't know what the jelly file names are supposed to be!)
> >
> > I want to have on the build and main pages, e.g.
> >
> > Coverage Report  Conditionals 75%.  Methods 86%. Statements 79%.
> >
> > Just like we have
> >
> > Test Results  (no failures)
>
> Yeah, that sounds exactly like what summary.jelly is designed for.
>
> --
> Kohsuke Kawaguchi
> Sun Microsystems                   [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: [Dev] Showing Build Results on the Build Page

Ulli Hafner-2
In reply to this post by Kohsuke Kawaguchi
> >
> > I'm trying to write a findbugs plugin, that scans the build
> workspace
> > for findbugs.xml files, counts the number of warnings (optionally
> > marks a build as unstable) and displays the results on the
> build page.
>
> Great to hear that you are working on the findbugs plugin.
> Any chance you can move the source code to hudson CVS? If so,
> let me know your java.net id so that I can add you.
>

Yes, I would like to contribute the code to the hudson CVS, my java.net
id is drulli.

Ulli

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: [Dev] Showing Build Results on the Build Page

Ulli Hafner-2
In reply to this post by Stephen Connolly-2
> >
> > While it was quite easy, to write the Publisher classes (Thanks for
> > the hello world example!) I have some problems on how to show the
> > results of the publisher. Currently I have a Publisher class, that
> > records the results in the builds directory and fails the
> build if a
> > threshold is reached.
> >
>
> I think you want a number of thresholds:
>
> 100% health threshold (i.e. if # of bugs < this, report
> health as 100%) you need this for legacy projects that have
> lots of bugs and you want a target that gives health feedback.
>
> 0% health threshold (i.e. if # of bugs > this, report health
> as 0%) for the same reason as 100% health.  in between I
> would recommend linear interpolation
>
> Unstable threshold (i.e. if # of bugs > this, mark build as unstable)
>
> Fail threshold (i.e. if # of bugs > this, mark build as broken)

Yes, I already thought about these things (I just tried to get my first
plug-in running:-). I will add such configuration thresholds in the next
step.

Thanks, Ulli

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Dev] Showing Build Results on the Build Page

Kohsuke Kawaguchi
Administrator
In reply to this post by Ulli Hafner-2
Hafner Ullrich wrote:
> Yes, I would like to contribute the code to the hudson CVS, my java.net
> id is drulli.

Added. Welcome on board. You can find all the other plugins at
hudson/plugins. Feel free to create findbugs in there and add source code.

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment