On Tue, Oct 22, 2019 at 5:44 AM Ullrich Hafner <
ullrich...@gmail.com> wrote:
> .withContext(new ConsoleLogSplitter(…)) // implements TaskListenerDecorator and writes the output to a temporary file
> .withCallback(new RecordIssuesCallback(…)) // extends BodyExecutionCallback and reads the temporary file to extract the warnings
This sort of defeats the purpose of using `TaskListenerDecorator`, I
think. You should be able to extract warnings on the fly without
making a copy of the log.
Note that to behave properly with `sh`/`bat`/`powershell` steps in
`org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep.USE_WATCHING=true`
mode (including when `pipeline-cloudwatch-logs` is installed), as well
as to handle some other steps like `checkout`, the
`TaskListenerDecorator` must be prepared to run remotely inside the
agent JVM. (See JEP-210 for background.) Under the assumption that
warnings are occasional low-bandwidth events, this is most easily done
by calling an exported interface method. The `timeout` step
implementation has an example.