Hi there! Favor to help us out with evaluating a p...
# general
h
Hi there! Favor to help us out with evaluating a proposal to make the
name=
field less confusing & target addresses simpler..would you be willing to run this script and report back on what it says? (warning it may take ~3-15 minutes probably, and you can't run other Pants commands while doing it)
2
Instructions: 1.
curl -L <https://gist.githubusercontent.com/Eric-Arellano/237c94dd602a3b36a72104e294167008/raw/2a248bf698659a35abbd4e571d8e6e9b244d08c1/find_num_owners.py> | python3 -
2. tell us the final report
the final report includes total # of files, feel free to scrub that if it's confidential! the percentage is the most important part
p
if running in python 3.8 and lower...
from __future__ import annotations
should be added at the top of the file. Otherwise a TypeError occurs.
b
Any way you could upload the code as a gist and provide a one-liner to run? That'd make it easier. Like
curl $url | python
curl <https://pantsbuild.slack.com/files/UB2J9BQA0/F03FHQE5B5K/find_num_owners_py.py>
outputs nothing, I suspect due to auth
p
ah yes. maybe put this in a public gist...
h
updated
w
Do you want the gdoc updated?
subprocess.CalledProcessError: Command '['./pants', 'peek', '::']' returned non-zero exit status 1.
Is there a pants version requirement?
👀 1
h
sure, that saves me a step 🙂
b
(FYI if you drop the
-O
you can pipe through to python
1
Copy code
curl -L <https://gist.githubusercontent.com/Eric-Arellano/237c94dd602a3b36a72104e294167008/raw/37c1c01ed46f5e804d541164ecaa61b0d8bba2ff/find_num_owners.py> | python3 -
w
in our case the script crashes using Pants 2.11 when it get’s to the point where it runs
./pants list go.mod
with a `ResolveError: No owning targets could be found for the file `go.mod`` even though there is a
go_mod
target in a
BUILD
file next to where the Go modules file is
h
Is there a pants version requirement?
peek
has been supported for a while. What does
./pants peek ::
say when run directly in your repo?
Thanks @witty-family-13337, Asher found the same. I think it might be a legit bug 😮 Workaround is to remove
check=True
from line 62. I also updated the gist w/ that edit
w
I see, I’ll rerun it using the updated version
b
(can this also be multiprocessed? its taking a while and 63 other cores are hungry for work :P)
h
Yeah for sure! I don't have much direct Python multiprocessing experience tho -- I gotta run to get my x rays, but patch definitely welcomed (maybe a
git diff
)
Cool, Go issue is https://github.com/pantsbuild/pants/issues/14736, which I started fixing this weekend. Thank you for the report
b
Well I ran it:
Copy code
0 owners: 0.0% (0 / 2508)
1 owners: 86.2% (2162 / 2508)
2 owners: 4.9% (124 / 2508)
>2 owners: 8.9% (222 / 2508)
I suspect anything with >1 owner is an artifact of our bazle/pants straddling and will be gone when we're off Bazel completely
💯 1
p
Toolchain private monorepo:
Copy code
0 owners: 0.1% (2 / 2065)
1 owners: 94.2% (1946 / 2065)
2 owners: 5.7% (117 / 2065)
>2 owners: 0.0% (0 / 2065)
🙌 1
w
our monorepo gave these results:
Copy code
0 owners: 0.1% (2 / 2647)
1 owners: 99.0% (2621 / 2647)
2 owners: 0.9% (23 / 2647)
>2 owners: 0.0% (1 / 2647)
❤️ 1
n
Copy code
0 owners: 0.0% (0 / 442)
1 owners: 95.9% (424 / 442)
2 owners: 3.8% (17 / 442)
>2 owners: 0.2% (1 / 442)
Couldn't get the script to run on our second Pants repo (yes, I know. Hoping to merge the two one day!), will see if I can fix it.
❤️ 1
h
Thank you! What was the error Jonas?
also Jonas, I think we have enough data now, so no worries if you don't get to it. Thank you everyone for helping!
1