Repository navigation
Closed
Labels
Description
Context
Now that we have an awesome TUI merged, and soon released (yay!) I think we can finally make progress on an old topic: container output streams (stdout and stderr); pipeline output; and the difference between them.
Problem
The current situation: there is no difference. If your container prints something (anything!), the user will see it in the TUI. If the TUI prints anything about the status of a step, a possible error... It came from the stdout of a container.
In my opinion, that is not ideal, we should change it.
- Most of the stdout and stderr of a container is noise, unless there's an error, in which case you want to go back and investigate some of it.
- The value of the TUI is diminished by having to show so much noisy logging by default.
- The important questions ("what's the status of this step? Why did it fail?") are difficult to answer, because the answer is drowned in an ocean of logs, with no way to extract it semantically.
Solution
With this awesome new TUI and the scaffolding behind it, I think now is a good time to start changing this, incrementally.
- Step 1 (the title of this issue): hide stdout/stderr by default. You can still see everything with a flag; and in case of error, maybe it all gets dumped to you (or maybe it doens't, and you just re-run it with the verbose flag)
- Step 2: we add an API for steps to explicitly send status, error etc. Data from that API is displayed prominently, by default.
- Step 3: over time access to raw logs becomes less and less important - everything you need is surfaced in the step status and error API; You only look at the raw logs very occasionally, when a) you're debugging and b) step status/error wasn't enough to find the answer (should be rare).
In my opinion, the sooner we agree on step 1 and implement it, the smoother the transition will be for users.
Activity
shykes commentedon May 19, 2023
FYI @vito
vito commentedon May 19, 2023
Here's the current state of things (as of #5151):
One thing I want users to not have to worry about is "oh crap, I saw that briefly print something interesting, but now it's hidden away, and I didn't run with
--verbose, and I don't know if that will ever happen again." Teaching users to always pass--verboseas a result of this experience would be something to avoid. (edit: but there are other ways to mitigate that, for example storing a local cache of output and letting them go back and replay.)gerhard commentedon May 30, 2023
I can see that you have already thought about this @vito. Do we want to do something about this in a follow-up TUI -
v0.6.0patch release?vito commentedon May 30, 2023
Just wanted to make sure we're all on the same page as to how things currently work before figuring out next steps. I did give a lot of thought to some of the concerns brought up in the original description, so there's a bit of nuance to the implementation. :)
I don't meant to be a conversation-halter if we still want the experience to be changed for more fundamental reasons. For example the OP's steps 2 and 3 suggest
stdoutandstderrmay someday be too low-level, instead replaced by higher-level outputs explicitly set via the API. That may still be valid in its own right, but I would suggest dogfooding a bit more and confirming the listed problems are real if they are the sole motivation.vito commentedon Jun 23, 2023
Circling back to this after a bit of dogfooding
dagger do, I agree that it would be nice to hide all the noise.My current idea is to add a
focus: trueflag toWithExecthat will bubble up to the TUI. We can havedagger dorespect it by default, which makes sense to me as its goal is to be a higher-leveldagger run.So in
dagger dowithfocus: trueused sparingly you would see something like this instead:In the above example, two
WithExecs are givenfocus: true. Normally you would probably have only one.I'm not a 100% fan of the API, though, it's kind of clunky to type:
Maybe it's worth having sugar for it? Or maybe there's some other way to approach this. 🤔
shykes commentedon Jun 23, 2023
What if we did it at the pipeline level?
Pipelineto configure the focus behavior. Possible values could beFocusFirstExecto focus the first exec operation,FocusLastExec,FocusNone,FocusAllExec.FocusLastExecwhich would match the most common patterns IMO, but I could be wrongPipelineto control what is presented to the uservito commentedon Jun 26, 2023
@shykes I like that line of thinking; it'd be great if you didn't have to remember to set a flag.
Worth noting that our own tests run two commands that I think we would want to see the output of:
gotestsum ./..., to run our tests with pretty output and generate a reportgotestsum tool slowestto report the slowest testsI suppose we would have to use
FocusAllExecand put them in their own pipeline to set that flag. We've talked about havingdagger doautomatically place commands in a pipeline reflecting the command hierarchy, so having to set up another pipeline nested beneath might feel a little redundant; I'm not sure what I would name it.Could still make sense as a sane default but I'll keep thinking.
Here's an idea:
I like that this could be a pattern implemented by all APIs, as opposed to just container execs. It's also easy to sprinkle into a call chain to debug something.