Open solshark opened 1 year ago
I was about to make the very same suggestion!
This is part of Flame's output when running melos analyze
:
I can't even screenshot the whole thing, due to how big it is. As @solshark mentioned, it can get a bit unhinged. Same for melos format
, melos run test
, etc.
This is an example run of tests on CI, it is quite hard to find the actual broken test.
My proposal would be to add a --quiet
flag to commands like analyze
, format
, run
, exec
.
When this flag is present, "blocks" that had no errors or warnings whatsoever are completely omitted.
Luckily, melos already employs the concept of "blocks" in order to support concurrent execution.
In fact the code is already structured with three layers of abstraction:
MelosLogger
wrapperMelosLogger
handles grouping and delegates printing to Logger
Logger
is the actual implementation that comes from cli_utils
In this case, we can easily hook up into the MelosLogger
layer, as it already understands the necessary concepts of batching and grouping. We only would need to hold the concept of a "status" or "log level" for each group, and consider the --quiet
flag in order to update the function flushGroupBufferIfNeed
.
I believe the necessary changes would be quite simple all things considered (at least as a first step for analyze
& format
- run
/tests could prove more difficult); and if this here Rationale & Proposal make sense, I would love to contribute with a PR to implement this. It would make parsing results both locally and on CI for our flame monorepo much easier!
@luanpotter sounds good, I'm thinking that it would be good if the quiet option could be global and not specific to commands in the end, and that it can also be specified directly in melos.yaml
.
For the tests, that's why we used spec
for that previously (which integrates with Melos), but we never figured out why that sometimes stopped working in the CI (most likely running out of memory).
I like that idea @spydon! I think it makes sense for it to be both an ad-hoc option and also allowed to be specified globally.
Is there an existing feature request for this?
Command
No response
Description
I'm running big project with 15+ packages (libs + apps) on CI server with gitlab-runner. Melos output is huge even for success path, so it would be awesome to silent all output except errors.
Reasoning
It will be useful 'coz it will simplify CI logs analysis. Could you imagine CI pipeline running 'get' per package just pruning package name. My output is XX thousands lines, 4-5 of them is simply notes like that:
Please consider flag to suppress all output.
Additional context and comments
No response