Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add automated changelog generation #103

Merged
3 commits merged into from
Feb 17, 2022
Merged

docs: add automated changelog generation #103

3 commits merged into from
Feb 17, 2022

Conversation

ghost
Copy link

@ghost ghost commented Feb 16, 2022

🚨 I don't have much experience releasing JavaScript/npm stuff so I might be missing some best practices here.


Adds npm scripts to generate a changelog template after bumping the version:

  • npm run changelog

This does:

  • Prefill the changelog with the changes from the current version down to the last version (based on the current version in package.json).

We can then manually edit the changelog, commit and PR it.

We then still need to manually tag the release on master after merging the "prepare" PR. Depending on how our release process evolves we can of course also automate these steps in the future even more. For example it would be nice to automatically tag a release and create a GitHub release (based on the changelog) using GitHub actions.

Changelog

We already started using conventional commits for our commit messages when we squash a PR. That make sit easy to prefill the changelog with these messages to get something that's already human readable and adheres to the keep-a-changelog format.

I've set it up so that all commits of types feat, update, remove, fix, security get included in the changelog by default. This is just what came to my mind based on keep-a-changelog. Let me know if we should include/remove things.

I left the changelog uncommited on purpose so that we can manually go over it and adapt it as needed (remove/add things, reformulate, etc.)

Example

The following is how the automatically generated changelog for v0.0.3 would look like. Not perfect but with a few manual edits and deletions I think it'll be quite nice—and thanks to the auto-generation much much less work than collecting and linking all that info manually.

0.0.3 (2022-02-16)

Added

Fixed

  • add integration pr links to readme (#95) (20aa39b)
  • brighten loading indicator in dark theme (#53) (693fdf1)
  • change navbar collapse to offcanvas (#44) (97ae86b)
  • condition check during wallet confirmation (#93) (9d0baf1)
  • display amount of addresses correctly (#49) (216dc2b)
  • display info text on send page if service is running (#86) (4070d70)
  • extract error message of text/html response (#84) (ffa1afa)
  • fix and dry up font featues (#98) (ac762c5)
  • hidden balance icon alignment and size (#52) (8bb8b7b)
  • initialize local storage with default values (#33) (712b289)
  • Invalid DOM property 'class' in App (d2173cd)
  • navbar padding (#48) (1a04910)
  • navigate to root on unmapped path (#89) (6f0f515)
  • prevent dom validation warning (#5) (88e2ed6)
  • show loading indicator until all data is fetched (#3) (37d882f)
  • update sat symbol (#36) (765c9d7)
  • use sprite instead of plain logo (215e2fa)

@ghost ghost added documentation Improvements or additions to documentation concept Wild idea, or too many details unknown yet devtools Improvements in tooling labels Feb 16, 2022
@ghost ghost requested review from dennisreimann, dergigi, theborakompanioni and a team February 16, 2022 11:55
@ghost ghost self-assigned this Feb 16, 2022
@dennisreimann
Copy link
Contributor

Looks good from first glance. Just fyi there is also the npm version command that includes the tagging.

@ghost
Copy link
Author

ghost commented Feb 16, 2022

Just fyi there is also the npm version command that includes the tagging.

Nice, thanks! I think I'd even prefer that. The library I use for the changelog wants to bump the version by itself but I'd much rather stay as close to native npm tooling as possible. I'll check if I can integrate npm version somehow and let the changelog library only generate the changelog and nothing else.

@ghost ghost force-pushed the changelog branch from 609ef8f to cf970e9 Compare February 16, 2022 14:09
@ghost
Copy link
Author

ghost commented Feb 16, 2022

Updated it to npm run changelog. Doesn't bump the version now. It now takes the version from package.json and updates the changelog with all changes between that version and the last tag. That way we can keep using npm tooling for bumping etc.

I'd still opt for automating as much as possible. But it's probably better to have individual building blocks that we can then automate vs. doing it all in one go.

Copy link
Collaborator

@theborakompanioni theborakompanioni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 💪

Only nit: package-lock.json has been checked in with v0.0.3 - causing untracked git changes on npm install.

Copy link
Contributor

@dergigi dergigi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff! Looks good to me ✅

I tested it by bumping the version to 0.0.3, everything worked as expected. I'd say let's merge this and update the changelog in one go for all past versions once we do the release tag?

One more thing that just came to mind: any thoughts on rc tags for release candidates? Not that it's required now, just wondering if some of you have any strong opinions or insights in that regard.

@ghost
Copy link
Author

ghost commented Feb 17, 2022

Only nit: package-lock.json has been checked in with v0.0.3 - causing untracked git changes on npm install.

Fixed! That was from testing and I probably forgot to revert it.

@ghost
Copy link
Author

ghost commented Feb 17, 2022

One more thing that just came to mind: any thoughts on rc tags for release candidates? Not that it's required now, just wondering if some of you have any strong opinions or insights in that regard.

No strong opinions. We could also think about adding a -alpha or something like this now that I think about it.

@ghost
Copy link
Author

ghost commented Feb 17, 2022

update the changelog in one go for all past versions

We'll need to do that manually since we didn't use conventional commits back then—so not much will show up in the autogenerated changelog. I can take care of that in a separate PR though.

As for the general release process, since master is a protected branch, we won't be able to bump and tag in one go (assuming we want the release tag on master which probably makes sense I would say). We'd have to do somethign like this:

  1. Prepare release: Bump and update changelog.
  2. PR changes to master
  3. Tag release on master

Thoughts? If ok with everyone I can add npm scripts for that to make the process easier and documented in a way.

@ghost ghost mentioned this pull request Feb 17, 2022
@ghost
Copy link
Author

ghost commented Feb 17, 2022

update the changelog in one go for all past versions

We'll need to do that manually since we didn't use conventional commits back then—so not much will show up in the autogenerated changelog. I can take care of that in a separate PR though.

As for the general release process, since master is a protected branch, we won't be able to bump and tag in one go (assuming we want the release tag on master which probably makes sense I would say). We'd have to do somethign like this:

1. Prepare release: Bump and update changelog.

2. PR changes to master

3. Tag release on master

Thoughts? If ok with everyone I can add npm scripts for that to make the process easier and documented in a way.

Moving this discussion to an issue. ☝️ #105 Would love to hear everyone's thoughts!

@ghost ghost merged commit e83ebb9 into master Feb 17, 2022
@ghost ghost deleted the changelog branch February 17, 2022 10:13
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
concept Wild idea, or too many details unknown yet devtools Improvements in tooling documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants