Skip to content

Commit 9a5ce26

Browse files
committed
Add more doc examples
1 parent 31b22c9 commit 9a5ce26

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

docs/contribute/changelog.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,17 @@ If a configuration file exists, the command validates all its values before gene
7878
- If the configuration file contains `lifecycle`, `product`, `subtype`, or `type` values that don't match the values in `products.yml` and `ChangelogConfiguration.cs`, validation fails. The changelog file is not created.
7979
- If the configuration file contains `areas` values and they don't match what you specify in the `--areas` command option, validation fails. The changelog file is not created.
8080
81+
### GitHub label mappings
82+
83+
You can optionally add `label_to_type` and `label_to_areas` mappings in your changelog configuration.
84+
When you run the command with the `--pr` option, it can use these mappings to fill in the `type` and `areas` in your changelog based on your pull request labels.
85+
86+
Refer to [changelog.yml.example](https://github.com/elastic/docs-builder/blob/main/config/changelog.yml.example).
87+
8188
## Examples
8289
90+
### Multiple products
91+
8392
The following command creates a changelog for a bug fix that applies to two products:
8493
8594
```sh
@@ -110,3 +119,52 @@ title: Fixes enrich and lookup join resolution based on minimum transport versio
110119
areas:
111120
- ES|QL
112121
```
122+
123+
### PR label mappings
124+
125+
You can update your changelog configuration file to contain GitHub label mappings, for example:
126+
127+
```yaml
128+
# Available areas (optional - if not specified, all areas are allowed)
129+
available_areas:
130+
- search
131+
- security
132+
- machine-learning
133+
- observability
134+
- index-management
135+
- ES|QL
136+
# Add more areas as needed
137+
138+
# GitHub label mappings (optional - used when --pr option is specified)
139+
# Maps GitHub PR labels to changelog type values
140+
# When a PR has a label that matches a key, the corresponding type value is used
141+
label_to_type:
142+
# Example mappings - customize based on your label naming conventions
143+
">enhancement": enhancement
144+
">breaking": breaking-change
145+
146+
# Maps GitHub PR labels to changelog area values
147+
# Multiple labels can map to the same area, and a single label can map to multiple areas (comma-separated)
148+
label_to_areas:
149+
# Example mappings - customize based on your label naming conventions
150+
":Search Relevance/ES|QL": "ES|QL"
151+
```
152+
153+
When you use the `--pr` option to derive information from a pull request, it can make use of those mappings:
154+
155+
```sh
156+
docs-builder changelog add --pr https://github.com/elastic/elasticsearch/pull/139272 --products "elasticsearch 9.3.0" --config test/changelog.yml
157+
```
158+
159+
In this case, the changelog file derives the title, type, and areas:
160+
161+
```yaml
162+
pr: https://github.com/elastic/elasticsearch/pull/139272
163+
type: enhancement
164+
products:
165+
- product: elasticsearch
166+
target: 9.3.0
167+
areas:
168+
- ES|QL
169+
title: '[ES|QL] Take TOP_SNIPPETS out of snapshot'
170+
```

0 commit comments

Comments
 (0)