hundreds-father-404
10/15/2021, 9:52 PM./pants mend vs ./pants serge. Feedback welcomed! π§΅hundreds-father-404
10/15/2021, 9:53 PMfix or upgrade. But I think they're too generic. This goal only is relevant to upgrading Pants versions, not some generic "fix" functionalitybusy-vase-39202
10/15/2021, 9:54 PMbusy-vase-39202
10/15/2021, 9:56 PMhundreds-father-404
10/15/2021, 9:57 PMmend. Prefer a term that people can automatically understand, even if it's slightly inaccuratehappy-kitchen-89482
10/15/2021, 10:02 PMmendbrash-baker-91190
10/15/2021, 10:02 PMself-update?busy-vase-39202
10/15/2021, 10:04 PMmend will be read forever by some people as "Pants damages stuff then makes you run a command to fix what it damages" or choose a neutral term that more accurately reflects what's happening.hundreds-father-404
10/15/2021, 10:05 PM"Pants damages stuff then makes you run a command to fix what it"I mean, tbh, we sort of do with deprecations - deprecations are annoying for current users! We try to be careful only doing them when it will make the future a lot brighter for everyone, but yes, it's annoying / damages things
brash-baker-91190
10/15/2021, 10:05 PMbrash-baker-91190
10/15/2021, 10:06 PMpants tailor π
)busy-vase-39202
10/15/2021, 10:07 PMbusy-vase-39202
10/15/2021, 10:09 PMself-update is such a common choice for package managers. If it's setting the correct expectation, +1 for that.busy-vase-39202
10/15/2021, 10:10 PMmendbrash-baker-91190
10/15/2021, 10:11 PMmigrate, depending on precisely what the command doeshundreds-father-404
10/15/2021, 10:11 PMmigrate might be more accurate. Thus far, all it does is update some BUILD files. It does not change pants.toml, such as changing your pants_version - it's not 100% self-contained, you still have to do some manual thingsbusy-vase-39202
10/15/2021, 10:12 PMmigrate is gonna move files around. But that's not a bad thing to check.brash-baker-91190
10/15/2021, 10:12 PMpants.toml as well, then self-update might be better. That reads as a bit more self-contained and hands-off to me.busy-vase-39202
10/15/2021, 10:13 PMupdate vs self-update?brash-baker-91190
10/15/2021, 10:13 PMhundreds-father-404
10/15/2021, 10:14 PM[GLOBAL].ignore_warnings for youbrash-baker-91190
10/15/2021, 10:15 PMupdate and upgrade whenever I deal with package managers, and I always end up picking the wrong one.)brash-baker-91190
10/15/2021, 10:15 PMhundreds-father-404
10/15/2021, 10:16 PMself-upgrade (or self-update) morehundreds-father-404
10/15/2021, 10:24 PMmigrate vs. self-migrate vs. self-update?busy-vase-39202
10/15/2021, 10:25 PMself-update, yuphundreds-father-404
10/15/2021, 10:26 PMself-update a lot! I still think ./pants mend is really cute and it sparks joy for me hehe, but you both raise good pointshundreds-father-404
10/15/2021, 10:26 PMbusy-vase-39202
10/15/2021, 10:27 PMbrash-baker-91190
10/15/2021, 10:30 PMbusy-vase-39202
10/15/2021, 10:31 PMbrash-baker-91190
10/15/2021, 10:32 PMbrash-baker-91190
10/15/2021, 10:32 PMhundreds-father-404
10/15/2021, 11:30 PMlist[str] (the original lines) and returns list[str]. Pants pipes your "fixer" on to any others, like how ./pants fmt works
cc @proud-dentist-22844hundreds-father-404
10/15/2021, 11:36 PMproud-dentist-22844
10/15/2021, 11:36 PMmigrate β
self-update I would expect that to update the ./pants script and maybe bump the version. self-update should not be touching my config.proud-dentist-22844
10/15/2021, 11:38 PM./pants build-updates thoughhundreds-father-404
10/15/2021, 11:39 PMupdate-build-files? And then if/when we decide to do that fully self-contained experience, we can deprecate update-build-files in favor of self-updatehundreds-father-404
10/15/2021, 11:40 PMtailor really should have been generate-build-files....(not too late to change that)proud-dentist-22844
10/15/2021, 11:41 PMpoetry self update which upgrades poetry. https://python-poetry.org/docs/#updating-poetryproud-dentist-22844
10/15/2021, 11:43 PMhundreds-father-404
10/15/2021, 11:44 PM./pants tailor means that you generate BUILD files where you didn't have them before, which means that you cause Pants to run on files it wasn't running on before
Whereas this new goal is only meant to automate fixing BUILD files you already haveproud-dentist-22844
10/15/2021, 11:45 PM./pants uptailor
./pants tailor --updateproud-dentist-22844
10/15/2021, 11:48 PM./pants generate-build-files
and
./pants update-build-files
Would be fine too. @busy-vase-39202 would renaming tailor be a good thing?hundreds-father-404
10/15/2021, 11:48 PM./pants tailor --updatePossibly, although it does give me pause that some of the options would only be useful depending on which mode you're running in. For example,
--build-file-name is only relevant to generating new BUILD files, so it's unused with --update.
It's a smell to have to document "This option only is used if --update is also set"hundreds-father-404
10/15/2021, 11:49 PMgenerate-build-files more than tailor. It tells you exactly what it does, even though tailor is clever / funproud-dentist-22844
10/15/2021, 11:50 PMhundreds-father-404
10/15/2021, 11:52 PMupgrade-build-files rather than update-build-files, with the logic that the goal is really only for upgrading and a one-time operation by codebase admins, not something you run every day
But, it makes a ton of sense to run ./pants upgrade-build-files in your CI! It avoids your org's developers unintentionally using deprecated functionality that you fixed but they re-add backworried-salesclerk-37834
10/15/2021, 11:52 PMhundreds-father-404
10/15/2021, 11:54 PMpython_library to python_sources, which we knew we needed to automate fixing. I at first wrote a script that you manually download and run, then @happy-kitchen-89482 pointed out we have this amazing build tool designed precisely for situations like this
Indeed, a lot of the "fixers" in this goal will only live in 1 or 2 Pants releases. After the deprecation is done, we'll delete that fixer from our codeworried-salesclerk-37834
10/16/2021, 12:03 AMworried-salesclerk-37834
10/16/2021, 12:16 AMhappy-kitchen-89482
10/16/2021, 12:20 AMupdate-buildfiles or similar is clearer than self-update, which sounds like we might be upgrading the Pants versionhundreds-father-404
10/16/2021, 12:22 AMupgrade-build-files. Somewhat arbitrary on update vs upgrade, but we're using upgrade now to talk about changing your Pants version. And https://fossbytes.com/whats-the-difference-between-update-and-upgrade/ claims that's the right wordhundreds-father-404
10/16/2021, 12:22 AMtailor to generate-build-files for clarity and consistency?happy-kitchen-89482
10/16/2021, 12:22 AMhappy-kitchen-89482
10/16/2021, 12:23 AMhappy-kitchen-89482
10/16/2021, 12:23 AMupgrade is the right term herehappy-kitchen-89482
10/16/2021, 12:24 AMhundreds-father-404
10/16/2021, 12:24 AMupdate-build-files then, don't have a strong opinion therehappy-kitchen-89482
10/16/2021, 12:25 AMhundreds-father-404
10/16/2021, 12:26 AMcurved-television-6568
10/16/2021, 6:17 AMfix-deprecations?hundreds-father-404
10/16/2021, 6:20 AMcurved-television-6568
10/16/2021, 6:23 AMupgrade-build-files.proud-dentist-22844
10/16/2021, 9:15 AMhappy-kitchen-89482
10/16/2021, 3:12 PMfix-deprecations because it will also allow in the future to fix things other than BUILD files, such as pants.tomlhundreds-father-404
10/16/2021, 3:13 PMfmt and lint, but that really really messes with the Target API and has super awkward edges. I tried adding it last month and it was going to take a lot of big redesigns to do. Instead, I can probably wire up Black to update-build-files in an hour this weekend :)hundreds-father-404
10/16/2021, 3:19 PMhappy-kitchen-89482
10/16/2021, 3:23 PMhappy-kitchen-89482
10/16/2021, 3:23 PMhappy-kitchen-89482
10/16/2021, 3:23 PMhappy-kitchen-89482
10/16/2021, 3:24 PMhappy-kitchen-89482
10/16/2021, 3:27 PMhundreds-father-404
10/16/2021, 3:31 PMBUILD files are annoying and I don't want to deal with them, which I usually don't thanks to dep inference. When I do have to, I want to make sure they're in tip-top shape. That they're using the newest idioms and pretty formatted. Another thing to consider with black is that you always have BUILD files but might not have Python in your repo or might not want to use Pants for it. That is, you might want to format BUILD files without activating pants.backend.Python, which would have consequences like ./pants tailor now insisting on creating Python targets for code you don't want
curved-television-6568
10/16/2021, 4:56 PMhundreds-father-404
10/16/2021, 4:58 PMupdate-build-files to not be interactive, especially so that you can safely run it in CI
fix-deprecations (or self-update) would need to be interactive, so I think having both goals could make sense in the futurehundreds-father-404
10/20/2021, 2:55 PMtailor to `generate-build-files`: https://github.com/pantsbuild/pants/pull/13302
Feedback/reviews welcomed!curved-television-6568
10/20/2021, 3:16 PMtailor nameβ¦) πhundreds-father-404
10/20/2021, 3:17 PMtailor. This is only meant to prompt that discussioncurved-television-6568
10/20/2021, 3:19 PMupdate-build-files and generate-build-files.. almost so, that it feels that they could be merged into one and the same?curved-television-6568
10/20/2021, 3:20 PMtailor modifies BUILD files in place, the generate name doesnβt really convey that, feels like it risks replacing if there is pre-existing files..curved-television-6568
10/20/2021, 3:20 PMupdate is very clear on that matter.hundreds-father-404
10/20/2021, 3:22 PMfeels like it risks replacing if there is pre-existing files..The goal only adds new targets, does not modify any existing ones
curved-television-6568
10/20/2021, 3:59 PMgenerate-build-files feels like it works on them as an atomic unitβ¦curved-television-6568
10/20/2021, 3:59 PMThe goal only adds new targets, does not modify any existing onesAm aware, just trying to point out what I feel the name may imply, if I didnβt know this.. π
hundreds-father-404
10/20/2021, 4:12 PMhappy-kitchen-89482
10/20/2021, 4:12 PMhappy-kitchen-89482
10/20/2021, 4:13 PMfast-nail-55400
10/20/2021, 4:18 PM./pants build-Xtremehundreds-father-404
10/20/2021, 7:19 PMtailor! We realized we should merge tailor and update-build-files into one goal, and that that goal also should have the option to automate safe deprecations in pants.toml (only safe ones)