News for hackers. Stuff that matters.
Re:Keep a Changelog by petethepig on Saturday December 04, 2021 @12:22AM (#29438903)
Semantic pull requests [0] + conventional-changelog [1] + squashing PRs and you get almost the same results (and more) with great automation and self-documentation for the whole process:

* you'll never forget to add something to changelog

* you get links to PRs in your changelog

* it's much faster to make edits to PR messages compared to editing files

* outside contributors get familiarized with the practice much faster (imagine getting new contributors to update changelogs)

We recently adopted this practice at Pyroscope and it's been working out pretty well for us [2], I can certainly recommend it.

[0] - https://github.com/apps/semantic-pull-requests

[1] - https://github.com/conventional-changelog/conventional-chang...

[2] - https://github.com/pyroscope-io/pyroscope/blob/main/CHANGELO...

Re:Keep a Changelog by jrochkind1 on Saturday December 04, 2021 @09:18AM (#29440968)
I'm having trouble figuring out what a "semantic pull request" is from that link, it's not a concept I've heard of before, and I'm interested. I mean, i assume it's some conventions for what goes in PR message, but what are they? Is there a better link?

In general, as a developer-consumer of them, I have found automatically-generated-from-commits changelogs to be not so useful, but I don't know if I've experienced any using the conventions you are recommending (which I dont' understand!).

In the small projects I write, I include links to the PR in the manually created CHANGELOG (the delta of which is part of the PR) simply by making the PR, then making another commit/ammend in the PR to add it's own url to the CHANGELOG. These are some extra steps, it's true.

Re:Keep a Changelog by danieldisu on Saturday December 04, 2021 @10:44AM (#29441543)
You use the title of the PR as a changelog item instead of every commit message.

It forces you to think a moment for a good PR title, but it is an small price to pay when it gives you a 0 extra work changelog that is good enough for semi-internal use.

Re:Keep a Changelog by a5aAqU on Saturday December 04, 2021 @02:33PM (#29443623)
Instead of using the title, could the changes be put in the description using a custom syntax? Prefix the line with `CHANGELOG:` or something like that.

    git --no-pager log | grep 'CHANGELOG: '
https://git-scm.com/book/en/v2/Customizing-Git-An-Example-Gi...
Re:Keep a Changelog by Vinnl on Saturday December 04, 2021 @10:38AM (#29441501)
I really dislike this because, while it's easier for the author, either the changelog or the commit messages become less useful. In fact, I might just copy the last time I ranted about this [1]:

> Ugh. One of my pet peeves is the generation of release notes from commit messages. Commit messages and PR descriptions have a different audience (i.e. contributors) from release notes (i.e. users).

> For example, take a look at ESLint's autogenerated changelog [1]:

    67c0074 Update: Suggest missing rule in flat config (fixes #14027) (#15074) (Nicholas C. Zakas)
    cf34e5c Update: space-before-blocks ignore after switch colons (fixes #15082) (#15093) (Milos Djermanovic)
    c9efb5f Fix: preserve formatting when rules are removed from disable directives (#15081) (Milos Djermanovic)
    14a4739 Update: no-new-func rule catching eval case of MemberExpression (#14860) (Mojtaba Samimi)
    7f2346b Docs: Update release blog post template (#15094) (Nicholas C. Zakas)
    fabdf8a Chore: Remove target.all from Makefile.js (#15088) (Hirotaka Tagawa / wafuwafu13)
    e3cd141 Sponsors: Sync README with website (ESLint Jenkins)
    05d7140 Chore: document target global in Makefile.js (#15084) (Hirotaka Tagawa / wafuwafu13)
    0a1a850 Update: include ruleId in error logs (fixes #15037) (#15053) (Ari Perkkiö)
    47be800 Chore: test Property > .key with { a = 1 } pattern (fixes #14799) (#15072) (Milos Djermanovic)
    a744dfa Docs: Update CLA info (#15058) (Brian Warner)
    9fb0f70 Chore: fix bug report template (#15061) (Milos Djermanovic)
    f87e199 Chore: Cleanup issue templates (#15039) (Nicholas C. Zakas)
> I'm reading release notes to get a feel for how the new release might impact me. This takes so much time to scan, because there's so much useless cruft (to me, as a user) I have to ignore.

> What's worked very well for me is to simply have an "I updated the changelog, if applicable" entry in my PR template checklist. Then when I cut a new release, I simply add the release date above the release notes currently listed under "Unreleased", and they'll list all relevant changes, reviewed during the pull request to verify that it is relevant to users.

> [1] https://github.com/eslint/eslint/blob/master/CHANGELOG.md

[2] https://news.ycombinator.com/item?id=28757317

Re:Keep a Changelog by ReleaseCandidat on Saturday December 04, 2021 @04:15AM (#29439708)
It always depends on your users. Such a changelog is suitable for stuff other developers use, but not for end users.

But it is a _way_ better starting point to write a changelog that 'usual' commit messages or PR descriptions.

Re:Keep a Changelog by majkinetor on Saturday December 04, 2021 @04:37AM (#29439787)
I disagree. I publish to the end users and they are grateful all the time.

I use custom scheme tho, using Gitlab issue title and issue labels. I find this more meaningful since one issue can contain multiple PRs and I still want single changelog line.

Re:Keep a Changelog by bbarnett on Saturday December 04, 2021 @08:08AM (#29440592)
How can I, as a user, know if bug x, or issue y is resolved, without a changelog?!
Re:Keep a Changelog by detaro on Saturday December 04, 2021 @09:59AM (#29441209)
Nobody suggested not having a changelog.
Re:Keep a Changelog by rezonant on Saturday December 04, 2021 @01:22AM (#29439123)
Seconded, I've seen semantic PR plus squash add a lot of value both for the engineering side and the product side.

We do this and it works great, but I've still found value in summarizing things in a digest (ie changelog or release notes, depending on the context)

Re:Keep a Changelog by sjtindell on Saturday December 04, 2021 @04:14AM (#29439702)
Thirded? Tertiaried? This is something I always beat myself up for not doing consistently. Automating it at a minimum checks the box, and also can provide real value.
Re:Keep a Changelog by busbus on Saturday December 04, 2021 @04:12AM (#29439694)
May I ask you why you want to squash every branch ?

What is the size of the resulting commit (in terms of average modified files, lines of code) ?

Re:Keep a Changelog by rezonant on Saturday December 04, 2021 @04:54AM (#29439843)
I've shared this anecdote elsewhere but it's my go-to example. We recently had a new engineer join our team, we gave them a small piece of work related to a bigger feature we had completed months before they arrived. They tracked the feature back to the squashed PR commit, which of course referenced the Github PR URL- in there they had the engineer's summary and implementation caveats, the review comments from the rest of the team and the discussion context. They could reference all the commits made throughout the process from there. The PR itself used "Closes #X" syntax, so they could jump back to the engineering task and up into the product backlog item that spawned it. They nailed the change the first time :-)

> What is the size of the resulting commit (in terms of average modified files, lines of code) ?

Lately I'm starting to advocate squashing PR branches even if they have only a single commit. The real benefit here is that Github puts the PR URL into the squashed commit message. It automates the "context links" regardless of whether a PR branch ends up being 1 commit or 50

Re:Keep a Changelog by busbus on Saturday December 04, 2021 @05:03AM (#29439875)
I understand the needs. But to me, I can’t see any real value to squashing other than cleaning local history before sharing the code. Also, and that’s important for me (maybe other people doesn’t care of it) I lose the ability to bisect more precisely. When I know that my guilty commit is a squashed one, I have to watch every modification to understand what went wrong, which takes time for me.

Also, everything you describe can be achieved with a merge commit. As a side effect, when you look at the history, you may be annoyed with small commits that may not interest you. But Git can help by displaying only merge commit (with --first-parent option).

Re:Keep a Changelog by rezonant on Saturday December 04, 2021 @05:10AM (#29439895)
Ah bisect is a great use case here.

True that you can achieve it in a merge commit. And I think Github includes the PR URL in a merge commit as well iirc. I suppose my main argument is really just that the always-rebase strategy that was trendy for awhile has some downsides over squash/merge commit /shrug

Re:Keep a Changelog by jrochkind1 on Saturday December 04, 2021 @09:24AM (#29440999)
I don't think I understand what "squashing PR branches" means (a github feature I haven't noticed?), but:

> The real benefit here is that Github puts the PR URL into the squashed commit message.

While not in the commit message, github will show you the PR a commit is part of in it's commit view regardless, also for every commit in a PR whether it's one commit or 50. Which I do find invaluable for tracing the documentation of a change, agreed! Not everyone knows about this feature (I don't think it's been there forever) in github UI.

Eg notice the `#279` included in this github commit UI display (the PR was, I'm pretty sure, not "squashed").

https://github.com/traject/traject/commit/10339e774e92e57f44...

Re:Keep a Changelog by fphilipe on Saturday December 04, 2021 @05:07AM (#29439888)
The merge commit also includes the link to the PR when merged via the GitHub UI (or locally via `hub merge $PR_URL`).
Re:Keep a Changelog by majkinetor on Saturday December 04, 2021 @04:38AM (#29439792)
One typical reason would be easier history following and eventually revert.
Re:Keep a Changelog by morgante on Saturday December 04, 2021 @05:24AM (#29439948)
Yep, I love this workflow.

We use release-please to automatically generate WIP "release PRs" so we can see the exact changelog (for a candidate release) drafted as merges come in.

[0] https://github.com/googleapis/release-please

Re:Keep a Changelog by kubanczyk on Saturday December 04, 2021 @10:57AM (#29441633)
Semantic pull requests work well for a slow pace of work, and I use them all the time.

I also recognize that for full-speed delivery, they are suboptimal in that they sit directly on the critical path. After reviewing the code of the PR, there is now an extra context switch to also review the title/semantics.

So the complexity of turning a list of PRs into a changelog does not disapper, it gets hidden within each individual PR.