Hi all! Is this the desired behavior of `pants pee...
# general
s
Hi all! Is this the desired behavior of
pants peek
? Or is it a bug? https://github.com/pantsbuild/pants/issues/20462
1
w
I replied to the ticket, but @curved-television-6568 might have a better idea. I’ve not yet seen this behaviour
s
w
I'm going back to my peek PR this afternoon, so I'll be digging around that code - and will try to reproduce, haven't seen anything so far on some of my larger repos - but I'm specifically creating a synthetically large repo to test peek performance - hopefully that will dig this out
From the peek side, this is the command that creates the output:
Copy code
def render_json(
    tds: Iterable[TargetData], exclude_defaults: bool = False, include_dep_rules: bool = False
) -> str:
    return f"{json.dumps([td.to_dict(exclude_defaults, include_dep_rules) for td in tds], indent=2, cls=_PeekJsonEncoder)}\n"
I haven't really ever looked at the custom encoder before, but between that or the Pants stdout writer - not sure where else the problem could be. Does an array end or get created on a specific target? Or is it length based? Have you identified any patterns that could help debug? For example, if you have a large repo, and you only peek a subset of it
pants peek myfolder::
Inherently, something about the code strikes me as odd, since the function is wrapped in
{ }
- but at the console, I never see that, I only see
[ ]
- but yeah, will need to investigate more
Oh, also, why aren't you just using
pants peek ::
? Why list first?
s
there is a more complicated command instead of list
Copy code
git describe --tags --abbrev=0 |
		xargs -I{} pants \
			dependents \
			--dependents-closed \
			--transitive \
			--changed-since={} |
		xargs pants peek |
I decided to reduce the noise in the issue and show smaller reproducible example
w
Ahhh, okay 🙂
Do you get the same behaviour on a straight
pants peek ::
though?
s
looks like
pants peek ::
works fine
w
Okay, that's re-assuring - I couldn't visibly see the problem, and was surprised. I wonder if piping into multiple peeks, some of those are single targets, and some are multiple or something like that
f
the issue was resolved in GitHub, marking thread as done 🙂
👍 1