product-os / versionist

Flexible CHANGELOG generation toolkit that adapts to your commit conventions
44 stars 15 forks source link

Failure to categorize changes in changelog #92

Open jhermsmeier opened 7 years ago

jhermsmeier commented 7 years ago

Given the following git log, which contains feature additions, fixes and misc commits with correct footers, versionist fails to generate an appropriate CHANGELOG.md as show in the diff below:

> git lg v1.1.2..
* 6089b0b (HEAD -> release-1.2.0, origin/release-1.2.0) - 1.2.0 (2 hours ago) [Jonas Hermsmeier]
* 3147a93 (origin/master, origin/HEAD, master) - feat(image-stream): Support .bin image extension (#1750) (3 hours ago) [Jonas Hermsmeier]
* cb7117a - upgrade(node-stream-zip): 1.3.4 -> 1.3.7 (#1730) (11 days ago) [Jonas Hermsmeier]
* b5912eb - fix: Support raw images without secondary file extension (#1724) (3 weeks ago) [Jonas Hermsmeier]
* a3c54f2 - refactor(image-stream): Remove Promise props resolve (#1726) (3 weeks ago) [Jonas Hermsmeier]
* 70edfa3 - chore: fix CLI packaging snapshot relative directory (#1713) (3 weeks ago) [Juan Cruz Viotti]
* 077eb5b - upgrade: mountutils to v1.2.2 (#1712) (4 weeks ago) [Juan Cruz Viotti]
* e654311 - chore(package): Bump resin-corvus to 1.0.0-beta.29 (#1720) (4 weeks ago) [Jonas Hermsmeier]
* 0d0ddd5 - upgrade: drivelist to v5.1.8 (#1714) (4 weeks ago) [Juan Cruz Viotti]
* ce466bd - docs(README): execution -> executable (#1715) (4 weeks ago) [Juan Cruz Viotti]
* f67f25b - chore: don't zip AppImages (#1703) (5 weeks ago) [Juan Cruz Viotti]
* 488f281 - chore: build armhf on GNU/Linux (#1482) (5 weeks ago) [Juan Cruz Viotti]
* 7b791d6 - feat(GUI): support new "pending" drive flag (#1709) (6 weeks ago) [Juan Cruz Viotti]
* f3c8ec4 - test(shared): ensure drive objects can contain extra properties (#1705) (6 weeks ago) [Juan Cruz Viotti]
* 9f4712f - refactor: use an SDK orchestrator to implement drive scanning (#1707) (6 weeks ago) [Juan Cruz Viotti]
* f9d7dd2 - upgrade: drivelist to v5.1.5 (#1692) (6 weeks ago) [Juan Cruz Viotti]
* 63d030d - Revert "chore: cache Travis CI docker builds (#1694)" (7 weeks ago) [Juan Cruz Viotti]
* 7b308b0 - chore: fix build system (#1695) (7 weeks ago) [Juan Cruz Viotti]
* 5e13be9 - chore: cache Travis CI docker builds (#1694) (7 weeks ago) [Juan Cruz Viotti]
* 325fc22 - docs: add chocolatey install instructions (#1685) (8 weeks ago) [Juan Cruz Viotti]
* 5196ac8 - refactor: simplify release type handling within the app (#1667) (8 weeks ago) [Juan Cruz Viotti]
* 79a7a03 - chore: enforce single quotes in ESLint (#1679) (8 weeks ago) [Juan Cruz Viotti]
@ CHANGELOG.md:6 @
 All notable changes to this project will be documented in this file.
 This project adheres to [Semantic Versioning](http://semver.org/).

+## v1.1.3 - 2017-10-03
+
+### Misc
+
+- Fix Etcher being unable to read certain zip files
+- Retry ejection various times before giving up on Windows.
+- Try to use `$XDG_RUNTIME_DIR` to extract temporary scripts on GNU/Linux.
+- Fix "Couldn't scan the drives: An unknown error occurred" error when there is a drive locked with BitLocker.
+
 ## v1.1.2 - 2017-08-07
lurch commented 7 years ago

I've just had a look into this, and AFAICT versionist is behaving correctly here. It looks like there's additional logic in Etcher's version of versionist.conf.js which means that it only includes changes (in the CHANGLEOG) for commits that have a Changelog-Entry footer https://github.com/resin-io/etcher/blob/master/versionist.conf.js#L36 IIRC Etcher was the first project to use versionist (?), a long long time before VersionBot existed. I guess @jviotti can fill in extra context / information here... ;-) Perhaps this is something to discuss in the next Etcher team-meeting?

jhermsmeier commented 7 years ago

Regardless of config settings, the version bump in this case should have been a minor, rather than patch – guess I didn't describe the issue very well.

lurch commented 7 years ago

Hmmm, confirmed. To reproduce:

$ cd /tmp
$ git clone https://github.com/resin-io/etcher
Cloning into 'etcher'...
[snip]
Checking connectivity... done.
$ cd etcher
$ git checkout 3147a93
Note: checking out '3147a93'.
[snip]
HEAD is now at 3147a93... feat(image-stream): Support .bin image extension (#1750)
$ git tag | tail -1
v1.1.2
$ git log v1.1.2.. | grep -i Change-Type
    Change-Type: minor
    Change-Type: patch
    Change-Type: patch
    Change-Type: patch
    Change-Type: patch
    Change-Type: patch
    Change-Type: patch
    Change-Type: patch
    Change-Type: patch
    Change-Type: patch
    Change-Type: patch
$ make electron-develop
[snip]
$ node_modules/.bin/versionist 
Done
$ git diff
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0848079..43cad88 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,15 @@
 All notable changes to this project will be documented in this file.
 This project adheres to [Semantic Versioning](http://semver.org/).

+## v1.1.3 - 2017-10-14
+
+### Misc
+
+- Fix Etcher being unable to read certain zip files
+- Retry ejection various times before giving up on Windows.
+- Try to use `$XDG_RUNTIME_DIR` to extract temporary scripts on GNU/Linux.
+- Fix "Couldn't scan the drives: An unknown error occurred" error when there is a drive locked with Bit
+
 ## v1.1.2 - 2017-08-07

 ### Features
$ git log HEAD~1..
commit 3147a93ca65d0b8c818fbccb5769bf5c7d5c18d1
Author: Jonas Hermsmeier <jhermsmeier@gmail.com>
Date:   Tue Oct 3 18:13:02 2017 +0200

    feat(image-stream): Support .bin image extension (#1750)

    This adds support for selecting images with a `.bin` file extension.

    Change-Type: minor
    Closes #1739

I wonder if the

  includeCommitWhen: (commit) => {
    return commit.footer['Changelog-Entry']
  },

in Etcher's versionist.conf.js might mean that versionist is also ignoring the Change-Type: minor in 3147a93 ? Whereas I guess expected behaviour would be for versionist to only apply that filter when determining which entries to include in the Changelog, and ignore the filter when calculating the version-bump? *shrug* (or that might be an incorrect guess, and something else might be going wrong)