task
task copied to clipboard
Enable GHA output grouping prevents real-time streaming of stdout/stderr
Based on https://discord.com/channels/974121106208354339/1042886315856892015 we had the following observations:
- Enabling GHA grouping via
output: groupdoes disable progressive stdout streaming. This can be problematic if user has a long-running single script, as he would get zero output on the web console - GHA allows streaming when grouping is used
- By adding
interactive: trueto a specific command, we can avoid unexpected combination from parallel task executions interactive: truecannot be defined at top level and adding it to each individual command from each individual task adds too much noise to config- A considerable number of users may not need parallel task runs
- Maybe we can we enable GHA output grouping without having to customise Taskfiles? (detect GH specific env vars)
Feedback welcome to this ticket, especially as we do not know exactly what would the optimal behavior.
This is about allowing begin and end for interleaved just like we allow for group:
output:
interleaved:
begin: '::group::{{.TASK}}'
end: '::endgroup::'
The problem is: the output will be messed up if multiple tasks run at the same time (output would be mixed, that's why it wasn't initially allowed).
Some possibilities:
- Raise an error if multiple tasks run at the same time with this configuration?
- Show an yellow warning on the console?
- Force tasks to run serially?
interactive: truedoes that, even though we added this flag with other use case in mind (That's why its name looks strange into this context. Could have been namedserial: true?)
One option is to just do interleaved with some support to collect the groups output afterwards when the step completes/fails? It seems that GH supports overwriting the step job summary, which would "clean" the output for better viewing afterwards if you don't need to have it live during a step?
GHA allows streaming when grouping is used
Does that mean it'll append to an existing group when the markers are declared again? The GH docs for this feature are rather lacking.
If not, I suppose you could collect log lines per group and update/display multiple lines for a group per interval? That'd be a little better than the mess interleaved otherwise introduces, while giving feedback sooner than grouped does.
Maybe we can we enable GHA output grouping without having to customise Taskfiles? (detect GH specific env vars)
As mentioned in the original feature request with Task, other CI have similar feature but slightly different syntax. Probably better as feature that's configurable and could be enabled via a CLI option? Relying on specific ENV may be brittle over time, but I can understand the UX is better without requiring users to discover a configurable to opt-in.