Skip to content

Commit b4a67cb

Browse files
committed
Edit docs
1 parent 21edffa commit b4a67cb

File tree

1 file changed

+112
-143
lines changed

1 file changed

+112
-143
lines changed

docs/contribute/changelog.md

Lines changed: 112 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# Create and bundle changelogs
22

3-
The `docs-builder changelog add` command creates a new changelog file from command-line input.
4-
The `docs-builder changelog bundle` command creates a consolidated list of changelogs.
5-
63
By adding a file for each notable change and grouping them into bundles, you can ultimately generate release documention with a consistent layout for all your products.
74

5+
1. Create changelogs with the `docs-builder changelog add` command.
6+
2. [Create changelog bundles](#changelog-bundle) with the `docs-builder changelog bundle` command. For example, create a bundle for the pull requests that are included in a product release.
7+
8+
For more information about running `docs-builder`, go to [Contribute locally](https://www.elastic.co/docs/contribute-docs/locally).
9+
810
:::{note}
911
This command is associated with an ongoing release docs initiative.
1012
Additional workflows are still to come for updating and generating documentation from changelogs.
@@ -45,24 +47,6 @@ Options:
4547
--config <string?> Optional: Path to the changelog.yml configuration file. Defaults to 'docs/changelog.yml' [Default: null]
4648
```
4749
48-
The `changelog bundle` command creates a single YAML bundle file and supports all of the following options:
49-
50-
```sh
51-
Bundle changelogs
52-
53-
Options:
54-
--directory <string?> Optional: Directory containing changelog YAML files. Defaults to current directory [Default: null]
55-
--output <string?> Optional: Output file path for the bundled changelog. Defaults to 'changelog-bundle.yaml' in the input directory [Default: null]
56-
--all Include all changelogs in the directory
57-
--input-products <List<ProductInfo>?> Filter by products in format "product target lifecycle, ..." (e.g., "cloud-serverless 2025-12-02, cloud-serverless 2025-12-06") [Default: null]
58-
--output-products <List<ProductInfo>?> Explicitly set the products array in the output file in format "product target lifecycle, ...". Overrides any values from changelogs. [Default: null]
59-
--resolve Copy the contents of each changelog file into the entries array
60-
--prs <string[]?> Filter by pull request URLs or numbers (can specify multiple times) [Default: null]
61-
--prs-file <string?> Path to a newline-delimited file containing PR URLs or numbers [Default: null]
62-
--owner <string?> Optional: GitHub repository owner (used when PRs are specified as numbers) [Default: null]
63-
--repo <string?> Optional: GitHub repository name (used when PRs are specified as numbers) [Default: null]
64-
```
65-
6650
### Product format
6751
6852
The `docs-builder changelog add` has a `--products` option and the `docs-builder changelog bundle` has `--input-products` and `--output-products` options that all use the same format.
@@ -107,43 +91,28 @@ When you run the command with the `--pr` option, it can use these mappings to fi
10791
10892
Refer to [changelog.yml.example](https://github.com/elastic/docs-builder/blob/main/config/changelog.yml.example).
10993
110-
## Bundle creation
94+
## Create bundles [changelog-bundle]
11195
11296
You can use the `docs-builder changelog bundle` command to create a YAML file that lists multiple changelogs.
113-
By default, the file contains only the changelog file names and checksums.
114-
For example:
115-
116-
```yaml
117-
products:
118-
- product: elasticsearch
119-
target: 9.2.2
120-
entries:
121-
- file:
122-
name: 1765507819-fix-ml-calendar-event-update-scalability-issues.yaml
123-
checksum: 069b59edb14594e0bc3b70365e81626bde730ab7
124-
```
97+
For up-to-date details, use the `-h` option:
12598
126-
You can optionally use the `--resolve` command option to pull all of the content from each changelog into the bundle.
127-
For example:
99+
```sh
100+
Bundle changelogs
128101
129-
```yaml
130-
products:
131-
- product: elasticsearch
132-
target: 9.2.2
133-
entries:
134-
- file:
135-
name: 1765507819-fix-ml-calendar-event-update-scalability-issues.yaml
136-
checksum: 069b59edb14594e0bc3b70365e81626bde730ab7
137-
type: bug-fix
138-
title: Fix ML calendar event update scalability issues
139-
products:
140-
- product: elasticsearch
141-
areas:
142-
- Machine Learning
143-
pr: https://github.com/elastic/elasticsearch/pull/136886
102+
Options:
103+
--directory <string?> Optional: Directory containing changelog YAML files. Defaults to current directory [Default: null]
104+
--output <string?> Optional: Output file path for the bundled changelog. Defaults to 'changelog-bundle.yaml' in the input directory [Default: null]
105+
--all Include all changelogs in the directory
106+
--input-products <List<ProductInfo>?> Filter by products in format "product target lifecycle, ..." (e.g., "cloud-serverless 2025-12-02, cloud-serverless 2025-12-06") [Default: null]
107+
--output-products <List<ProductInfo>?> Explicitly set the products array in the output file in format "product target lifecycle, ...". Overrides any values from changelogs. [Default: null]
108+
--resolve Copy the contents of each changelog file into the entries array
109+
--prs <string[]?> Filter by pull request URLs or numbers (can specify multiple times) [Default: null]
110+
--prs-file <string?> Path to a newline-delimited file containing PR URLs or numbers [Default: null]
111+
--owner <string?> Optional: GitHub repository owner (used when PRs are specified as numbers) [Default: null]
112+
--repo <string?> Optional: GitHub repository name (used when PRs are specified as numbers) [Default: null]
144113
```
145114
146-
When you run the `docs-builder changelog bundle` command, you can specify only one of the following filter options:
115+
You can specify only one of the following filter options:
147116
148117
`--all`
149118
: Include all changelogs from the directory.
@@ -161,93 +130,10 @@ When you run the `docs-builder changelog bundle` command, you can specify only o
161130
: Include changelogs for the pull request URLs or numbers specified in a newline-delimited file.
162131
: Pull requests can be identified by a full URL (such as `https://github.com/owner/repo/pull/123`, a short format (such as `owner/repo#123`) or just a number (in which case you must also provide `--owner` and `--repo` options).
163132
164-
## Examples
165-
166-
### Create a changelog for multiple products
167-
168-
The following command creates a changelog for a bug fix that applies to two products:
169-
170-
```sh
171-
docs-builder changelog add \
172-
--title "Fixes enrich and lookup join resolution based on minimum transport version" \ <1>
173-
--type bug-fix \ <2>
174-
--products "elasticsearch 9.2.3, cloud-serverless 2025-12-02" \ <3>
175-
--areas "ES|QL"
176-
--pr "https://github.com/elastic/elasticsearch/pull/137431" <4>
177-
```
178-
179-
1. This option is required only if you want to override what's derived from the PR title.
180-
2. The type values are defined in [ChangelogConfiguration.cs](https://github.com/elastic/docs-builder/blob/main/src/services/Elastic.Documentation.Services/Changelog/ChangelogConfiguration.cs).
181-
3. The product values are defined in [products.yml](https://github.com/elastic/docs-builder/blob/main/config/products.yml).
182-
4. The `--pr` value can be a full URL (such as `https://github.com/owner/repo/pull/123`, a short format (such as `owner/repo#123`) or just a number (in which case you must also provide `--owner` and `--repo` options).
183-
184-
The output file has the following format:
185-
186-
```yaml
187-
pr: https://github.com/elastic/elasticsearch/pull/137431
188-
type: bug-fix
189-
products:
190-
- product: elasticsearch
191-
target: 9.2.3
192-
- product: cloud-serverless
193-
target: 2025-12-02
194-
title: Fixes enrich and lookup join resolution based on minimum transport version
195-
areas:
196-
- ES|QL
197-
```
198-
199-
### Create a changelog with PR label mappings
200-
201-
You can update your changelog configuration file to contain GitHub label mappings, for example:
202-
203-
```yaml
204-
# Available areas (optional - if not specified, all areas are allowed)
205-
available_areas:
206-
- search
207-
- security
208-
- machine-learning
209-
- observability
210-
- index-management
211-
- ES|QL
212-
# Add more areas as needed
213-
214-
# GitHub label mappings (optional - used when --pr option is specified)
215-
# Maps GitHub PR labels to changelog type values
216-
# When a PR has a label that matches a key, the corresponding type value is used
217-
label_to_type:
218-
# Example mappings - customize based on your label naming conventions
219-
">enhancement": enhancement
220-
">breaking": breaking-change
221-
222-
# Maps GitHub PR labels to changelog area values
223-
# Multiple labels can map to the same area, and a single label can map to multiple areas (comma-separated)
224-
label_to_areas:
225-
# Example mappings - customize based on your label naming conventions
226-
":Search Relevance/ES|QL": "ES|QL"
227-
```
228-
229-
When you use the `--pr` option to derive information from a pull request, it can make use of those mappings:
230-
231-
```sh
232-
docs-builder changelog add \
233-
--pr https://github.com/elastic/elasticsearch/pull/139272 \
234-
--products "elasticsearch 9.3.0" --config test/changelog.yml
235-
```
236-
237-
In this case, the changelog file derives the title, type, and areas:
238-
239-
```yaml
240-
pr: https://github.com/elastic/elasticsearch/pull/139272
241-
type: enhancement
242-
products:
243-
- product: elasticsearch
244-
target: 9.3.0
245-
areas:
246-
- ES|QL
247-
title: '[ES|QL] Take TOP_SNIPPETS out of snapshot'
248-
```
133+
By default, the output file contains only the changelog file names and checksums.
134+
You can optionally use the `--resolve` command option to pull all of the content from each changelog into the bundle.
249135
250-
### Create a changelog bundle by product
136+
### Filter by product [changelog-bundle-product]
251137
252138
You can use the `--input-products` option to create a bundle of changelogs that match the product details:
253139
@@ -278,9 +164,8 @@ entries:
278164
1. By default these values match your `--input-products` (even if the changelogs have more products). To specify different product metadata, use the `--output-products` option.
279165
280166
If you add the `--resolve` option, the contents of each changelog will be included in the output file.
281-
Refer to [](#bundle-creation).
282167
283-
### Create a changelog bundle by PR list
168+
### Filter by pull requests [changelog-bundle-pr]
284169
285170
You can use the `--prs` option (with the `--repo` and `--owner` options if you provide only the PR numbers) to create a bundle of the changelogs that relate to those pull requests:
286171
@@ -315,10 +200,8 @@ entries:
315200
```
316201
317202
If you add the `--resolve` option, the contents of each changelog will be included in the output file.
318-
Refer to [](#bundle-creation).
319-
320203
321-
### Create a changelog bundle by PR file
204+
### Filter by pull request file [changelog-bundle-file]
322205
323206
If you have a file that lists pull requests (such as PRs associated with a GitHub release):
324207
@@ -360,3 +243,89 @@ entries:
360243
pr: https://github.com/elastic/elasticsearch/pull/108875
361244
...
362245
```
246+
247+
## Examples
248+
249+
### Create a changelog for multiple products
250+
251+
The following command creates a changelog for a bug fix that applies to two products:
252+
253+
```sh
254+
docs-builder changelog add \
255+
--title "Fixes enrich and lookup join resolution based on minimum transport version" \ <1>
256+
--type bug-fix \ <2>
257+
--products "elasticsearch 9.2.3, cloud-serverless 2025-12-02" \ <3>
258+
--areas "ES|QL"
259+
--pr "https://github.com/elastic/elasticsearch/pull/137431" <4>
260+
```
261+
262+
1. This option is required only if you want to override what's derived from the PR title.
263+
2. The type values are defined in [ChangelogConfiguration.cs](https://github.com/elastic/docs-builder/blob/main/src/services/Elastic.Documentation.Services/Changelog/ChangelogConfiguration.cs).
264+
3. The product values are defined in [products.yml](https://github.com/elastic/docs-builder/blob/main/config/products.yml).
265+
4. The `--pr` value can be a full URL (such as `https://github.com/owner/repo/pull/123`, a short format (such as `owner/repo#123`) or just a number (in which case you must also provide `--owner` and `--repo` options).
266+
267+
The output file has the following format:
268+
269+
```yaml
270+
pr: https://github.com/elastic/elasticsearch/pull/137431
271+
type: bug-fix
272+
products:
273+
- product: elasticsearch
274+
target: 9.2.3
275+
- product: cloud-serverless
276+
target: 2025-12-02
277+
title: Fixes enrich and lookup join resolution based on minimum transport version
278+
areas:
279+
- ES|QL
280+
```
281+
282+
### Create a changelog with PR label mappings
283+
284+
You can update your changelog configuration file to contain GitHub label mappings, for example:
285+
286+
```yaml
287+
# Available areas (optional - if not specified, all areas are allowed)
288+
available_areas:
289+
- search
290+
- security
291+
- machine-learning
292+
- observability
293+
- index-management
294+
- ES|QL
295+
# Add more areas as needed
296+
297+
# GitHub label mappings (optional - used when --pr option is specified)
298+
# Maps GitHub PR labels to changelog type values
299+
# When a PR has a label that matches a key, the corresponding type value is used
300+
label_to_type:
301+
# Example mappings - customize based on your label naming conventions
302+
">enhancement": enhancement
303+
">breaking": breaking-change
304+
305+
# Maps GitHub PR labels to changelog area values
306+
# Multiple labels can map to the same area, and a single label can map to multiple areas (comma-separated)
307+
label_to_areas:
308+
# Example mappings - customize based on your label naming conventions
309+
":Search Relevance/ES|QL": "ES|QL"
310+
```
311+
312+
When you use the `--pr` option to derive information from a pull request, it can make use of those mappings:
313+
314+
```sh
315+
docs-builder changelog add \
316+
--pr https://github.com/elastic/elasticsearch/pull/139272 \
317+
--products "elasticsearch 9.3.0" --config test/changelog.yml
318+
```
319+
320+
In this case, the changelog file derives the title, type, and areas:
321+
322+
```yaml
323+
pr: https://github.com/elastic/elasticsearch/pull/139272
324+
type: enhancement
325+
products:
326+
- product: elasticsearch
327+
target: 9.3.0
328+
areas:
329+
- ES|QL
330+
title: '[ES|QL] Take TOP_SNIPPETS out of snapshot'
331+
```

0 commit comments

Comments
 (0)