https://pantsbuild.org/ logo
b

bitter-ability-32190

10/17/2022, 7:46 PM
And while I'm fishing. I need a home for the
BUILD
file deprecations fixer. I'm proposing we might want a "meta" bucket for backends and this might belong (because eventually it'll encompass
pants.toml
and be a bit of a "deprecations" fixer for all of Pants) Other "meta" plugins that could join • Plugin to find and error on redundant
dependencies
declarations Thoughts?
p

proud-dentist-22844

10/17/2022, 8:08 PM
meta sounds good to me
w

witty-crayon-22786

10/17/2022, 8:38 PM
hm… there is an existing buildfile deprecations fixer, but its name is not coming to me … cc @curved-television-6568…?
c

curved-television-6568

10/17/2022, 8:43 PM
@witty-crayon-22786 Do you think of the BUILD file fixer that fixes targets and fields.. It’s all in a core goal only: https://github.com/pantsbuild/pants/blob/main/src/python/pants/core/goals/update_build_files.py
w

witty-crayon-22786

10/17/2022, 8:44 PM
…ah, of course.
yea, thanks.
👍 1
c

curved-television-6568

10/17/2022, 8:44 PM
then there’s a backend for formatting build files, apparently 😛
w

witty-crayon-22786

10/17/2022, 8:44 PM
i misunderstood @bitter-ability-32190’s question i think: sorry. he’s asking where to move the existing code
c

curved-television-6568

10/17/2022, 8:45 PM
np 🙂
b

bitter-ability-32190

10/17/2022, 9:03 PM
Yes exactly! 😅
We do have
pants.backend.project_info
. I think that might be more natural place for these.
Alternatively we could move the build file formatters over there too, and just in time before 2.14 is released. Thoughts? @hundreds-father-404 @curved-television-6568 @happy-kitchen-89482
c

curved-television-6568

10/18/2022, 2:19 PM
I have no strong opinions in this.. 😉
💪 1
💭 1
1
I so wanted to write onions rather than opinions though 😛
🧅 1
b

bitter-ability-32190

10/18/2022, 2:20 PM
We do have
pants.backend.project_info
. I think that might be more natural place for these.
(Then the next question becomes "on by default?") re: deprecation fixers. Maybe why not? lol. Formatters and other fixers, not so much
👍 1
c

curved-television-6568

10/18/2022, 2:21 PM
well, that could be tricky actually… as they’d likely hit during pants upgrades only right.. and so you want to tread carefully, and certainly having things fixed auto”magically” may trip you up..
b

bitter-ability-32190

10/18/2022, 2:22 PM
In this case it'd be the deprecations fixers only, not other fixers. Those should be safe to fix magically. I'm also happy to keep it off by default.
c

curved-television-6568

10/18/2022, 2:23 PM
… or it could save you from stumbling, … yea
As long as any changes made are really verbose to ensure it is not missed that they were applied, that would be good, I think
b

bitter-ability-32190

10/18/2022, 2:24 PM
I'd argue that's what source-code-control is for 😉
h

hundreds-father-404

10/18/2022, 4:21 PM
I don't think project info makes sense, which is about understanding your own repo via introspection. Instead I'd say something like
pants.backend.pants_metadata.fmt.black
b

bitter-ability-32190

10/18/2022, 4:23 PM
Technically we don't say what
project_info
entails. I think of it as the rules/goals which allow Pants/you to understand your project. To that end, your
BUILD
files and
pants.toml
describe your project as much as their content.
h

happy-kitchen-89482

10/18/2022, 4:38 PM
Yeah,
project_info
is intended to be for introspection goals, so BUILD files are relevant, not sure if formatting them is
h

hundreds-father-404

10/18/2022, 4:40 PM
I don't think formatting and fixing deprecated field renames is the spirit of
project_introspection
. Those two tasks don't give you any new insights on how your project is structured - they only help you more effectively manage Pants boilerplate / metadata
w

witty-crayon-22786

10/18/2022, 4:41 PM
is the goal to be able to enable/disable the fixer without fallout?
b

bitter-ability-32190

10/18/2022, 4:48 PM
FWIW it isn't
project_introspection
though, it's
project_info
😅 So
pants.backend.project_info.fmt
contains plugins to format your project info (
pants.toml
and
BUILD
files)
h

hundreds-father-404

10/18/2022, 4:51 PM
this is all hand-wavey, but I think it depends on what we mean with "project info". In my headstory, Pants metadata is really hints about your code so we can give better introspection. it's not the interesting stuff users care about. Pants is only the instrument But that story kind of falls apart with
list
and
peek
goals, which are 100% only about pants abstractions and not your own code
b

bitter-ability-32190

10/18/2022, 5:29 PM
Wherever we land, I also suggest we move the
build_file
formatters there too, and cherry pick to 2.14, so we don't introduce-and-then-immediately-deprecate within two versions 🙂
I'll make a discussion for this. FWIW IMO it's blocking 2.14 and also https://github.com/pantsbuild/pants/pull/17240
p

proud-dentist-22844

10/20/2022, 4:44 PM
Is the fix goal in 2.14?
h

hundreds-father-404

10/20/2022, 4:44 PM
2.15 2.14 adds the new backends for BUILD file formatting
☝️ 1
b

bitter-ability-32190

10/20/2022, 4:45 PM
Yeha I don't wanna give users whiplash
Alternatively, some "Stomachable Whiplash" (band name, called it) would be for 2.14 to hide them behind
preview
🙂
p

proud-dentist-22844

10/20/2022, 4:46 PM
Got it. When I opened that PR it has
Fix
all over the place, so I was confused.
b

bitter-ability-32190

10/20/2022, 4:47 PM
Its a straw breaking the camels back here
p

proud-dentist-22844

10/20/2022, 4:49 PM
Those poor camels... ;)
🐫 2
💸 1