Skip to content

Commit 9e90723

Browse files
authored
Fix changelog bundle examples (#3359)
1 parent 39f40a4 commit 9e90723

2 files changed

Lines changed: 219 additions & 239 deletions

File tree

docs/cli/changelog/cmd-bundle.md

Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,217 @@ Set `bundle.link_allow_repos` in `changelog.yml` to an explicit list of `owner/r
136136
:::{important}
137137
`bundle.link_allow_repos` requires a **resolved** bundle. Set `bundle.resolve: true` or pass `--resolve`.
138138
:::
139+
140+
## Examples
141+
142+
### Bundle by GitHub release [changelog-bundle-release-version]
143+
144+
You can use `--release-version` to fetch pull request references directly from GitHub release notes and use them as the bundle filter.
145+
This is equivalent to building a PR list file manually and passing it with `--prs`, but without any file management.
146+
147+
:::{important}
148+
Only automated GitHub release notes (the default format or [Release Drafter](https://github.com/release-drafter/release-drafter) format) are supported at this time.
149+
:::
150+
151+
```sh
152+
docs-builder changelog bundle \
153+
--release-version v1.34.0 \ <1>
154+
--repo apm-agent-dotnet \ <2>
155+
--owner elastic <3>
156+
--output-products "apm-agent-dotnet 1.34.0 ga" <4>
157+
```
158+
159+
1. The tag value that is used in the `GET /repos/{owner}/{repo}/releases/tags/{tag}` releases API.
160+
2. You must specify `--repo` or set `bundle.repo` in the changelog configuration file.
161+
3. If you don't specify `--owner`, it uses `bundle.owner` in the changelog configuration or else defaults to `elastic`.
162+
4. The bundle's product metadata is inferred automatically from the release tag and repository name; you can override that behavior with the `--output-products` option.
163+
164+
:::{note}
165+
`--release-version` requires a `GITHUB_TOKEN` or `GH_TOKEN` environment variable (or an active `gh` login) to fetch release details from the GitHub API.
166+
:::
167+
168+
By default all changelogs that match PRs in the GitHub release notes are included in the bundle.
169+
To apply additional filtering by the changelog type, areas, or products, add [rules.bundle](/contribute/configure-changelogs-ref.md#rules-bundle) configuration settings.
170+
171+
:::{tip}
172+
If you are not creating changelogs when you create your pull requests, consider the `docs-builder changelog gh-release` command as a one-shot alternative to the `changelog add` and `changelog bundle` commands.
173+
It parses the release notes, creates one changelog file per pull request found, and creates a `changelog-bundle.yaml` file — all in a single step. Refer to [changelog gh-release](/cli/changelog/gh-release.md).
174+
:::
175+
176+
### Bundle by issues [changelog-bundle-issues]
177+
178+
You can use the `--issues` option to create a bundle of changelogs that relate to those GitHub issues.
179+
Issues can be identified by a full URL (such as `https://github.com/owner/repo/issues/123`), a short format (such as `owner/repo#123`), or just a number (in which case `--owner` and `--repo` are required — or set via `bundle.owner` and `bundle.repo` in the configuration).
180+
181+
```sh
182+
docs-builder changelog bundle --issues "12345,12346" \
183+
--repo elasticsearch \
184+
--owner elastic \
185+
--output-products "elasticsearch 9.2.2 ga"
186+
```
187+
188+
Alternatively, you can specify a path to a newline-delimited file that contains the issue URLS (for example, `--issues /path/to/file.txt`).
189+
In this case, you cannot use short URLs or numbers, each line must have a full URL.
190+
191+
By default all changelogs that match issues in the list are included in the bundle.
192+
To apply additional filtering by the changelog type, areas, or products, add [rules.bundle](/contribute/configure-changelogs-ref.md#rules-bundle) configuration settings.
193+
194+
### Bundle by pull requests [changelog-bundle-pr]
195+
196+
You can use the `--prs` option to create a bundle of the changelogs that relate to those pull requests.
197+
198+
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.
199+
200+
```sh
201+
docs-builder changelog bundle --prs "108875,135873,136886" \ <1>
202+
--repo elasticsearch \ <2>
203+
--owner elastic \ <3>
204+
--output-products "elasticsearch 9.2.2 ga" <4>
205+
```
206+
207+
1. The comma-separated list of pull request numbers to seek.
208+
2. The repository in the pull request URLs. Not required when using full PR URLs, or when `bundle.repo` is set in the changelog configuration.
209+
3. The owner in the pull request URLs. Not required when using full PR URLs, or when `bundle.owner` is set in the changelog configuration.
210+
4. The product metadata for the bundle. If it is not provided, it will be derived from all the changelog product values.
211+
212+
Alternatively, you can specify a path to a newline-delimited file that contains the PR URLS (for example, `--prs /path/to/file.txt`).
213+
In this case, you cannot use short URLs or numbers, each line must have a full URL.
214+
For example:
215+
216+
```txt
217+
https://github.com/elastic/elasticsearch/pull/108875
218+
https://github.com/elastic/elasticsearch/pull/135873
219+
https://github.com/elastic/elasticsearch/pull/136886
220+
https://github.com/elastic/elasticsearch/pull/137126
221+
```
222+
223+
By default all changelogs that match PRs in the list are included in the bundle.
224+
To apply additional filtering by the changelog type, areas, or products, add [rules.bundle](/contribute/configure-changelogs-ref.md#rules-bundle) configuration settings.
225+
226+
If you have changelog files that reference those pull requests, the command creates a file like this:
227+
228+
```yaml
229+
products:
230+
- product: elasticsearch
231+
target: 9.2.2
232+
lifecycle: ga
233+
entries:
234+
- file:
235+
name: 1765507819-fix-ml-calendar-event-update-scalability-issues.yaml
236+
checksum: 069b59edb14594e0bc3b70365e81626bde730ab7
237+
- file:
238+
name: 1765507798-convert-bytestransportresponse-when-proxying-respo.yaml
239+
checksum: c6dbd4730bf34dbbc877c16c042e6578dd108b62
240+
- file:
241+
name: 1765507839-use-ivf_pq-for-gpu-index-build-for-large-datasets.yaml
242+
checksum: 451d60283fe5df426f023e824339f82c2900311e
243+
```
244+
245+
### Bundle by product [changelog-bundle-product]
246+
247+
You can use the `--input-products` option to create a bundle of changelogs that match the product details.
248+
When using `--input-products`, you must provide all three parts: product, target, and lifecycle.
249+
Each part can be a wildcard (`*`) to match any value.
250+
251+
:::{tip}
252+
If you use profile-based bundling, provide this information in the `bundle.profiles.<name>.products` field.
253+
:::
254+
255+
```sh
256+
docs-builder changelog bundle \
257+
--input-products "cloud-serverless 2025-12-02 ga, cloud-serverless 2025-12-06 beta" <1>
258+
```
259+
260+
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).
261+
262+
You can use wildcards in any of the three parts:
263+
264+
```sh
265+
# Bundle any changelogs that have exact matches for either of these clauses
266+
docs-builder changelog bundle --input-products "cloud-serverless 2025-12-02 ga, elasticsearch 9.3.0 beta"
267+
268+
# Bundle all elasticsearch changelogs regardless of target or lifecycle
269+
docs-builder changelog bundle --input-products "elasticsearch * *"
270+
271+
# Bundle all cloud-serverless 2025-12-02 changelogs with any lifecycle
272+
docs-builder changelog bundle --input-products "cloud-serverless 2025-12-02 *"
273+
274+
# Bundle any cloud-serverless changelogs with target starting with "2025-11-" and "ga" lifecycle
275+
docs-builder changelog bundle --input-products "cloud-serverless 2025-11-* ga"
276+
277+
# Bundle all changelogs (equivalent to --all)
278+
docs-builder changelog bundle --input-products "* * *"
279+
```
280+
281+
If you have changelog files that reference those product details, the command creates a file like this:
282+
283+
```yaml
284+
products: <1>
285+
- product: cloud-serverless
286+
target: 2025-12-02
287+
- product: cloud-serverless
288+
target: 2025-12-06
289+
entries:
290+
- file:
291+
name: 1765495972-fixes-enrich-and-lookup-join-resolution-based-on-m.yaml
292+
checksum: 6c3243f56279b1797b5dfff6c02ebf90b9658464
293+
- file:
294+
name: 1765507778-break-on-fielddata-when-building-global-ordinals.yaml
295+
checksum: 70d197d96752c05b6595edffe6fe3ba3d055c845
296+
```
297+
298+
1. By default these values match your `--input-products` (even if the changelogs have more products).
299+
To specify different product metadata, use the `--output-products` option.
300+
301+
:::{note}
302+
When a changelog matches multiple `--input-products` filters, it appears only once in the bundle. This deduplication applies even when using `--all` or `--prs`.
303+
:::
304+
305+
### Bundle by report
306+
307+
You can use `--report` to filter by a promotion report:
308+
309+
```sh
310+
# Extract PRs from a downloaded report and use them as the filter
311+
docs-builder changelog bundle \
312+
--report ./promotion-report.html \
313+
--directory ./docs/changelog \
314+
--output ./docs/releases/bundle.yaml
315+
```
316+
317+
By default all changelogs that match PRs in the promotion report are included in the bundle.
318+
To apply additional filtering by the changelog type, areas, or products, add [rules.bundle](/contribute/configure-changelogs-ref.md#rules-bundle) configuration settings.
319+
320+
### Hide features [changelog-bundle-hide-features]
321+
322+
You can use the `--hide-features` option to embed feature IDs that should be hidden when the bundle is rendered. This is useful for features that are not yet ready for public documentation.
323+
324+
```sh
325+
docs-builder changelog bundle \
326+
--input-products "elasticsearch 9.3.0 *" \
327+
--hide-features "feature:hidden-api,feature:experimental" \ <1>
328+
--output /path/to/bundles/9.3.0.yaml
329+
```
330+
331+
1. Feature IDs to hide. Changelogs with matching `feature-id` values will be commented out when rendered.
332+
333+
The bundle output will include a `hide-features` field:
334+
335+
```yaml
336+
products:
337+
- product: elasticsearch
338+
target: 9.3.0
339+
hide-features:
340+
- feature:hidden-api
341+
- feature:experimental
342+
entries:
343+
- file:
344+
name: 1765495972-new-feature.yaml
345+
checksum: 6c3243f56279b1797b5dfff6c02ebf90b9658464
346+
```
347+
348+
When this bundle is rendered (either via the `changelog render` command or the `{changelog}` directive), changelogs with `feature-id` values matching any of the listed features will be commented out in the output.
349+
350+
:::{note}
351+
The `--hide-features` option on the `render` command and the `hide-features` field in bundles are **combined**. If you specify `--hide-features` on both the `bundle` and `render` commands, all specified features are hidden. The `{changelog}` directive automatically reads `hide-features` from all loaded bundles and applies them.
352+
:::

0 commit comments

Comments
 (0)