feat: add config option to enable Signed-off-by in commit messages#7766
feat: add config option to enable Signed-off-by in commit messages#7766emersion wants to merge 2 commits intodecaporg:mainfrom
Conversation
yanthomasdev
left a comment
There was a problem hiding this comment.
Thanks @emersion, good work. I have a few questions/sugestion for you.
First, could you update the Gitea and Git Gateway backends to pass email down? That should ensure they also can use this feature.
Also, it would be nice to add another test ensuring no trailer is added when the option is disabled.
| const templates = { ...commitMessageTemplates, ...(config.backend.commit_messages || {}) }; | ||
|
|
||
| let trailers = ''; | ||
| if (config.backend.signoff_commits && authorName && authorEmail) { |
There was a problem hiding this comment.
I am wondering, maybe there should be a log if the option is enabled but there's no authorEmail so organizations that need it can track this issue down?
There was a problem hiding this comment.
Good point! Added some logging.
Most backends don't need any change because they already populate this field.
Some organizations require Signed-off-by trailers in commit messages (e.g. for Developer Certificate of Origin). GitHub has a setting to enable this when authoring changes from the Web UI. This patch adds a similar setting for DecapCMS. Closes: decaporg#7730
Yes! Done.
I think existing tests already cover this case? For instance |
|
Thanks for the review! |
Summary
Some organizations require Signed-off-by trailers in commit
messages (e.g. for Developer Certificate of Origin). GitHub has a
setting to enable this when authoring changes from the Web UI.
This patch adds a similar setting for DecapCMS.
Note, most backends don't need any change for the new
emailfield because they already populate it.Closes: #7730
Test plan
signoff_commits: trueto thebackendconfig.Signed-off-bytrailer.Note, a logout + login might be required with GitHub to refresh cached auth data. The backend needs to populate the
emailfield (GitHub, GitLab, Gitea, etc should work fine).Checklist
A picture of a cute animal (not mandatory but encouraged)
