https://pantsbuild.org/ logo
h

hundreds-father-404

05/16/2022, 1:55 PM
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

polite-garden-50641

05/16/2022, 2:01 PM
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

bitter-ability-32190

05/16/2022, 2:10 PM
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

polite-garden-50641

05/16/2022, 2:17 PM
ah yes. maybe put this in a public gist...
h

hundreds-father-404

05/16/2022, 2:19 PM
updated
w

wide-midnight-78598

05/16/2022, 2:23 PM
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

hundreds-father-404

05/16/2022, 2:26 PM
sure, that saves me a step 🙂
b

bitter-ability-32190

05/16/2022, 2:26 PM
(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

witty-family-13337

05/16/2022, 2:27 PM
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

hundreds-father-404

05/16/2022, 2:28 PM
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

witty-family-13337

05/16/2022, 2:29 PM
I see, I’ll rerun it using the updated version
b

bitter-ability-32190

05/16/2022, 2:31 PM
(can this also be multiprocessed? its taking a while and 63 other cores are hungry for work :P)
h

hundreds-father-404

05/16/2022, 2:32 PM
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

bitter-ability-32190

05/16/2022, 2:54 PM
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

polite-garden-50641

05/16/2022, 3:26 PM
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

witty-family-13337

05/17/2022, 6:45 AM
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

narrow-vegetable-37489

05/17/2022, 7:48 AM
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

hundreds-father-404

05/17/2022, 12:29 PM
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