Appending to build log after complete

瀏覽次數:12 次
跳到第一則未讀訊息

Tim Jacomb

未讀,
2019年6月3日 凌晨3:51:542019/6/3
收件者:Jenkins Developers
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

Jesse Glick

未讀,
2019年6月3日 上午8:03:292019/6/3
收件者:Jenkins Dev
On Mon, Jun 3, 2019 at 3:51 AM Tim Jacomb <timja...@gmail.com> 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.

Tim Jacomb

未讀,
2019年6月9日 清晨6:54:142019/6/9
收件者:Jenkins Developers
Thanks Jesse
I've created an Action.


Any feedback welcomed

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-de...@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.
回覆所有人
回覆作者
轉寄
0 則新訊息