DEV Community

Cover image for Changie - Automated Changelog Generation for Any Project
miniscruff
miniscruff

Posted on • Updated on

Changie - Automated Changelog Generation for Any Project

Getting started experience with Changie.

It was over a year ago that I posted an article about my side project changie. That post was mostly a comparison of the file based approach compared to commit messages, this post is more about the Changie specific features.

The full changelog for Changie, generated by Changie can be viewed on the website or on GitHub.

Headers and Footers

A big improvement to Changie has been allowing users to add custom headers and footers in a few formats. With full support for templating you can do some cool stuff.

For all the details see the docs on headers and footers

A small example could be to show many updates happened for each kind.

headerFormat: |
  Updates:
  {{- range $kind := (kinds .Changes | uniq)}}
    {{- $changeCount := (kinds $.Changes | count $kind)}}
    {{- if gt $changeCount 0 }}
    * {{$kind}}: {{$changeCount}}
    {{- end}}
  {{- end}}
Enter fullscreen mode Exit fullscreen mode

The end result would look something like:

## v0.1.0 - 2022-03-13
Update Counts:
  * Added: 2
  * Changed: 1
  * Deprecated: 1
  * Fixed: 3

### Added
* A
* B
### Changed
* C
### Deprecated
* D
### Fixed
* E
* F
* G
Enter fullscreen mode Exit fullscreen mode

One team is using the custom footers to show any public contributors per pull request, check out the discussion.

A simpler version of showing all unique contributors from GitHub would look like this:

# config yaml
custom:
- key: Author
  type: string
  minLength: 3
footerFormat: |
  ### Contributors
  {{- range (customs .Changes "Author" | uniq) }}
  * [{{.}}](https://github.com/{{.}})
  {{- end}}  
Enter fullscreen mode Exit fullscreen mode

Currently you can see headers and footers using either a format option in the config, a file path option in the config or by passing an argument to batch.

Latest

When creating tooling for automation or release notes it can be quite useful at times to know what our current version is.
A good example of this is combining Changie with release automation such as GoReleaser as seen by this GitHub Workflow.

See the Latest command docs.

Bumping

Bumping can be used to increase the current version to the next version by semantic name instead of a new version. See the batch command docs.

# instead of
changie batch v1.4.1
# you can use
changie batch major
changie batch minor
changie batch patch
Enter fullscreen mode Exit fullscreen mode

If you just want the output for the next version you can use next. See the next command docs.

Dry runs

When editing Changie configs, running a demo or maybe as part of CI logging, it can be useful to see what the output or changes would be without actually making those changes.
This is especially true for Changie as, by default, it will create and delete many files that could be tedious to get back.

To that end, any command that would write out to a file, edit a file or delete a file, you can add --dry-run to instead print to standard out.

changie new --dry-run
changie batch patch --dry-run
changie merge --dry-run
Enter fullscreen mode Exit fullscreen mode

That is all for now. Reach me on twitter @miniScruffDev or by starting a discussion on GitHub.

Thanks for reading.

Top comments (1)

Collapse
 
marcomoscatelli profile image
Marco Moscatelli

Looks promising!