2021-01-30 08:29:07 +00:00
---
2022-10-02 03:32:16 +00:00
title: "Commit Message"
2022-06-15 07:51:47 +00:00
description: "Authelia Development Commit Message Guidelines"
lead: "This section covers the git commit message guidelines we use for development."
2022-06-28 05:27:14 +00:00
date: 2021-01-30T19:29:07+11:00
2022-06-15 07:51:47 +00:00
draft: false
images: []
menu:
contributing:
2022-10-02 03:32:16 +00:00
parent: "guidelines"
weight: 320
2022-06-15 07:51:47 +00:00
toc: true
aliases:
- /docs/contributing/commitmsg-guidelines.html
2022-10-20 03:21:45 +00:00
- /contributing/development/guidelines-commit-message/
2021-01-30 08:29:07 +00:00
---
2022-06-15 07:51:47 +00:00
The reasons for these conventions are as follows:
2021-01-30 08:29:07 +00:00
2022-06-15 07:51:47 +00:00
* simple navigation though git history
* easier to read git history
2021-01-30 08:29:07 +00:00
2022-06-15 07:51:47 +00:00
## Commit Message Format
2021-01-30 08:29:07 +00:00
2022-06-15 07:51:47 +00:00
Each commit message consists of a __header__ , a __body__ , and a __footer__ .
2021-01-30 08:29:07 +00:00
```bash
< header >
< BLANK LINE >
< body >
< BLANK LINE >
< footer >
```
2022-06-15 07:51:47 +00:00
The `header` is mandatory and must conform to the [Commit Message Header ](#commit-message-header ) format. The header
cannot be longer than 72 characters.
2021-01-30 08:29:07 +00:00
2022-06-15 07:51:47 +00:00
The `body` is mandatory for all commits except for those of type "docs". When the body is present it must be at least 20
characters long and must conform to the [Commit Message Body ](#commit-message-body ) format.
2021-01-30 08:29:07 +00:00
2022-06-15 07:51:47 +00:00
The `footer` is optional. The [Commit Message Footer ](#commit-message-footer ) format describes what the footer is used
2021-04-11 11:25:03 +00:00
for, and the structure it must have.
2021-01-30 08:29:07 +00:00
### Commit Message Header
2022-06-15 07:51:47 +00:00
```text
2021-01-30 08:29:07 +00:00
< type > (< scope > ): < summary >
│ │ │
│ │ └─⫸ Summary in present tense. Not capitalized. No period at the end.
│ │
2022-09-16 04:21:05 +00:00
│ └─⫸ Commit Scope: api|autheliabot|authentication|authorization|buildkite|bundler|cmd|
│ codecov|commands|configuration|deps|docker|duo|go|golangci-lint|
│ handlers|logging|metrics|middlewares|mocks|model|notification|npm|ntp|
2023-01-12 10:57:44 +00:00
│ oidc|random|regulation|renovate|reviewdog|server|session|storage|
│ suites|templates|totp|utils|web
2021-01-30 08:29:07 +00:00
│
2022-09-16 04:21:05 +00:00
└─⫸ Commit Type: build|ci|docs|feat|fix|i18n|perf|refactor|release|revert|test
2021-01-30 08:29:07 +00:00
```
The `<type>` and `<summary>` fields are mandatory, the `(<scope>)` field is optional.
2022-06-15 07:51:47 +00:00
#### Allowed type values:
2021-01-30 08:29:07 +00:00
2022-06-15 07:51:47 +00:00
* __build__ Changes that affect the build system or external dependencies
2021-04-11 11:25:03 +00:00
(example scopes: bundler, deps, docker, go, npm)
2022-06-15 07:51:47 +00:00
* __ci__ Changes to our CI configuration files and scripts
2021-04-11 11:25:03 +00:00
(example scopes: autheliabot, buildkite, codecov, golangci-lint, renovate, reviewdog)
2022-06-15 07:51:47 +00:00
* __docs__ Documentation only changes
* __feat__ A new feature
* __fix__ A bug fix
2022-09-16 04:21:05 +00:00
* __i18n__ Updating translations or internationalization settings
2022-06-15 07:51:47 +00:00
* __perf__ A code change that improves performance
* __refactor__ A code change that neither fixes a bug nor adds a feature
* __release__ Releasing a new version of Authelia
* __test__ Adding missing tests or correcting existing tests
2021-01-30 08:29:07 +00:00
2022-06-15 07:51:47 +00:00
#### Allowed scope values:
2021-01-30 08:29:07 +00:00
2022-06-15 07:51:47 +00:00
The scope should be the name of the package affected (as perceived by the person reading the changelog generated from
commit messages).
2021-01-30 08:29:07 +00:00
* authentication
* authorization
* commands
* configuration
* duo
* handlers
* logging
2022-06-15 07:51:47 +00:00
* metrics
2021-01-30 08:29:07 +00:00
* middlewares
* mocks
2022-03-06 05:47:40 +00:00
* model
2021-01-30 08:29:07 +00:00
* notification
2022-02-03 03:04:24 +00:00
* ntp
2021-05-04 23:08:14 +00:00
* oidc
2023-01-12 10:57:44 +00:00
* random
2021-01-30 08:29:07 +00:00
* regulation
* server
* session
* storage
* suites
* templates
2021-12-01 12:11:29 +00:00
* totp
2021-01-30 08:29:07 +00:00
* utils
There are currently a few exceptions to the "use package name" rule:
* `api` : used for changes that change the openapi specification
2022-09-16 04:21:05 +00:00
* `cmd` : used for changes to the `authelia|authelia-gen|authelia-scripts|authelia-suites` top level binaries
2021-01-30 08:29:07 +00:00
* `web` : used for changes to the React based frontend
2022-06-15 07:51:47 +00:00
* none/empty string: useful for `test` , `refactor` and changes that are done across multiple packages
(e.g. `test: add missing unit tests` ) and for docs changes that are not related to a specific package
(e.g. `docs: fix typo in tutorial` ).
2021-01-30 08:29:07 +00:00
#### Summary
Use the summary field to provide a succinct description of the change:
* use the imperative, present tense: "change" not "changed" nor "changes"
* don't capitalize the first letter
* no dot (.) at the end
### Commit Message Body
Just as in the summary, use the imperative, present tense: "fix" not "fixed" nor "fixes".
2022-06-15 07:51:47 +00:00
Explain the motivation for the change in the commit message body. This commit message should explain *why* you are
making the change. You can include a comparison of the previous behavior with the new behavior in order to illustrate
2021-04-11 11:25:03 +00:00
the impact of the change.
2021-01-30 08:29:07 +00:00
### Commit Message Footer
2022-06-15 07:51:47 +00:00
The footer can contain information about breaking changes and is also the place to reference GitHub issues and other PRs
2021-04-11 11:25:03 +00:00
that this commit closes or is related to.
2021-01-30 08:29:07 +00:00
2022-06-15 07:51:47 +00:00
```text
2021-01-30 08:29:07 +00:00
BREAKING CHANGE: < breaking change summary >
< BLANK LINE >
< breaking change description + migration instructions >
< BLANK LINE >
< BLANK LINE >
Fixes #< issue number >
2023-04-26 02:48:15 +00:00
Signed-off-by: < AUTHOR >
2021-01-30 08:29:07 +00:00
```
2022-06-15 07:51:47 +00:00
Breaking Change section should start with the phrase "BREAKING CHANGE: " followed by a summary of the breaking change, a
2021-04-11 11:25:03 +00:00
blank line, and a detailed description of the breaking change that also includes migration instructions.
2021-01-30 08:29:07 +00:00
2023-04-26 02:48:15 +00:00
#### Developer Certificate of Origin
The footer *__MUST__* include the formal and conventional notation indicating the users acceptance of the
[Developer Certificate of Origin ](https://developercertificate.org/ ) as described by the following agreement:
```text
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
```
This can be achieved in the following ways:
- While making the commit use `git commit --signoff`
- To correct a single commit missing the sign off `git commit – -amend --signoff --no-edit`
- To correct multiple commits missing the sign off `git rebase --signoff HEAD~2` (i.e. with 2 commits that are missing the sign off)
This can be achieved by using `git commit --signoff` . A single previous commit can be signed using
`git commit – -amend --signoff --no-edit` . Multiple previous commits can be signed using `git rebase --signoff HEAD~2`
i.e. when 2 previous commits require the sign off.
2022-06-15 07:51:47 +00:00
### Revert Commits
2021-01-30 08:29:07 +00:00
2022-06-15 07:51:47 +00:00
If the commit reverts a previous commit, it should begin with `revert:` , followed by the header of the reverted commit.
2021-01-30 08:29:07 +00:00
The content of the commit message body should contain:
2022-06-15 07:51:47 +00:00
* information about the SHA of the commit being reverted in the following format: `This reverts commit <SHA>` ,
* a clear description of the reason for reverting the commit message.
2021-01-30 08:29:07 +00:00
2022-06-15 07:51:47 +00:00
## Commit Message Examples
2021-01-30 08:29:07 +00:00
```bash
fix(logging): disabled colored logging outputs when file is specified
In some scenarios if a user has a log_file_path specified and a TTY seems to be detected this causes terminal coloring outputs to be written to the file.
This in turn will cause issues when attempting to utilise the log with the provided fail2ban regexes.
We now override any TTY detection/logging treatments and disable coloring/removal of the timestamp when a user is utilising the text based logger to a file.
Fixes #1480 .
2023-04-26 02:48:15 +00:00
Signed-off-by: John Smith < jsmith @ org . com >
2021-01-30 08:29:07 +00:00
```
This document is based on [AngularJS Git Commit Message Format].
2022-06-15 07:51:47 +00:00
[AngularJS Git Commit Message Format]: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit