Skip to content

Commit 6045e51

Browse files
authored
[DOCS] Edit changelog creation page (#3170)
1 parent f7641a5 commit 6045e51

6 files changed

Lines changed: 245 additions & 267 deletions

File tree

docs/cli/changelog/add.md

Lines changed: 84 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,7 @@ docs-builder changelog add [options...] [-h|--help]
3030

3131
`--no-extract-release-notes`
3232
: Optional: Turn off extraction of release notes from PR or issue descriptions.
33-
: The extractor looks for content in various formats in the PR or issue description:
34-
: - `Release Notes: ...`
35-
: - `Release-Notes: ...`
36-
: - `release notes: ...`
37-
: - `Release Note: ...`
38-
: - `Release Notes - ...`
39-
: - `## Release Note` (as a markdown header)
40-
: Matched release note text is used as the changelog description (only if `--description` is not explicitly provided). The changelog title is always taken from `--title` or from the PR or issue title, not from the release note section.
41-
: By default, the behavior is determined by the `extract.release_notes` changelog configuration setting.
33+
: By default, the behavior is determined by the [extract.release_notes](/contribute/configure-changelogs-ref.md#extract) changelog configuration setting.
4234

4335
`--feature-id <string?>`
4436
: Optional: Feature flag ID
@@ -76,8 +68,7 @@ docs-builder changelog add [options...] [-h|--help]
7668
: Products affected in format "product target lifecycle, ..." (for example, `"elasticsearch 9.2.0 ga, cloud-serverless 2025-08-05"`).
7769
: The valid product identifiers are listed in [products.yml](https://github.com/elastic/docs-builder/blob/main/config/products.yml).
7870
: The valid lifecycles are listed in [ChangelogConfiguration.cs](https://github.com/elastic/docs-builder/blob/main/src/services/Elastic.Documentation.Services/Changelog/ChangelogConfiguration.cs).
79-
: **Precedence when `--products` is not specified:** products are derived from PR/issue labels via `pivot.products` label mappings (if configured), then from `products.default` in `changelog.yml`, and finally inferred from the current git repository name. An error is raised if no products can be determined by any of these means.
80-
: Refer to [Products resolution](#products-resolution) in the how-to guide for full details.
71+
: For more information about the valid product and lifecycle values, go to [Product format](#product-format).
8172

8273
`--prs <string[]?>`
8374
: Optional: Pull request URLs or numbers (comma-separated), or a path to a newline-delimited file containing PR URLs or numbers. Can be specified multiple times.
@@ -123,10 +114,90 @@ docs-builder changelog add [options...] [-h|--help]
123114
: The valid types are listed in [ChangelogConfiguration.cs](https://github.com/elastic/docs-builder/blob/main/src/services/Elastic.Documentation.Services/Changelog/ChangelogConfiguration.cs).
124115

125116
`--use-pr-number`
126-
: Optional: Use PR numbers for filenames instead of the configured `filename` strategy. With both `--prs` (which creates one changelog per specified PR) and `--issues` (which creates one changelog per specified issue), each changelog filename will be derived from its PR numbers. Requires `--prs` or `--issues`. Mutually exclusive with `--use-issue-number`.
117+
: Optional: Use PR numbers for filenames instead of the configured `filename` strategy.
118+
: Requires `--prs` or `--issues`.
119+
: Mutually exclusive with `--use-issue-number`.
120+
: Refer to [](#filenames).
127121

128122
`--use-issue-number`
129-
: Optional: Use issue numbers for filenames instead of the configured `filename` strategy. With both `--prs` (which creates one changelog per specified PR) and `--issues` (which creates one changelog per specified issue), each changelog filename will be derived from its issues. Requires `--prs` or `--issues`. Mutually exclusive with `--use-pr-number`.
123+
: Optional: Use issue numbers for filenames instead of the configured `filename` strategy.
124+
: Requires `--prs` or `--issues`.
125+
: Mutually exclusive with `--use-pr-number`.
126+
: Refer to [](#filenames).
127+
128+
## Filenames
129+
130+
By default, output files are named according to the `filename` strategy in `changelog.yml`:
131+
132+
| Strategy | Example filename | Description |
133+
|---|---|---|
134+
| `timestamp` (default) | `1735689600-fixes-enrich-and-lookup-join-resolution.yaml` | Uses a Unix timestamp with a sanitized title slug. |
135+
| `pr` | `137431.yaml` | Uses the PR number. |
136+
| `issue` | `2571.yaml` | Uses the issue number. |
137+
138+
Refer to [changelog.example.yml](https://github.com/elastic/docs-builder/blob/main/config/changelog.example.yml) or [](/contribute/configure-changelogs-ref.md).
139+
140+
You can override those settings with the `--use-pr-number` or `--use-issue-number` CLI flags:
141+
142+
```sh
143+
docs-builder changelog add \
144+
--prs 1234 \
145+
--products "elasticsearch 9.2.3" \
146+
--use-pr-number
147+
148+
docs-builder changelog add \
149+
--issues 4567 \
150+
--products "elasticsearch 9.3.0" \
151+
--use-issue-number
152+
```
153+
154+
:::{important}
155+
`--use-pr-number` and `--use-issue-number` are mutually exclusive; specify only one. Each requires `--prs` or `--issues`. The numbers are extracted from the URLs or identifiers you provide or from linked references in the issue or PR body when extraction is enabled.
156+
157+
**Precedence**: CLI flags (`--use-pr-number` / `--use-issue-number`) > `filename` in `changelog.yml` > default (`timestamp`).
158+
:::
159+
160+
## Product format and resolution [product-format]
161+
162+
The `--products` command option accepts values with the format `"product target lifecycle, ..."` where:
163+
164+
- `product` is a product ID that exists in [products.yml](https://github.com/elastic/docs-builder/blob/main/config/products.yml) (required)
165+
- `target` is the target version or date (optional)
166+
- `lifecycle` exists in [Lifecycle.cs](https://github.com/elastic/docs-builder/blob/main/src/Elastic.Documentation/Lifecycle.cs) (optional)
167+
168+
You can further limit the possible values with the [products](/contribute/configure-changelogs-ref.md#products) and [lifecycles](/contribute/configure-changelogs-ref.md#lifecycles) options in the changelog configuration file.
169+
170+
For example:
171+
172+
- `"kibana 9.2.0 ga"`
173+
- `"cloud-serverless 2025-08-05"`
174+
- `"cloud-enterprise 4.0.3, cloud-hosted 2025-10-31"`
175+
176+
The `changelog add` command resolves product values in the following order:
177+
178+
1. The `--products` CLI option always takes priority.
179+
1. If `pivot.products` is defined in the changelog configuration file and the PR or issue has labels that match, those products are used. Multiple matching entries are all applied.
180+
1. If `products.default` is defined in the changelog configuration file, those default products are used.
181+
1. If `--repo` is specified (or `bundle.repo` is set in the changelog configuration file), the repository name is matched against known product IDs in `products.yml` and the derived value is used.
182+
183+
If none of these steps yield at least one product, the command returns an error.
184+
185+
## Configuration checks
186+
187+
By default, the command checks the following path for a configuration file: `docs/changelog.yml`.
188+
You can specify a different path with the `--config` command option.
189+
190+
If a configuration file exists, the command validates its values before generating changelog files:
191+
192+
- If the configuration file contains `lifecycles`, `products`, `subtype`, or `type` values that don't match the values in `ChangelogEntryType.cs`, `ChangelogEntrySubtype.cs`, or `Lifecycle.cs`, validation fails.
193+
- If the configuration file contains `areas` values and they don't match what you specify in the `--areas` command option, validation fails.
194+
- If the configuration file contains `lifecycles` or `products` values that are a subset of the available values and you try to create a changelog with values outside that subset, validation fails.
195+
196+
In each of these cases where validation fails, a changelog file is not created.
197+
198+
If the configuration file contains `rules.create` definitions and a PR or issue has a blocking label, that PR is skipped and no changelog file is created for it.
199+
For more information, refer to [Rules for creation and publishing](/contribute/configure-changelogs.md#rules).
200+
130201

131202
## CI auto-detection [ci-auto-detection]
132203

@@ -157,31 +228,3 @@ This allows the CI action to invoke `changelog add` with a minimal command line:
157228
```sh
158229
docs-builder changelog add --config docs/changelog.yml --output /tmp/staging --concise --strip-title-prefix
159230
```
160-
161-
## Products resolution [products-resolution]
162-
163-
When you run the `changelog add` command without the `--products` option, it resolves products in the following order:
164-
165-
1. **`--products` CLI option** — always takes priority.
166-
2. **`pivot.products` label mapping** — if `pivot.products` is configured and the PR or issue has labels that match, those products are used. Multiple matching entries are all applied.
167-
3. **`products.default` in `changelog.yml`** — the configured default products are used.
168-
4. **Repository name inference** — if `--repo` is specified (or `bundle.repo` is set in `changelog.yml`), the repository name is matched against known product IDs in `products.yml`.
169-
5. **Error** — if none of the above resolves to at least one product, an error is raised.
170-
171-
Product-specific `rules.create` rules are evaluated *after* products are resolved from labels, so label-derived products correctly participate in per-product create rule checks.
172-
173-
## Configuration checks
174-
175-
By default, the command checks the following path for a configuration file: `docs/changelog.yml`.
176-
You can specify a different path with the `--config` command option.
177-
178-
If a configuration file exists, the command validates its values before generating changelog files:
179-
180-
- If the configuration file contains `lifecycles`, `products`, `subtype`, or `type` values that don't match the values in `ChangelogEntryType.cs`, `ChangelogEntrySubtype.cs`, or `Lifecycle.cs`, validation fails.
181-
- If the configuration file contains `areas` values and they don't match what you specify in the `--areas` command option, validation fails.
182-
- If the configuration file contains `lifecycles` or `products` values that are a subset of the available values and you try to create a changelog with values outside that subset, validation fails.
183-
184-
In each of these cases where validation fails, a changelog file is not created.
185-
186-
If the configuration file contains `rules.create` definitions and a PR or issue has a blocking label, that PR is skipped and no changelog file is created for it.
187-
For more information, refer to [Rules for creation and publishing](/contribute/configure-changelogs.md#rules).

docs/cli/changelog/bundle.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ You must choose one method for determining what's in the bundle (`--all`, `--inp
9393

9494
`--input-products <List<ProductInfo>?>`
9595
: Filter by products in the format "product target lifecycle, ...".
96-
: For more information about the valid product and lifecycle values, go to [Product format](/contribute/create-changelogs.md#product-format).
96+
: For more information about the valid product and lifecycle values, go to [Product format](#product-format).
9797
: When specified, all three parts (product, target, lifecycle) are required but can be wildcards (`*`). Multiple comma-separated values are combined with OR: a changelog is included if it matches any of the specified product/target/lifecycle combinations. For example:
9898

9999
- `"cloud-serverless 2025-12-02 ga, cloud-serverless 2025-12-06 beta"` — include changelogs for either cloud-serverless 2025-12-02 ga or cloud-serverless 2025-12-06 beta
@@ -122,6 +122,7 @@ The `--input-products` option determines which changelog files are gathered for
122122
`--output-products <List<ProductInfo>?>`
123123
: Optional: Explicitly set the products array in the output file in format "product target lifecycle, ...".
124124
: This value replaces information that would otherwise be derived from changelogs.
125+
: For more information about the valid product and lifecycle values, go to [Product format](#product-format).
125126
: When `rules.bundle.products` per-product overrides are configured, `--output-products` also supplies the product IDs used to choose the **rule context product** (first alphabetically) for Mode 3. To use a different product's rules, run a separate bundle with only that product in `--output-products`. For details, refer to [Product-specific bundle rules](/contribute/configure-changelogs-ref.md#rules-bundle-products).
126127

127128
`--no-release-date`
@@ -211,6 +212,22 @@ If you specify a file path with a different extension (not `.yml` or `.yaml`), t
211212
Setting `bundle.directory` and `bundle.output_directory` in `changelog.yml` is recommended so you don't need to rely on running the command from a specific directory.
212213
:::
213214

215+
## Product format
216+
217+
The `changelog bundle` command has `--input-products` and `--output-products` options that accept values with the format `"product target lifecycle, ..."` where:
218+
219+
- `product` is the product ID from [products.yml](https://github.com/elastic/docs-builder/blob/main/config/products.yml) (required)
220+
- `target` is the target version or date (optional)
221+
- `lifecycle` exists in [Lifecycle.cs](https://github.com/elastic/docs-builder/blob/main/src/Elastic.Documentation/Lifecycle.cs) (optional)
222+
223+
You can further limit the possible values with the [products](/contribute/configure-changelogs-ref.md#products) and [lifecycles](/contribute/configure-changelogs-ref.md#lifecycles) options in the changelog configuration file.
224+
225+
For example:
226+
227+
- `"kibana 9.2.0 ga"`
228+
- `"cloud-serverless 2025-08-05"`
229+
- `"cloud-enterprise 4.0.3, cloud-hosted 2025-10-31"`
230+
214231
## Repository name in bundles [changelog-bundle-repo]
215232

216233
The repository name is stored in each bundle product entry to ensure that PR and issue links are generated correctly when the bundle is rendered.
@@ -439,6 +456,7 @@ If you're using profile-based commands, they're affected by the following fields
439456
: Not used when the filter comes from a promotion report, URL list file, or `source: github_release` — in those cases the PR or issue list determines what's included and `products` is ignored.
440457
: Supports `{version}` and `{lifecycle}` placeholders that are substituted at runtime.
441458
: Example: `"elasticsearch {version} {lifecycle}"`
459+
: Refer to [](#product-format).
442460

443461
:::{note}
444462
The `products` field determines which changelog files are gathered for consideration. **`rules.bundle` still applies** afterward (see the note under [`--input-products`](#options)). Input stage and bundle filtering stage are conceptually separate.
@@ -457,6 +475,7 @@ The `products` field determines which changelog files are gathered for considera
457475
: The `{lifecycle}` placeholder is substituted at runtime with the inferred lifecycle. For `source: github_release` profiles this comes from the release tag suffix. For standard profiles it comes from the version argument. Refer to [](#changelog-bundle-standard-profile-lifecycle) and [](#changelog-bundle-github-release-profile) for details.
458476
: If you omit lifecycle from the pattern (for example, `"elasticsearch {version}"`), the lifecycle field is omitted from the products array entirely.
459477
: Example: `"elasticsearch {version} {lifecycle}"` or `"elasticsearch {version} ga"` to hardcode GA regardless of tag.
478+
: Refer to [](#product-format).
460479

461480
`repo`
462481
: Optional. The GitHub repository name written to each product entry in the bundle. Used by the `{changelog}` directive to generate correct PR/issue links. Only needed when the product ID doesn't match the GitHub repository name. Overrides `bundle.repo` when set. Required when `source: github_release` is used and no `bundle.repo` default is set.
@@ -481,7 +500,7 @@ If your configuration file defines a standard profile (that is to say, not a Git
481500
| `9.2.0-alpha.1` | `preview` |
482501
| `9.2.0-preview.1` | `preview` |
483502

484-
For more information about acceptable product and lifecycle values, go to [Product format](/contribute/create-changelogs.md#product-format).
503+
For more information about acceptable product and lifecycle values, go to [Product format](#product-format).
485504

486505
You can invoke those profiles with commands like this:
487506

@@ -664,4 +683,4 @@ gh-release:
664683
```
665684

666685
By default all changelogs that match PRs in the GitHub release notes are included in the bundle.
667-
To apply additional filtering by the changelog type, areas, or products, add `rules.bundle` [filters](#changelog-bundle-rules).
686+
To apply additional filtering by the changelog type, areas, or products, add `rules.bundle` [filters](#changelog-bundle-rules).

docs/contribute/bundle-changelogs.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ docs-builder changelog bundle \
261261
--input-products "cloud-serverless 2025-12-02 ga, cloud-serverless 2025-12-06 beta" <1>
262262
```
263263

264-
1. Include all changelogs that have the `cloud-serverless` product identifier with target dates of either December 2 2025 (lifecycle `ga`) or December 6 2025 (lifecycle `beta`). For more information about product values, refer to [Product format](/contribute/create-changelogs.md#product-format).
264+
1. Include all changelogs that have the `cloud-serverless` product identifier with target dates of either December 2 2025 (lifecycle `ga`) or December 6 2025 (lifecycle `beta`). For more information about product values, refer to [Product format](/cli/changelog/bundle.md#product-format).
265265

266266
You can use wildcards in any of the three parts:
267267

@@ -594,3 +594,4 @@ docs-builder changelog remove --products "elasticsearch 9.3.0 *" --dry-run
594594
```
595595

596596
For full option details, go to [](/cli/changelog/remove.md).
597+

0 commit comments

Comments
 (0)