You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
: Optional: Output directory for the changelog fragment. Defaults to current directory.
40
40
41
+
`--owner <string?>`
42
+
: Optional: GitHub repository owner (used when `--pr` is just a number).
43
+
41
44
`--products <List<ProductInfo>>`
42
45
: Required: Products affected in format "product target lifecycle, ..." (for example, `"elasticsearch 9.2.0 ga, cloud-serverless 2025-08-05"`).
43
46
: The valid product identifiers are listed in [products.yml](https://github.com/elastic/docs-builder/blob/main/config/products.yml).
44
47
: The valid lifecycles are listed in [ChangelogConfiguration.cs](https://github.com/elastic/docs-builder/blob/main/src/services/Elastic.Documentation.Services/Changelog/ChangelogConfiguration.cs).
45
48
46
49
`--pr <string?>`
47
-
: Optional: Pull request number.
50
+
: Optional: Pull request URL or number (if `--owner` and `--repo` are provided).
51
+
: If specified, `--title` can be derived from the PR.
52
+
: If mappings are configured, `--areas` and `--type` can also be derived from the PR.
53
+
54
+
`--repo <string?>`
55
+
: Optional: GitHub repository name (used when `--pr` is just a number).
48
56
49
57
`--subtype <string?>`
50
58
: Optional: Subtype for breaking changes (for example, `api`, `behavioral`, or `configuration`).
51
59
: The valid subtypes are listed in [ChangelogConfiguration.cs](https://github.com/elastic/docs-builder/blob/main/src/services/Elastic.Documentation.Services/Changelog/ChangelogConfiguration.cs).
52
60
53
61
`--title <string>`
54
-
: Required: A short, user-facing title (max 80 characters)
62
+
: A short, user-facing title (max 80 characters)
63
+
: Required if `--pr` is not specified.
64
+
: If both `--pr` and `--title` are specified, the latter value is used instead of what exists in the PR.
55
65
56
66
`--type <string>`
57
67
: Required: Type of change (for example, `feature`, `enhancement`, `bug-fix`, or `breaking-change`).
--description <string?> Optional: Additional information about the change (max 600 characters) (Default: null)
36
-
--impact <string?> Optional: How the user's environment is affected (Default: null)
37
-
--action <string?> Optional: What users must do to mitigate (Default: null)
38
-
--feature-id <string?> Optional: Feature flag ID (Default: null)
39
-
--highlight <bool?> Optional: Include in release highlights (Default: null)
40
-
--output <string?> Optional: Output directory for the changelog fragment. Defaults to current directory (Default: null)
41
-
--config <string?> Optional: Path to the changelog.yml configuration file. Defaults to 'docs/changelog.yml' (Default: null)
28
+
--products <List<ProductInfo>> Required: Products affected in format "product target lifecycle, ..." (e.g., "elasticsearch 9.2.0 ga, cloud-serverless 2025-08-05") [Required]
29
+
--title <string?> Optional: A short, user-facing title (max 80 characters). Required if --pr is not specified. If --pr and --title are specified, the latter value is used instead of what exists in the PR. [Default: null]
30
+
--type <string?> Optional: Type of change (feature, enhancement, bug-fix, breaking-change, etc.). Required if --pr is not specified. If mappings are configured, type can be derived from the PR. [Default: null]
--pr <string?> Optional: Pull request URL or PR number (if --owner and --repo are provided). If specified, --title can be derived from the PR. If mappings are configured, --areas and --type can also be derived from the PR. [Default: null]
34
+
--owner <string?> Optional: GitHub repository owner (used when --pr is just a number) [Default: null]
35
+
--repo <string?> Optional: GitHub repository name (used when --pr is just a number) [Default: null]
--description <string?> Optional: Additional information about the change (max 600 characters) [Default: null]
38
+
--impact <string?> Optional: How the user's environment is affected [Default: null]
39
+
--action <string?> Optional: What users must do to mitigate [Default: null]
40
+
--feature-id <string?> Optional: Feature flag ID [Default: null]
41
+
--highlight <bool?> Optional: Include in release highlights [Default: null]
42
+
--output <string?> Optional: Output directory for the changelog fragment. Defaults to current directory [Default: null]
43
+
--config <string?> Optional: Path to the changelog.yml configuration file. Defaults to 'docs/changelog.yml' [Default: null]
42
44
```
43
45
44
46
### Product format
@@ -76,22 +78,32 @@ If a configuration file exists, the command validates all its values before gene
76
78
- 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.
77
79
- 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.
78
80
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
+
79
88
## Examples
80
89
90
+
### Multiple products
91
+
81
92
The following command creates a changelog for a bug fix that applies to two products:
82
93
83
94
```sh
84
95
docs-builder changelog add \
85
-
--title "Fixes enrich and lookup join resolution based on minimum transport version" \
1. The type values are defined in [ChangelogConfiguration.cs](https://github.com/elastic/docs-builder/blob/main/src/services/Elastic.Documentation.Services/Changelog/ChangelogConfiguration.cs).
93
-
2. The product values are defined in [products.yml](https://github.com/elastic/docs-builder/blob/main/config/products.yml).
94
-
3. At this time, the PR value can be a number or a URL; it is not validated.
103
+
1. This option is required only if you want to override what's derived from the PR title.
104
+
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).
105
+
3. The product values are defined in [products.yml](https://github.com/elastic/docs-builder/blob/main/config/products.yml).
106
+
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).
95
107
96
108
The output file has the following format:
97
109
@@ -107,3 +119,52 @@ title: Fixes enrich and lookup join resolution based on minimum transport versio
107
119
areas:
108
120
- ES|QL
109
121
```
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:
0 commit comments