Re: Appending to build log after complete

2019-06-09 Thread Tim Jacomb
Thanks Jesse
I've created an Action.

https://github.com/jenkinsci/build-failure-analyzer-plugin/pull/106

Any feedback welcomed

Thanks
Tim

On Mon, 3 Jun 2019 at 13:03, Jesse Glick  wrote:

> On Mon, Jun 3, 2019 at 3:51 AM Tim Jacomb  wrote:
> > It has functionality where a user can force another analysis to be run
> on a build
> > This gets the log file on disk, opens a PrintStream to it and appends
> log information to it about the scan result
>
> Should be rewritten to do something else, like attach an `Action` that
> somehow displays an analysis, for example in a box on the build’s
> index page.
>
> > Is there a supported way to append to a log file after the build is
> completed?
>
> No.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr3a3pF7prC6Q7Xf0WSQ16fSDf1MsUhgkSqcGgQN8FoOkQ%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAH-3BidhFPq2G-NWcKa2J3-mC3YrP_icQ-p5fE-7VS8X52ge_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Appending to build log after complete

2019-06-03 Thread Jesse Glick
On Mon, Jun 3, 2019 at 3:51 AM Tim Jacomb  wrote:
> It has functionality where a user can force another analysis to be run on a 
> build
> This gets the log file on disk, opens a PrintStream to it and appends log 
> information to it about the scan result

Should be rewritten to do something else, like attach an `Action` that
somehow displays an analysis, for example in a box on the build’s
index page.

> Is there a supported way to append to a log file after the build is completed?

No.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr3a3pF7prC6Q7Xf0WSQ16fSDf1MsUhgkSqcGgQN8FoOkQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Appending to build log after complete

2019-06-03 Thread Tim Jacomb
Hi

I'm looking at fixing JENKINS-54840
 in the
build-failure-analyzer plugin

It has functionality where a user can force another analysis to be run on a
build
This gets the log file on disk, opens a PrintStream to it and appends log
information to it about the scan result
Code:
https://github.com/jenkinsci/build-failure-analyzer-plugin/blob/master/src/main/java/com/sonyericsson/jenkins/plugins/bfa/sod/ScanOnDemandTask.java#L110

On recent pipeline versions this is logging exceptions on every call
"WARNING org.jenkinsci.plugins.workflow.job.WorkflowRun getLogFileAvoid
calling getLogFile on TestWorkflow/TestWorkflow #362
java.lang.UnsupportedOperationException"

Is there a supported way to append to a log file after the build is
completed? I see ways to get an InputStream, the log text and writeLogTo
(seems to be for writing a whole log though)

Or should this functionality be re-written?
My guess is that build-failure-analyzer should probably have it's own log
file, which can just be overwritten on every scan.
If this is the approach is there any good example out there that you would
recommend?

Thanks
Tim

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAH-3BicsP%2B1hpkVEjT319ZTg9oS7_KrAt2x0qe6HzFYDAFv72w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.