opral/ninja-i18n-action

[Question] How to customize the commit message format?

Closed this issue ยท 12 comments

In our repository, we've implemented a CI workflow for commit message lint that only permits merges if the commit messages follow a specific format.

Currently, the commit messages created by this action adhere to the following example: 'Fink ๐Ÿฆ: update translations.'

Hey @LucasXu0, thank you for your question.
There is currently no way to change the commit message for commits via the Fink localization editor. What format would you want for this message to pass the linting test?

I also take this as a feature request for Fink to change the commit message. For this, we need to introduce app-specific settings. We have it on our list.

@niklas.buchfink what do you mean with app specific settings?

Users need to write a commit message. What does a setting have to do with it?

@samuelstroschein @LucasXu0 Correct me if I'm wrong:

  • As a user, I might want to set a different (default) commit message when translations are committed via Fink
  • Fink should use this commit message for all users of this project
    -> Therefore, the option must be set in the Fink-specific settings (that don't exist yet)

As a contributor, I don't want to bother writing a commit message according to the formatting of the commit message hidden somewhere in CONTRIBUTING.md. Instead, the maintainer can set the default commit message for how Fink should commit to their project and contributors can simply contribute.

  • As a user, I might want to set a different (default) commit message when translations are committed via Fink

There should be no default hardcoded commit message is what I am implying ;)

We have a default commit message to avoid the need to build a UX flow of writing commit messages. If users request a workflow for writing commit messages, we should set up a project for fink. Some thoughts for a UX commit flow

  • chatgpt could yield great pre-filled commit messages
  • exploring how to deal with commits in general is an interesting question

I know what you mean, but for this case here we go from "a user wants a different default commit message in a specific format so the CI is not to failing all the time" to "every user out there is forced to write a commit message" (according to the lint rule in CI)

Of course, I want a bot (ChatGPT) to write a commit message for me and describe what I have done. Ultimately, it's just a summary to give context and to reflect changes later in history. Nobody wants to write commit messages if they don't have to.

But if ChatGPT does not have the context of the contributing policy (CONTRIBUTION.md? documentation?), it will not give me an appropriate commit message. So this would not be the solution to this issue.

@LucasXu0 can you clarify what you desire?

Templating a hardcoded commit message, or that users can write commit messages?

For example, this plugin allows developers to set a commit template in project.inlang/settings.json (this is just a hypothetical location for customizing the commit message template). Developers can then establish their desired commit message templates, such as chore: update translation or similar phrases that comply with commit linting conventions, like feat: add new feature.

https://github.com/AppFlowy-IO/AppFlowy/actions/runs/8632795138/job/23664335960

Screenshot 2024-04-12 at 14 01 10

@LucasXu0 can you clarify what you desire?

Templating a hardcoded commit message, or that users can write commit messages?

Templating a hardcoded commit message works well enough for me. Alternatively, display the predefined commit message by default in the box shown in the screenshot, and allow the user to modify it.

Screenshot 2024-04-12 at 14 42 56

Thank you for the clarification ๐Ÿ™
As a maintainer, you want to set the default message for your translators or drive-by contributors. It is similar to an issue template. If the default is wrong, you will spend much time explaining how things should be.
Even though I like the idea of showing the commit message above the floating field, I would rather postpone introducing commit messages for Fink users until it is derived for the right reasons. Not having a message field results in a better UX for maintainers and contributors.

My proposal

  • First of all, we can set a better default that is in line with Conventional Commit
  • We could create better commit messages without ChatGPT, because we know which languages have been changed before the commit. This could be part of the subject of the generated message
  • Give maintainers a way to set a different default commit message for all contributorsproject.inlang/settings.json or if this should be a setting specific to the app Fink
  • Give maintainers a way to set a different default commit message for all contributorsproject.inlang/settings.json or if this should be a setting specific to the app Fink

@niklas.buchfink specific to fink. no other needs this as far as i know.

@LucasXu0 I have updated the commit message to "chore: update translations with Fink ๐Ÿฆ".
I have also copied your workflow and it no longer fails.

@LucasXu0 I have updated the commit message to "chore: update translations with Fink ๐Ÿฆ". I have also copied your workflow and it no longer fails.

Thanks for the quick fix. It works! I'll close this issue since the current commit message is satisfactory, and I don't need any other customizations right now.