artsy / README

:wave: - The documentation for being an Artsy Engineer
Creative Commons Attribution 4.0 International
1.1k stars 120 forks source link

RFC: PR titles (conv-commits modification) #506

Closed pvinis closed 1 year ago

pvinis commented 1 year ago

Proposal

After my comment here I promised I will ues the regular conv commits until I make an RFC. Here is that RFC.

And here is my modified list of conventional commits for our PR titles:

Reasoning

It all started with me hating attaching the word chore on any of my work. I refused to use it, and I have only used it begrudgingly for some PRs after my promise, and on very very few PRs that I would actually characterize as chores.

I then decided to do an investigation a few months ago. I took 300 commits from eigen, and checked their type. In these 300 commits we had:

So my thoughts after this were:

This new list was suggested here. The main differences are:

Additional Context

Lengthy discussions on slack:

How is this RFC resolved?

Change the peril check. Change the graphs generated by the velocity team to include the new labels.

kathytafel commented 1 year ago

I sort of love this because I hate chores, too. I assume it wouldn't break the charts or you wouldn't have proposed it.

admbtlr commented 1 year ago

I guess you already knew that I would vote against this 😄. I like the standard conventional commit options for two reasons:

  1. They are simple and I don't have to think about them
  2. They are user-centric: they characterise the work in terms that matter to the user, not to the engineer.

Once your code is committed, this user-centricity is the right way to think about it IMHO: "what does this bring to the user?" This makes it easier to use the git log in two different ways:

  1. As a tool for managing the product, e.g. (but not limited to) automated changelogs. A changelog will normally have three sections: new features, fixes and upkeep/maintenance (or it will skip the third section).
  2. To understand how much time you're spending on building new stuff ("feat"), how much on rework ("fix") and how much on maintenance and upkeep ("chore").

Conventional commits allow you to use 3-5 characters (or 6 if you include the colon) to indicate which of the three sections this work fits into. And then you have the rest of the title, plus the description, to provide more context for what you actually did.

Is it so hard to gift those 3-5 characters to users and automation? Because honestly, the user doesn't care whether you refactored, reformatted or cleaned up, and neither does a user-centric analysis of the log.

lidimayra commented 1 year ago

My personal thoughts on this: I'm not a fan of conventional commits. I think conventional commits prefixes use a precious space that sometimes forces us to sacrifice words that could make the title much more descriptive. That being said, I understand their importance when we're talking about automation tools, changelogs and metrics collection.

When it comes to actual meaning and readability (very useful when looking at the commits history), what I really care about is always after the colon, not before. So I don't feel like putting too many thoughts into an extensive list of prefixes. If I'm cleaning something up, updating dependencies or refactoring code, I rather use always the same prefix (like chore as a standard) than have to think about a customized list to check if my work fits there (and in case it doesn't, label it as other).

And as much as I don't like the conventional commits, if we have to use them, I rather be sure that the prefixes will always be as short as possible (3 ~ 5 characters). Using prefixes like refactor, for example, would already consume 8 characters from my title with something that, as a human, I really don't care about and it would prevent me to write the actual title in the way I want to write.

damassi commented 1 year ago

Agree with @admbtlr here - and its worth noting that conventional-commits are a standard. As per other things discussed recently, the further we deviate from standards the more troublesome our code, pipelines and other tools become to manage, because that forces us to stray from open source, the wider community, etc. There are lots of tools we can take advantage of to make the absolute best of our git commits (which are important atomic units regardless of personal opinion) and in the future we might want to implement.

damassi commented 1 year ago

To use a practical example as seen in various repos, when we make library releases, auto scans our conventional commits, via the conventional-commit changelog plugin, to auto-generate changelogs for us that are pinned to specific releases. Examples:

This is a perfect example of standardized tooling in practice, which starts to break down when we begin adding idiosyncratic categories on a whim. And this release generator can be applied to every one of our repos (not just libraries), since we typically have concrete release git shas that hokusai points at, etc. It's just a matter of an inspired engineer spending a future friday to set this up.

dzucconi commented 1 year ago

The whole point of conventional commits is that they follow a spec. The spec is there so that they can be machine readable by existing tooling and there is a community understanding of what is there and how to apply it. There is a ton of tooling surrounding these conventions, that help author them and adhere to the spec. I do not feel the need to complicate things here.

dzucconi commented 1 year ago

forces us to sacrifice words that could make the title much more descriptive

There's always commit body if you want to add a longer description though. That's totally valid within the spec.

lidimayra commented 1 year ago

Yeah, I always use the commit body as well, still, I like to have my titles as descriptive as possible. And for that, if I sacrifice 3 to 5 characters, that's still fine, if we start to use much longer non-standard terms, then it might force me to hide stuff from the title that I fail to see the benefit in it.

pvinis commented 1 year ago

The whole point of conventional commits is that they follow a spec. The spec is there so that they can be machine readable by existing tooling and there is a community understanding of what is there and how to apply it. There is a ton of tooling surrounding these conventions, that help author them and adhere to the spec. I do not feel the need to complicate things here.

every single tool for conv commits has support for a custom list of words. my point here is that we can use all these tools, but we could do that while using a better list of words.

damassi commented 1 year ago

every single tool for conv commits has support for a custom list of words

That's not true, unfortunately. If every tool had the ability to provide a custom list of words, then the definition of a "spec" would break down (though of course, one can imagine clever aliasing here). Auto.rc, for example, doesn't provide the ability to change the keywords and point specifically at the conventional-commits spec in their docs.

Browsing around Github on some random day, we see the conventional commits standard everywhere; it makes sense, is concise, and gets the job done without needing to micromanage every aspect of the developer experience.

pvinis commented 1 year ago

I see it does https://github.com/intuit/auto/tree/main/plugins/conventional-commits#preset

any tool about convcommits that doesn't support custom words is truly not worth using.

damassi commented 1 year ago

I stand corrected! But my point still applies. There's a common language (the spec) that would require significant retooling for it to be shared across a broad array of services, which dilutes the power of said spec.

pvinis commented 1 year ago

after 2 weeks, i see 4 yeses and 4 noes. i would very strongly suggest this becomes a thing, but since I'm not there anymore to fight for this and also gain from it being adopted, ill close this.

if any of you wants to reopen this at any point, please please do so. its one of those things that is slightly hard to change because it goes off the beaten path, but its one of those things that is so much better. the beaten path is a bad one, this one is a very human-friendly one.

damassi commented 1 year ago

its one of those things that is slightly hard to change because it goes off the beaten path, but its one of those things that is so much better. the beaten path is a bad one

It's important to recognize, too, when there's a certain personal bias involved, or blind spots tending towards unilateralism of action. To use a similar but different standard, rejecting the commonest one of them all, React.FC types. 99.99% of React codebases have adopted this standard. It is the React standard. Why do we have to make right turns and reject this in our code, to the point where FC types are actually being removed in PRs? What problem are we solving here? What problems are we creating? Custom types, custom rules, more idiosyncratic code, single-developer dependencies? Personal projects, all good. But when working on a large team and at scale?

Swapping FC types are harmless, sure, but this goes for everything. What happens when one starts dealing with serious amounts of money and vastly more complexity, and the stakes are much (much) higher, with hackers focusing on your platform every hour of every day? It's good to be more circumspect, and to think big picture and to recognize that there's wisdom in the beaten path, just as there's wisdom in standards, however much ones nature screams that there's not, in the face of all evidence to the contrary. It's something to ponder moving into your new role.

pvinis commented 1 year ago

that's true. but when someone has gotten used to something, that's also a bias that can hold you back from a better thing.

(let's not talk about the FC thing because I was right about this way before even the react core team decided to go with what I suggested much earlier 😅)