codus/codelog

Preserve the order of topics when creating a new release

luisbevilacqua opened this issue · 0 comments

It would be nice if, when releasing a new version, the order of the topics in the consolidated version file are the same as the order defined in the template.yml.

Current Behavior

Suppose I have this template.yml file:

# template.yml
"First more important topic":
  - A topic that is very important to the changelog, something like major features or breaking changes

"Last and least important topic":
  - Minor changes, small fixes, etc...

Now imagine two different users create a change file in this order:

# 20190101120000000_minor_change.yml
"Last and least important topic":
  - Added Oxford comma to documentation to remove the ambiguity
# 20190201120000001_major_change.yml
"First more important topic":
  - Refactor the login API to receive a new obligatory parameter

The parser currently orders the topics as they first appear in the files. As the least important changes comes first in this case the generated release file will be something like this:

## 1.2.3 - 2019-03-01
"Last and least important topic"
  - Added Oxford comma to documentation to remove the ambiguity

"First more important topic"
  - Refactor the login API to receive a new obligatory parameter

This might be a problem given a great number of minor changes as they can push crucial changes to the end of the file where they can pass unnoticed.

Expected Behavior

My suggestion is to order the topics in the same way they are written in the template.yml file, the example above would be parsed as something like this:

## 1.2.3 - 2019-03-01
"First more important topic"
  - Refactor the login API to receive a new obligatory parameter

"Last and least important topic"
  - Added Oxford comma to documentation to remove the ambiguity

I think this makes more sense as all releases will now follow the same order of topics and it avoids problems like forgetting to execute a deploy command that is hidden bellow minor changes.

Your Environment

  • Codelog version used: 0.8.0
  • Ruby version: 2.6.0p0 (2018-12-25 revision 66547) [x86_64-darwin18]
  • Operating System and version: macOS Mojave 10.14.4