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

[FEATURE] Changelog - Custom predefined sort order #355

Open
Djaytan opened this issue Dec 28, 2023 · 0 comments
Open

[FEATURE] Changelog - Custom predefined sort order #355

Djaytan opened this issue Dec 28, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Djaytan
Copy link

Djaytan commented Dec 28, 2023

Is your feature request related to a problem? Please describe.

Here is an example of changelog generated by Cocogitto after a cog bump --auto for my personal project:
image

However, I encounter two problems with this result:

  • The ascending order implemented in the changelogs templates are not relevant when customizing titles with emojis as prefixes (this is like having a "random" one more or less)
  • I would like to bring to the fore features and fixs included in the new release, and only after presenting the rest (build, test, doc, etc).

Here is an example custom predefined ordering I would like in my changelogs:

  1. feat
  2. fix
  3. perf
  4. revert
  5. docs
  6. test
  7. build
  8. ci
  9. refactor
  10. chore
  11. style

But the ordering is personal to each developer, and can be subject to changes over time.

Describe the solution you'd like

A way to specify a custom predefined order of sections in changelog based on personal developer preferences.

The idea I have in mind is the following one:

Add a new changelog_order attribute for commit_types (or anything else as name that communicate clearly the intent):

[commit_types]
feat = { changelog_order = 1, changelog_title = "🌟 Features" }
fix = { changelog_order = 2, changelog_title = "🐛 Bug Fixes" }
perf = { changelog_order = 3, changelog_title = "⚡ Performances" }
revert = { changelog_order = 4, changelog_title = "↩️ Revert" }
docs = { changelog_order = 5, changelog_title = "📖 Documentation" }
test = { changelog_order = 6, changelog_title = "✅ Tests" }
build = { changelog_order = 7, changelog_title = "🏗️ Build System" }
ci = { changelog_order = 8, changelog_title = "📦 Continuous Integration" }
refactor = { changelog_order = 9, changelog_title = "🛠️ Refactoring" }
chore = { changelog_order = 10, changelog_title = "🧹 Miscellaneous Chores" }
style = { changelog_order = 11, changelog_title = "🖌️ Style" }

Then adjust the tera templates for changelogs. More specifically, modifying the call to the sort function seems to be a good way to achive the desired goal.

Describe alternatives you've considered

Creating my own custom template thanks to the following documentation pages: link & link... But that's clearly not ideal since it implies hardcoding the sorting order in the template directly with lots of duplication.

Furthermore, I guess some people in the community around Cocogitto would benefit as well from this new feature without having to create their own template.

Additional context

The complete changelog generated in my personal project can be found here.

Some changelogs examples from the OSS community having a specific sort order for sections:

  • The Spring Boot framework: link
  • Flyway: link
  • Configurate: link
  • Testcontainers: link
@Djaytan Djaytan added the enhancement New feature or request label Dec 28, 2023
@oknozor oknozor added the good first issue Good for newcomers label Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants