How do you get Pants to not output when a `Process...
# development
h
How do you get Pants to not output when a
Process
has been completed or not? The new messages for “Searching for ‘python3’ on PATH` are really chatty
w
we don’t have a way to set the “level” of a process… might be a quick fix.
they should be cached though: you shouldn’t see them again until you change the PATH
but, related: i realized yesterday that they’re buggy for that reason. will need to do more of #9760 and make the path lookup operation native as described there.
will open a new issue for that.
h
https://github.com/pantsbuild/pants/pull/10525 for the first step of improving this.
they should be cached though
Yes, but I also think this is a dangerous mindset that we need to remind ourselves to watch out for. The first time experience of a user matters. For a first time user, are these particular messages pulling their weight? I think no.
we don’t have a way to set the “level” of a process… might be a quick fix.
Would this be adding a property to
Process
called
log level
? Then piping it through to the engine?
w
will open a new issue for that.
https://github.com/pantsbuild/pants/issues/10526
@hundreds-father-404: just “level”, yea.
(because it’s also the workunit’s level)
👍 1
h
Do we think the better default for processes is debug or info? That is, should we default a process to logging “Completed: foo”? cc @happy-kitchen-89482
h
Hmmm
h
So far, I’m changing these to debug: - run
protoc
- extract an archive (
archive.py
) - run
cloc
- search for binaries, like
python
h
Probably yes?
h
I’m atm keeping these as info: - building a Pex - running a Pex process, like
pytest
I think defaulting to info makes sense? Personally, though, I don’t like how chatty Pants is, so my fear with a default of info is that when we add new code, it will risk being chattier than it should be
w
Info is a better default.
👍 1
until https://github.com/pantsbuild/pants/issues/7907 is implemented, a @rule cannot have a non-static
description
which means that right now only processes have “useful” descriptions.
h
Agreed, but even if the level is set to Debug, it will still show up in the dynamic UI, right?
The ideal imo would be to show up in the dynamic UI, but not be persisted as a log message.
w
Agreed, but even if the level is set to Debug, it will still show up in the dynamic UI, right?
yea, true.
my feeling is that running a process is almost always a significant thing. some of the ones you’ve mentioned above should stay Info, IMO
the PATH discovery stuff is pretty clearly not.
h
cloc
is redundant because we immediately after output the result of
cloc
w
that goal does, not all will. but yea, maybe a special case.
h
Overall, I think I agree with you that Info is a better default. I’ll stick with it. Thanks!
w
oh, so: another consideration.
nevermind!
(was gonna say “we’re considering conditionally dumping output on processes and that might be level driven” but that’s not true… that ended up in the EngineAware interface)
… i had almost forgotten about that.
that exists now, so if you want streaming test output for failures…
…can do it in a few lines 😃
1
… i had almost forgotten about that.
not even almost: “fully forgotten”.
tweak
TestResult
to dump the stderr in
def message
if it’s a failure
(thanks @hundreds-breakfast-49010, wherever you are)
👍 1
h
Neat. It sounds like that’s a separate change, though, right?
w
definitely
if i had remembered i would have suggested doing it in https://github.com/pantsbuild/pants/issues/10484
👍 1
…need to not forget again. filing a ticket.