bitter-ability-32190
07/15/2022, 12:40 AMambitious-actor-36781
07/15/2022, 1:01 AMfmt
to use fix.polite-garden-50641
07/15/2022, 1:06 AMbitter-ability-32190
07/15/2022, 1:07 AMfmt
for at least a version (if not more, this is a large change).
I also want to highlight that this policy exists so Pants can evolve over time. As we decide we want to do more interesting and creative things, or find the err in our past ways we have two options:
β’ Bend: in this case that means making these breaking changes slowly and methodically with some heartburn along the way
β’ Break: Slap a new version (Pants v3) or a new name because we broke too much
I'm glad we're dedicated to bending so that, over time, we can continue to grow internally and with the community.bitter-ability-32190
07/15/2022, 1:15 AMbitter-ability-32190
07/15/2022, 1:15 AM--loop
or fmt-on-save
because fixers make semantic changes that undoes dev work. This was seen as the best way to fix that without proliferating goals.careful-address-89803
07/15/2022, 4:19 AMfix --style-only
then we can keep fmt
around as an alias for low (no?) cost. I think if we keep it around for long enough (maybe even until 3.0), this won't be a problem.bitter-ability-32190
07/15/2022, 10:51 AMfmt
will be removed.
However you'll love the fact that you can define your own CLI aliases: https://www.pantsbuild.org/docs/reference-cli
So fmt
could always live on in your repo or on your machine as an alias βΊοΈ
(FYI @ambitious-actor-36781. I forgot to mention this as well)wide-midnight-78598
07/15/2022, 1:09 PMIf we do want to add non-safe "fixers", we should consider using a dedicated goal like tailor or something new.@bitter-ability-32190 Could you maybe enumerate what changes that ticket would cover, so we have an idea of the scope of API change? Anything that reduces the number of goals and improves goal semantics gets a big π from me. Conversely, anything that changes the external API but leads to basically "the same thing" gets a huge π ... Hence averaging out to strongly neutral...
proud-dentist-22844
07/15/2022, 1:34 PMfmt
plugin for it to ensure it happens regularly. But I cringe because this is very much not formatting. fix
would not cause the cringe. So a big π from me.bitter-ability-32190
07/15/2022, 1:45 PMfix
, but we need to have fix
for that to be allowable. Additionally I would expect the formatting aspect v the fixing aspect to be split.
tailor
I believe was determined to be special enough to remain. I don't think we discussed non-safe fixers, however I wouldn't want us to make design decisions based on "maybe" future state (after all, as said above we have ways of changing over time)
So this is the first step to a few of those possible additional tasks, which is why I'm picking it up.bitter-ability-32190
07/15/2022, 1:46 PMflat-zoo-31952
07/15/2022, 2:11 PMhundreds-father-404
07/15/2022, 2:18 PM[cli].alias
so that fmt
== fix
in your repo, meaning people don't have to change if you don't want them to?flat-zoo-31952
07/15/2022, 2:21 PMflat-zoo-31952
07/15/2022, 2:22 PMbitter-ability-32190
07/15/2022, 2:33 PMfmt
are valid for fix
. So unless you're using the subsystem name (e.g. --fmt-only=...
) You shouldn't see the differencebitter-ability-32190
07/15/2022, 2:34 PMbitter-ability-32190
07/15/2022, 2:36 PMbitter-ability-32190
07/15/2022, 2:42 PMhundreds-father-404
07/15/2022, 2:44 PMfmt
and fix
can show up in ./pants help goals
, and we can explain
is a (deprecated) subset of thefmt
goal, which does not include semantic "fixers" like PyUpgrade and Scalafixfix
hundreds-father-404
07/15/2022, 2:45 PMfmt
goal and only run them with fix
flat-zoo-31952
07/15/2022, 2:57 PMRe churn: if we determined that the proposal is the direction we want to go, it'll hurt less at 100 adopters than 1000.
That's fine, but that is very much a beta software approach. And at some level I can't argue with it because I get the need to move forward, and I get that design is an iterative process. And it works within your depreciation policy. But I can say as a user it's frustrating. I don't think about Pants every day. I can't afford to. I don't think I'm alone in that. So when I come back and I see that goals are moving again, it takes mental energy to figure out what's going on, even if there are workarounds available. This change sounds okay I guess, and it does show that you think about your users in this. But decisions like this clearly get made by people who get to think about Pants all the time. So it still feels like you're missing a "person who uses Pants but has other duties" UX persona from your design process. So I don't have a great logical argument here. I just have the observation that churn is deeply frustrating as a user, especially for things that for all intents and purposes felt fine.
flat-zoo-31952
07/15/2022, 3:09 PMbitter-ability-32190
07/15/2022, 3:10 PMGoals are moving again
Can you elaborate? I'm getting the impression there's a past experience that bit you as well, and I'd love to know what it was. And can you help me understand what would make this change easier to digest if you were reading the release announcement or however you consume an upgrade?
bitter-ability-32190
07/15/2022, 3:11 PMfmt
was always going to be deprecated, we don't believe in rugpulling. However we can move the slider on overall UX with that deprecationwide-midnight-78598
07/15/2022, 3:14 PMI'm feeling a lot of intensity behind the renameThe consequence of touching a public API, unfortunately - broad-reaching implications, with potentially minimal benefits for most/all of the user base
concrete ideas on how to manage the painI think as mentioned in either the GH issue, or GDoc, or maybe even this thread - if there is/are built-in aliases, or automation ways to solve this - those are decent pain mitigation strategies. When there are BUILD file target name changes (which is also a public API change), we have a dedicated command that fixes them and it's approximately zero mental exertion other than reading a deprecation note after updating pants. No big deal. If
fmt
stops existing (or any goal, actually), then there is some amount of mental exertion, and there might be build scripts, CI tools, etc that all need to be updated in any repo using Pants. I have a bunch of Pants repos, and that's not a big deal for me - but for some people, that's much harder due to larger scripting facilities, or just wayyyyyy more people involved in the process.
My assumption/hope would be that on any public API change, there is a "lengthy" deprecation time, automated script updates, and documentation notes the deprecated version but auto-redirects to the newer version.hundreds-father-404
07/15/2022, 3:19 PMfmt
in like a "hidden" state for a long long time, even after a long normal deprecation. Like, it doesn't show up in ./pants help goals
, but if you type it, we treat it as fix --style-only
, and print a short deprecation saying to use fix
instead.
Seems very technically feasible
a short deprecationTo reduce CLI noise. And Pants users can use the
ignore_warnings
option if they really don't want that warningwide-midnight-78598
07/15/2022, 3:19 PMhundreds-father-404
07/15/2022, 3:22 PMwith potentially minimal benefits for most/all of the user baseFor clarity: the intended benefit of this change is so that we can move forward adding semantic fixers to what is now the
fmt
goal, including merging update-build-files
. Technically, we could have ./pants fmt
do things like BUILD file deprecation fixers...but that semantically is wrongwide-midnight-78598
07/15/2022, 3:22 PM"hidden" state for a long long time, even after a long normal deprecationI'm struggling to remember the tool or language I saw this in, but one pattern I've seen is that public API changes are never officially breaking until a major version change. I know that just sounds like semantic versioning, but it was pretty awesome. The deprecated API was basically invisible unless you had already used it in the past. So, new users wouldn't really even know it existed, while existing users were completely unaffected until a 3.0 release.
flat-zoo-31952
07/15/2022, 3:22 PMCan you elaborate? I'm getting the impression there's a past experience that bit you as well, and I'd love to know what it was.I think I just value API stability a lot. It's come up before, although I can't recall the specifics now, and the Slack history is probably gone. IIRC I think it was some changes that were made in prep for target generators, which ended up being a really good idea, but it was frustrating to deal with then. There's a lot of smart people working on this project, and often things are being done to make way for some really cool ideas in the future, but the benefit to users in the meantime is often very unclear in the short term. This is normal with any kind of upgrade process.
hundreds-father-404
07/15/2022, 3:23 PMIt's come up before
python_library -> python_sources
, iirc. It was SUPER disruptive, even though it was automated
It was SUPER disruptiveNot only BUILD file churn, but you had to update things like
./pants filter --target-type
to differentiate between python_source
vs python_sources
, in some caseswide-midnight-78598
07/15/2022, 3:24 PMTechnically, we could have@hundreds-father-404 Exactly. The semantics would matter to someone like me... but, to 90% of the userbase? Who knows if they're as pedantic as me πdo things like BUILD file deprecation fixers...but that semantically is wrong./pants fmt
hundreds-father-404
07/15/2022, 3:25 PMfmt
running "semantics-changing fixers" because a major design goal for Pants is to be _intuitive_: you can figure it out without flat-zoo-31952
07/15/2022, 3:26 PMhundreds-father-404
07/15/2022, 3:27 PMfmt
around ~indefinitely, as long as new users only encounter fix
. it's not much code for us to support thatflat-zoo-31952
07/15/2022, 3:27 PMflat-zoo-31952
07/15/2022, 3:30 PMAny web developer knows how severe API churn can get, while I have C libraries from 15 years ago I can still plug and play.A lot of the reaction to this is going to come down to where you expect Pants to be on this spectrum. I don't expect 15 years stability, but maybe 1 year is a better target than 2-3 months (which is where the current deprecation policy tends to land with 2 minor versions)
flat-zoo-31952
07/15/2022, 3:32 PMbitter-ability-32190
07/15/2022, 3:39 PMbitter-ability-32190
07/15/2022, 3:52 PMbusy-vase-39202
07/15/2022, 5:22 PMhundreds-father-404
07/15/2022, 5:39 PMBut we've gotta be pushing towards a point at which some of this becomes more stable. Right?My two cents is that certain parts of the system should be stable stable, whereas others we will want to have time to discover the best representation. Specifically: experimental backends. Whereas ideally we stop changing fundamental things like CLI specs, the core goals, targets in general
bitter-ability-32190
07/15/2022, 10:27 PMfix
goal separate from fmt
? We'd still dissolve update-build-files
into both goals. But we've introduced another goal.
I would say some of the pain of a new goal like this might be alleviated with fixing https://github.com/pantsbuild/pants/issues/10542.
Then we can revisit the merging separate from the abovebitter-ability-32190
07/15/2022, 10:39 PMwide-midnight-78598
07/16/2022, 12:25 AM./pants lint --fix
in lieu of a dedicated fix
command, but that might just speak to what my day-to-day languages/tools are (not Rust with cargo fix
and not Go with go fix
).
I'm not sure I understand what the technical scope of fix
would be (as in, what identifies that which is `fix`able? Moreover, would we have the idea of a fix --check-only
for CI? that just seems strange)
If fmt
was relegated to whitespace, unused imports/vars, braces, indents, and strictly visual presentation - I'm a huge +1 on that (no semantic or code-flow changes, and nothing that would change compiled byte-code). I think fmt
is currently like 95% this, other than like 1 or 2 plugins.
Would update-build-files
have its duties split into two? fmt
handles the visual presentation, while fix
would handle any semantic tweaks (ie. target name changed)?
I think this is the most practical, community-centric approach. Nothing severe breaks, additive API, and then deprecating and removing an API which becomes redundant.bitter-ability-32190
07/16/2022, 12:27 AMflat-zoo-31952
07/16/2022, 12:32 AMwide-midnight-78598
07/16/2022, 12:36 AMflat-zoo-31952
07/16/2022, 3:25 PMfix
is too general a term for these actions, at least as a goal. And it would be confusing to have it present along with lint --fix
if that was adopted as wellflat-zoo-31952
07/16/2022, 3:26 PMupdate
has the right ring to it for the sense of go fix
but it's an overloaded term as well, not sure there are terms that aren't overloaded in this senseproud-dentist-22844
07/16/2022, 3:27 PM./pants update
to update itselfflat-zoo-31952
07/16/2022, 3:27 PMtailor
, even if it comes from a silly pun, is that it has no overloaded expectations of behaviorflat-zoo-31952
07/16/2022, 3:27 PM./pants update
be usedflat-zoo-31952
07/16/2022, 3:28 PMmodernize
? semantic-fix
? something about naming things being hard...bitter-ability-32190
07/16/2022, 3:30 PMbitter-ability-32190
07/16/2022, 3:31 PMflat-zoo-31952
07/16/2022, 3:31 PMflat-zoo-31952
07/16/2022, 3:32 PMflat-zoo-31952
07/16/2022, 3:37 PMgo fmt
for fixing lint issuesflat-zoo-31952
07/16/2022, 3:38 PMbitter-ability-32190
07/16/2022, 3:58 PMflat-zoo-31952
07/16/2022, 4:03 PMflat-zoo-31952
07/16/2022, 4:06 PMThat might be the right razor to use: do I need to run it as part of CI?Different teams are going to have different standards for this. Some teams will auto-commit certain fixes in CI. Do we need to make a separate
fix
command for that?
Idk, in my mind, a notion as broad as "fix" can't be given the precise contextual definition it needs in a tool as general as Pants. I think getting this right is far more important than brevitybitter-ability-32190
07/16/2022, 6:07 PMwitty-crayon-22786
07/18/2022, 5:25 PMbitter-ability-32190
07/18/2022, 7:50 PMwitty-crayon-22786
07/18/2022, 9:19 PMbitter-ability-32190
07/18/2022, 9:24 PMbitter-ability-32190
07/18/2022, 9:24 PMwitty-crayon-22786
07/18/2022, 9:27 PMbitter-ability-32190
07/18/2022, 9:31 PM