-
Notifications
You must be signed in to change notification settings - Fork 491
Description
Is your feature request related to a problem? Please describe.
Yes. We follow a strict Trunk-Based workflow.
The problem occurs when we need to issue a hotfix for an older version while main has already moved forward with new features.
The Scenario:
We release v1.1.0 from main.
main accumulates new features (Feat A, Feat B) for the next release (v1.2.0).
A critical bug is found in v1.1.0. We fix it on a temporary hotfix branch (derived from the v1.1.0 tag) and release v1.1.1.
To keep main consistent, we cherry-pick this fix back to main.
The Problem: Since cherry-pick generates a new SHA, Release Please treats this back-ported commit as a completely new change on main. Consequently, the next regular release (v1.2.0) includes the same bug fix entry in the changelog again (Duplicate Entries), or causes version collisions if the hotfix was a feat.
Describe the solution you'd like
I would like to request a configuration option (e.g., "deduplicate-commits-by-message": true) in release-please-config.json.
When this option is enabled, Release Please should check the commit message (title) during changelog generation. If a commit with the exact same title has already been included in a previous release tag (e.g., found in v1.1.1), it should be excluded from the current changelog (v1.2.0), even if the SHA is different.
Describe alternatives you've considered
Currently, we use a manual workaround:
When cherry-picking the hotfix to main, we manually rename the commit message from fix: to chore: to force Release Please to ignore it.
This process is tedious, error-prone, and relies on developers remembering to rename commits every time they back-port a fix.
Additional context
I am aware of Issue #2476 and the stance that "Git SHA is the source of truth."
However, in a Trunk-Based workflow, cherry-picking hotfixes back to main is a very common pattern. The lack of message-based deduplication forces us to modify commit history (renaming to chore) just to keep the changelog clean. Providing this as an opt-in feature would be extremely helpful.