2020-10-30 17:08:52 -04:00
---
stage: none
group: unassigned
2020-11-26 01:09:20 -05:00
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
2020-10-30 17:08:52 -04:00
---
2017-02-02 15:19:39 -05:00
# Changelog entries
2016-10-25 08:09:46 -04:00
2017-02-02 15:19:39 -05:00
This guide contains instructions for when and how to generate a changelog entry
file, as well as information and history about our changelog process.
2016-10-25 08:09:46 -04:00
## Overview
2020-04-15 11:09:17 -04:00
Each bullet point, or **entry** , in our [`CHANGELOG.md` ](https://gitlab.com/gitlab-org/gitlab/blob/master/CHANGELOG.md ) file is
2020-06-10 08:08:58 -04:00
generated from a single data file in the [`changelogs/unreleased/` ](https://gitlab.com/gitlab-org/gitlab/tree/master/changelogs/unreleased/ ).
The file is expected to be a [YAML ](https://en.wikipedia.org/wiki/YAML ) file in the
2016-10-25 08:09:46 -04:00
following format:
```yaml
---
2018-01-18 03:32:26 -05:00
title: "Change[log]s"
2016-10-25 08:09:46 -04:00
merge_request: 1972
2020-06-18 08:09:25 -04:00
author: Black Sabbath @bsabbath
2017-05-20 16:49:55 -04:00
type: added
2016-10-25 08:09:46 -04:00
```
The `merge_request` value is a reference to a merge request that adds this
2020-06-18 08:09:25 -04:00
entry, and the `author` key (format: `<full name> <GitLab username>` ) is used to give attribution to community
2017-02-02 15:19:39 -05:00
contributors. **Both are optional** .
2017-05-20 16:49:55 -04:00
The `type` field maps the category of the change,
2018-04-23 00:09:48 -04:00
valid options are: added, fixed, changed, deprecated, removed, security, performance, other. **Type field is mandatory** .
2016-10-25 08:09:46 -04:00
2016-11-03 14:00:18 -04:00
Community contributors and core team members are encouraged to add their name to
2017-02-02 15:19:39 -05:00
the `author` field. GitLab team members **should not** .
2016-10-25 08:09:46 -04:00
2017-02-02 15:19:39 -05:00
## What warrants a changelog entry?
2019-12-16 10:07:39 -05:00
- Any change that introduces a database migration, whether it's regular, post,
2020-08-20 23:10:16 -04:00
or data migration, **must** have a changelog entry, even if it is behind a
2020-10-12 02:08:53 -04:00
disabled feature flag. Since the migration is executed on [GitLab FOSS ](https://gitlab.com/gitlab-org/gitlab-foss/ ),
2020-10-08 11:08:17 -04:00
the changelog for database schema changes should be written to the
`changelogs/unreleased/` directory, even when other elements of that change affect only GitLab EE.
2020-04-15 11:09:17 -04:00
- [Security fixes ](https://gitlab.com/gitlab-org/release/docs/blob/master/general/security/developer.md )
**must** have a changelog entry, without `merge_request` value
2020-01-28 19:08:58 -05:00
and with `type` set to `security` .
2020-10-22 20:08:30 -04:00
- Any user-facing change **must** have a changelog entry. This includes both visual changes (regardless of how minor), and changes to the rendered DOM which impact how a screen reader may announce the content.
2021-03-02 13:11:20 -05:00
- Any client-facing change to our REST and GraphQL APIs **must** have a changelog entry. See the [complete list what comprises a GraphQL breaking change ](api_graphql_styleguide.md#breaking-changes ).
2021-03-31 17:09:15 -04:00
- Any change that introduces an [Advanced Search migration ](elasticsearch.md#creating-a-new-advanced-search-migration ) **must** have a changelog entry.
2019-09-26 17:06:29 -04:00
- Performance improvements **should** have a changelog entry.
- _Any_ contribution from a community member, no matter how small, **may** have
a changelog entry regardless of these guidelines if the contributor wants one.
Example: "Fixed a typo on the search results page."
2019-08-26 04:18:32 -04:00
- Any docs-only changes **should not** have a changelog entry.
2021-05-10 05:10:28 -04:00
- For changes related to feature flags, use [feature flag guide ](feature_flags/index.md#changelog ) to determine the changelog entry.
2021-04-21 08:09:16 -04:00
- Any change that adds new Usage Data metrics, sets the status of existing ones to `removed` , and changes that need to be documented in Product Intelligence [Metrics Dictionary ](usage_ping/dictionary.md ) **should** have a changelog entry.
2020-11-03 16:09:12 -05:00
- A change that adds snowplow events **should** have a changelog entry -
2017-02-02 15:19:39 -05:00
- A fix for a regression introduced and then fixed in the same release (i.e.,
fixing a bug introduced during a monthly release candidate) **should not**
have a changelog entry.
- Any developer-facing change (e.g., refactoring, technical debt remediation,
test suite changes) **should not** have a changelog entry. Example: "Reduce
database records created during Cycle Analytics model spec."
## Writing good changelog entries
A good changelog entry should be descriptive and concise. It should explain the
change to a reader who has _zero context_ about the change. If you have trouble
making it both concise and descriptive, err on the side of descriptive.
- **Bad:** Go to a project order.
- **Good:** Show a user's starred projects at the top of the "Go to project"
dropdown.
2017-03-16 12:56:41 -04:00
The first example provides no context of where the change was made, or why, or
how it benefits the user.
2019-07-04 18:46:12 -04:00
- **Bad:** Copy (some text) to clipboard.
2017-02-02 15:19:39 -05:00
- **Good:** Update the "Copy to clipboard" tooltip to indicate what's being
copied.
2017-03-16 12:56:41 -04:00
Again, the first example is too vague and provides no context.
2017-02-02 15:19:39 -05:00
- **Bad:** Fixes and Improves CSS and HTML problems in mini pipeline graph and
builds dropdown.
- **Good:** Fix tooltips and hover states in mini pipeline graph and builds
dropdown.
2017-03-16 12:56:41 -04:00
The first example is too focused on implementation details. The user doesn't
care that we changed CSS and HTML, they care about the _end result_ of those
changes.
- **Bad:** Strip out `nil` s in the Array of Commit objects returned from
`find_commits_by_message_with_elastic`
2019-10-11 02:06:27 -04:00
- **Good:** Fix 500 errors caused by Elasticsearch results referencing
2017-03-16 12:56:41 -04:00
garbage-collected commits
The first example focuses on _how_ we fixed something, not on _what_ it fixes.
The rewritten version clearly describes the _end benefit_ to the user (fewer 500
2017-12-02 23:03:45 -05:00
errors), and _when_ (searching commits with Elasticsearch).
2017-03-16 12:56:41 -04:00
2017-02-02 15:19:39 -05:00
Use your best judgement and try to put yourself in the mindset of someone
reading the compiled changelog. Does this entry add value? Does it offer context
about _where_ and _why_ the change was made?
## How to generate a changelog entry
2016-10-25 08:09:46 -04:00
A `bin/changelog` script is available to generate the changelog entry file
automatically.
Its simplest usage is to provide the value for `title` :
2020-05-19 23:08:04 -04:00
```plaintext
2019-09-10 06:15:43 -04:00
bin/changelog 'Hey DZ, I added a feature to GitLab!'
2017-01-03 09:25:36 -05:00
```
2020-11-25 22:09:17 -05:00
If you want to generate a changelog entry for GitLab EE, you must pass
2019-09-17 10:16:34 -04:00
the `--ee` option:
2020-05-19 23:08:04 -04:00
```plaintext
2019-09-17 10:16:34 -04:00
bin/changelog --ee 'Hey DZ, I added a feature to GitLab!'
```
2020-08-26 05:10:16 -04:00
All entries in the `CHANGELOG.md` file apply to all editions of GitLab.
Changelog updates are based on a common [GitLab codebase ](https://gitlab.com/gitlab-org/gitlab/ ),
and are mirrored without proprietary code to [GitLab FOSS ](https://gitlab.com/gitlab-org/gitlab-foss/ ) (also known as GitLab Community Edition).
2017-05-20 16:49:55 -04:00
At this point the script would ask you to select the category of the change (mapped to the `type` field in the entry):
2020-05-19 23:08:04 -04:00
```plaintext
2017-05-20 16:49:55 -04:00
>> Please specify the category of your change:
1. New feature
2. Bug fix
3. Feature change
4. New deprecation
5. Feature removal
6. Security fix
2018-10-01 16:31:46 -04:00
7. Performance improvement
8. Other
2017-05-20 16:49:55 -04:00
```
2017-01-03 09:25:36 -05:00
The entry filename is based on the name of the current Git branch. If you run
2020-11-25 22:09:17 -05:00
the command above on a branch called `feature/hey-dz` , it generates a
2017-01-03 09:25:36 -05:00
`changelogs/unreleased/feature-hey-dz.yml` file.
2020-11-25 22:09:17 -05:00
The command outputs the path of the generated file and its contents:
2017-01-03 09:25:36 -05:00
2020-05-19 23:08:04 -04:00
```plaintext
2016-10-25 08:09:46 -04:00
create changelogs/unreleased/my-feature.yml
---
title: Hey DZ, I added a feature to GitLab!
merge_request:
author:
2017-05-20 16:49:55 -04:00
type:
2016-10-25 08:09:46 -04:00
```
2019-07-12 04:09:23 -04:00
2017-12-28 17:46:10 -05:00
### Arguments
2016-10-25 08:09:46 -04:00
2018-10-31 20:54:23 -04:00
| Argument | Shorthand | Purpose |
| ----------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------- |
2019-03-05 08:06:32 -05:00
| [`--amend` ](#--amend ) | | Amend the previous commit |
| [`--force` ](#--force-or--f ) | `-f` | Overwrite an existing entry |
| [`--merge-request` ](#--merge-request-or--m ) | `-m` | Set merge request ID |
| [`--dry-run` ](#--dry-run-or--n ) | `-n` | Don't actually write anything, just print |
| [`--git-username` ](#--git-username-or--u ) | `-u` | Use Git user.name configuration as the author |
| [`--type` ](#--type-or--t ) | `-t` | The category of the change, valid options are: `added` , `fixed` , `changed` , `deprecated` , `removed` , `security` , `performance` , `other` |
2021-02-12 10:08:43 -05:00
| [`--ee` ](#how-to-generate-a-changelog-entry ) | | Create an EE changelog
2019-03-05 08:06:32 -05:00
| `--help` | `-h` | Print help message |
2016-10-25 08:09:46 -04:00
2019-07-08 07:07:07 -04:00
#### `--amend`
2016-10-25 08:09:46 -04:00
You can pass the ** `--amend` ** argument to automatically stage the generated
file and amend it to the previous commit.
2020-11-25 22:09:17 -05:00
If you use ** `--amend` ** and don't provide a title, it uses
2016-10-25 08:09:46 -04:00
the "subject" of the previous commit, which is the first line of the commit
message:
2020-05-19 23:08:04 -04:00
```plaintext
2016-10-25 08:09:46 -04:00
$ git show --oneline
ab88683 Added an awesome new feature to GitLab
$ bin/changelog --amend
create changelogs/unreleased/feature-hey-dz.yml
---
title: Added an awesome new feature to GitLab
merge_request:
author:
2017-05-20 16:49:55 -04:00
type:
2016-10-25 08:09:46 -04:00
```
2019-07-08 07:07:07 -04:00
#### `--force` or `-f`
2016-11-02 18:15:20 -04:00
Use ** `--force` ** or ** `-f` ** to overwrite an existing changelog entry if it
already exists.
2020-05-19 23:08:04 -04:00
```plaintext
2016-11-02 18:15:20 -04:00
$ bin/changelog 'Hey DZ, I added a feature to GitLab!'
error changelogs/unreleased/feature-hey-dz.yml already exists! Use `--force` to overwrite.
$ bin/changelog 'Hey DZ, I added a feature to GitLab!' --force
create changelogs/unreleased/feature-hey-dz.yml
---
title: Hey DZ, I added a feature to GitLab!
merge_request: 1983
author:
2017-05-20 16:49:55 -04:00
type:
2016-11-02 18:15:20 -04:00
```
2019-07-08 07:07:07 -04:00
#### `--merge-request` or `-m`
2016-10-25 08:09:46 -04:00
Use the ** `--merge-request` ** or ** `-m` ** argument to provide the
`merge_request` value:
2020-05-19 23:08:04 -04:00
```plaintext
2016-11-02 11:16:19 -04:00
$ bin/changelog 'Hey DZ, I added a feature to GitLab!' -m 1983
2016-10-25 08:09:46 -04:00
create changelogs/unreleased/feature-hey-dz.yml
---
title: Hey DZ, I added a feature to GitLab!
merge_request: 1983
author:
2017-05-20 16:49:55 -04:00
type:
2016-10-25 08:09:46 -04:00
```
2019-07-08 07:07:07 -04:00
#### `--dry-run` or `-n`
2016-10-25 08:09:46 -04:00
Use the ** `--dry-run` ** or ** `-n` ** argument to prevent actually writing or
committing anything:
2020-05-19 23:08:04 -04:00
```plaintext
2016-10-25 08:09:46 -04:00
$ bin/changelog --amend --dry-run
create changelogs/unreleased/feature-hey-dz.yml
---
title: Added an awesome new feature to GitLab
merge_request:
author:
2017-05-20 16:49:55 -04:00
type:
2016-10-25 08:09:46 -04:00
$ ls changelogs/unreleased/
```
2019-07-08 07:07:07 -04:00
#### `--git-username` or `-u`
2016-10-25 08:09:46 -04:00
Use the ** `--git-username` ** or ** `-u` ** argument to automatically fill in the
`author` value with your configured Git `user.name` value:
2020-05-19 23:08:04 -04:00
```plaintext
2016-10-25 08:09:46 -04:00
$ git config user.name
Jane Doe
2017-01-03 09:25:36 -05:00
$ bin/changelog -u 'Hey DZ, I added a feature to GitLab!'
2016-10-25 08:09:46 -04:00
create changelogs/unreleased/feature-hey-dz.yml
---
title: Hey DZ, I added a feature to GitLab!
merge_request:
author: Jane Doe
2017-05-20 16:49:55 -04:00
type:
```
2019-07-08 07:07:07 -04:00
#### `--type` or `-t`
2017-05-20 16:49:55 -04:00
Use the ** `--type` ** or ** `-t` ** argument to provide the `type` value:
2020-05-19 23:08:04 -04:00
```plaintext
2017-05-20 16:49:55 -04:00
$ bin/changelog 'Hey DZ, I added a feature to GitLab!' -t added
create changelogs/unreleased/feature-hey-dz.yml
2021-02-12 10:08:43 -05:00
---
title: Hey DZ, I added a feature to GitLab!
merge_request:
author:
type: added
```
#### `--ee`
Use the ** `--ee` ** argument to create an EE changelog:
```plaintext
$ bin/changelog 'Hey DZ, I added a feature to GitLab!' -ee
create ee/changelogs/unreleased/feature-hey-dz.yml
2017-05-20 16:49:55 -04:00
---
title: Hey DZ, I added a feature to GitLab!
merge_request:
author:
type: added
2016-10-25 08:09:46 -04:00
```
2017-02-02 15:19:39 -05:00
### History and Reasoning
2016-10-25 08:09:46 -04:00
Our `CHANGELOG` file was previously updated manually by each contributor that
felt their change warranted an entry. When two merge requests added their own
entries at the same spot in the list, it created a merge conflict in one as soon
as the other was merged. When we had dozens of merge requests fighting for the
same changelog entry location, this quickly became a major source of merge
conflicts and delays in development.
2020-04-15 11:09:17 -04:00
This led us to a [boring solution ](https://about.gitlab.com/handbook/values/#boring-solutions ) of "add your entry in a random location in
2016-10-25 08:09:46 -04:00
the list." This actually worked pretty well as we got further along in each
monthly release cycle, but at the start of a new cycle, when a new version
section was added and there were fewer places to "randomly" add an entry, the
conflicts became a problem again until we had a sufficient number of entries.
2020-04-15 11:09:17 -04:00
On top of all this, it created an entirely different headache for
[release managers ](https://gitlab.com/gitlab-org/release/docs/blob/master/quickstart/release-manager.md )
2016-10-25 08:09:46 -04:00
when they cherry-picked a commit into a stable branch for a patch release. If
the commit included an entry in the `CHANGELOG` , it would include the entire
changelog for the latest version in `master` , so the release manager would have
to manually remove the later entries. They often would have had to do this
multiple times per patch release. This was compounded when we had to release
multiple patches at once due to a security issue.
2020-04-15 11:09:17 -04:00
We needed to automate all of this manual work. So we
2020-05-21 02:08:25 -04:00
[started brainstorming ](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/17826 ).
2016-10-25 08:09:46 -04:00
After much discussion we settled on the current solution of one file per entry,
and then compiling the entries into the overall `CHANGELOG.md` file during the
2020-04-15 11:09:17 -04:00
[release process ](https://gitlab.com/gitlab-org/release-tools ).
2016-10-25 08:09:46 -04:00
---
[Return to Development documentation ](README.md )