Skip to content

Commit 8ca38c4

Browse files
lcawlMpdreamz
authored andcommitted
Edit changelog bundle docs (#3213)
1 parent 5307c31 commit 8ca38c4

10 files changed

Lines changed: 671 additions & 913 deletions

File tree

config/changelog.example.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ pivot:
151151
# - Comma-separated string: "value1, value2, value3"
152152
# - YAML list: [value1, value2, value3]
153153
#
154-
# For details and examples, refer to the [rules documentation](https://github.com/elastic/docs-builder/blob/main/docs/contribute/configure-changelogs.md#rules).
154+
# For details and examples, refer to the [rules documentation](https://github.com/elastic/docs-builder/blob/main/docs/contribute/configure-changelogs-ref.md#rules).
155155
rules:
156156
# match: any
157157

docs/cli/changelog/add.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ docs-builder changelog add [options...] [-h|--help]
8888
: Mutually exclusive with `--prs`, `--issues`, and `--release-version`.
8989
: For a plain newline-delimited list of fully-qualified PR URLs, use `--prs` with a file path instead of `--report`.
9090
: When the value is an `https://` URL, only hosts allowed by the parser (such as `github.com` and `buildkite.com`) are supported, and the CLI needs network access to fetch the report.
91+
9192
`--release-version <string?>`
9293
: Optional: GitHub release tag to use as a source of pull requests (for example, `"v9.2.0"` or `"latest"`).
9394
: When specified, the command fetches the release from GitHub, parses PR references from the release notes, and creates one changelog file per PR — without creating a bundle. Only automated GitHub release notes (the default format or [Release Drafter](https://github.com/release-drafter/release-drafter) format) are supported at this time.
@@ -207,7 +208,7 @@ If a configuration file exists, the command validates its values before generati
207208
In each of these cases where validation fails, a changelog file is not created.
208209

209210
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.
210-
For more information, refer to [Rules for creation and publishing](/contribute/configure-changelogs.md#rules).
211+
For more information, refer to [](/contribute/create-changelogs.md#rules).
211212

212213
## CI auto-detection [ci-auto-detection]
213214

docs/cli/changelog/bundle.md

Lines changed: 224 additions & 299 deletions
Large diffs are not rendered by default.

docs/cli/changelog/gh-release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ The product, target version, and lifecycle are inferred automatically from the r
6464
## Configuration
6565

6666
The `rules.bundle` section of your `changelog.yml` applies to bundles created by this command (after changelog files are gathered from the release).
67-
For details, refer to [Rules for filtered bundles](/cli/changelog/bundle.md#changelog-bundle-rules).
67+
For details, refer to [](/contribute/configure-changelogs-ref.md#rules-bundle).
6868

6969
## Examples
7070

docs/cli/changelog/remove.md

Lines changed: 11 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,16 @@ Setting `bundle.directory` and `bundle.output_directory` in `changelog.yml` is r
142142

143143
## Option-based examples
144144

145+
You can remove changelogs based on their issues, pull requests, product metadata, or remove all changelogs from a folder.
146+
Exactly one filter option must be specified: `--all`, `--products`, `--prs`, `--issues`, `--release-version` or `--report`.
147+
When using a file for `--prs` or `--issues`, every line must be a fully-qualified GitHub URL.
148+
149+
For example:
150+
151+
```sh
152+
docs-builder changelog remove --products "elasticsearch 9.3.0 *" --dry-run
153+
```
154+
145155
### Remove by GitHub release [changelog-remove-release-version]
146156

147157
You can use `--release-version` to fetch pull request references directly from GitHub release notes and use them as the removal filter.
@@ -190,97 +200,4 @@ When a `changelog.yml` configuration file defines `bundle.profiles`, you can use
190200

191201
Profile-based commands discover the changelog configuration automatically (no `--config` flag): they look for `changelog.yml` in the current directory, then `docs/changelog.yml`. If neither file is found, the command returns an error with instructions to run `docs-builder changelog init` or to re-run from the folder where the file exists.
192202

193-
### Profile fields
194-
195-
The `changelog remove` command reads the same `bundle.profiles` configuration as `changelog bundle`, but only a subset of fields are relevant to removal:
196-
197-
| Field | Used by `changelog remove`? | Notes |
198-
|---|---|---|
199-
| `products` | Yes, when filtering by product | Required when the profile argument is a version string and no `source: github_release` is set. Not needed when the filter comes from a promotion report, URL list file, or `source: github_release`. |
200-
| `source` | Yes | `source: github_release` fetches the PR list from the GitHub release to use as the removal filter. |
201-
| `repo` | Yes, with `source: github_release` | Identifies the GitHub repository to fetch the release from. |
202-
| `owner` | Yes, with `source: github_release` | Identifies the GitHub repository owner. |
203-
| `output` | No | Ignored — removal does not write any output files. |
204-
| `output_products` | No | Ignored. |
205-
| `hide_features` | No | Ignored. |
206-
| `rules.bundle` | No | Ignored — bundle-time product filtering is not applied during removal. |
207-
208-
### Remove by product
209-
210-
You can create profiles that are equivalent to the `--products` filter option, that is to say the removal will affect only changelogs with matching `products`.
211-
212-
```yaml
213-
bundle:
214-
profiles:
215-
elasticsearch-release:
216-
products: "elasticsearch {version} {lifecycle}"
217-
output: "elasticsearch-{version}.yaml"
218-
```
219-
220-
You can remove the matching changelogs with:
221-
222-
```sh
223-
docs-builder changelog remove elasticsearch-release 9.2.0 --dry-run
224-
```
225-
226-
This removes changelogs for `elasticsearch 9.2.0 ga` — the same set that `docs-builder changelog bundle elasticsearch-release 9.2.0` would include. The lifecycle is inferred from the version string: `9.2.0``ga`, `9.2.0-beta.1``beta`. Refer to [Lifecycle inference for standard profiles](/cli/changelog/bundle.md#changelog-bundle-standard-profile-lifecycle) for details.
227-
228-
### Remove by report or URL list
229-
230-
You can also create profiles that are equivalent to the `--prs`, `--issues`, or `--report` filter options.
231-
That is to say the removal will affect only changelogs with matching `prs` or `issues`.
232-
233-
For these profile-based commands, you can pass a promotion report URL, a local `.html` file, or a URL list file as the second argument. The command removes changelogs whose `prs` field matches the PR URLs extracted from the report or file. The following commands perform the same task with and without a profile:
234-
235-
```sh
236-
docs-builder changelog remove serverless-report ./promotion-report.html
237-
238-
docs-builder changelog remove \
239-
--report ./promotion-report.html
240-
```
241-
242-
Alternatively, use a newline-delimited text file that lists pull request or issue URLs:
243-
244-
```sh
245-
docs-builder changelog remove serverless-report ./prs.txt
246-
```
247-
248-
When you want to use both a version (for `{version}` substitution in the output filename) and a report as the filter, pass both as separate arguments:
249-
250-
```sh
251-
docs-builder changelog remove serverless-report 2026-02-13 ./promotion-report.html
252-
```
253-
254-
### Remove by GitHub release profiles [changelog-remove-github-release-profile]
255-
256-
To make removal by GitHub release more easily repeatable, create a profile with `source: github_release` in your changelog configuration file.
257-
For example:
258-
259-
```yaml
260-
bundle:
261-
profiles:
262-
agent-gh-release:
263-
source: github_release
264-
repo: apm-agent-dotnet
265-
owner: elastic
266-
output: "agent-{version}.yaml"
267-
```
268-
269-
You can remove the matching changelogs with:
270-
271-
```sh
272-
docs-builder changelog remove agent-gh-release 1.34.0
273-
```
274-
275-
Use `--dry-run` to preview the files that would be deleted before committing:
276-
277-
```sh
278-
docs-builder changelog remove agent-gh-release 1.34.0 --dry-run
279-
```
280-
281-
:::{note}
282-
`source: github_release` profiles require a `GITHUB_TOKEN` or `GH_TOKEN` environment variable (or an active `gh` login) to fetch release details from the GitHub API.
283-
The `repo` and `owner` used to identify the release follow the same precedence as bundling: profile-level `repo`/`owner` override `bundle.repo`/`bundle.owner`, which in turn override the default owner `elastic`.
284-
:::
285-
286-
For the full list of profile configuration fields, go to [Profile configuration fields](/cli/changelog/bundle.md#changelog-bundle-profile-config).
203+
Refer to [](/contribute/bundle-changelogs.md#changelog-remove) for examples.

0 commit comments

Comments
 (0)