cornucopia-rs / cornucopia

Generate type-checked Rust from your PostgreSQL.
Other
759 stars 31 forks source link

Add a changelog. #190

Open LouisGariepy opened 1 year ago

LouisGariepy commented 1 year ago

Since our main branch is currently sitting at v0.9, and there's a bunch of incoming PRs to merge, now is a good time to add a CHANGELOG.md for future releases.

There are a number of different ways to go about this, but notably:

  1. Write the changelog manually, following https://keepachangelog.com/en/1.0.0/.
  2. Use conventional commits to automatically generate a changelog.

Option 1 (manual logging) could be done at the release level, or as @tbillington suggested, we could require each PR to maintain relevant changelog entries.

Note that if we go with route 2), I won't be enforcing a pre-commit hook for conventional commits. In my opinion, its the responsibility of the maintainers (not the casual committer) to ensure that proper conventional commits are used. Git provides tools for maintainers to achieve this, notably interactive rebasing.

I'd like to distinguish between "release notes" and "changelog".

The changelog is meant for developpers or power-users who want to know on a fine-grained level what's happening in the repository and look at the relevant PRs.

Release notes are meant for the average user, explaining at a high-level what's new, what's changed and how to upgrade. By definition they must be written manually, and I'm committed to write these out myself when release time comes, regardless of how we decide to generate the changelog.

jacobsvante commented 1 year ago

My vote goes to number two. And I disagree that a commit hook should be optional as that would mean human error is still in play. Or as an option you could create an action that checks the commit messages instead, then the user can rebase before PR merge.

LouisGariepy commented 1 year ago

I agree that if we go route 2, we should find a way to prevent merging non-conventional commits.

The problem with a required commit hook is that it adds more friction to casual contributors who might not know or care about conventional commits. I don't want to dissuade or slow down PRs just because the author is not familiar with conventional commits.

jacobsvante commented 1 year ago

Sounds reasonable 👍🏻

Virgiel commented 1 year ago

This is the first time I have heard of conventional commits. As I understand it, each commit has to be formatted in a certain way to be added as a line in the changelog. I'm afraid that this would encourage squashing large changes in a single commit, which might be harder to track.

tbillington commented 1 year ago

An alternative to conventional commits is require all PRs also add to the changelog as part of the PR.

LouisGariepy commented 1 year ago

@tbillington I'll add this option to the original post! Thanks :)