Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions config/changelog.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,7 @@ bundle:
# serverless-release:
# products: "cloud-serverless {version} *"
# output: "serverless-{version}.yaml"
# # Feature IDs to hide when bundling with this profile
# hide_features:
# - feature-flag-1
# - feature-flag-2
28 changes: 27 additions & 1 deletion docs/cli/release/changelog-bundle.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,42 @@ For details and examples, go to [](/contribute/changelog.md).
## Usage

```sh
docs-builder changelog bundle [options...] [-h|--help]
docs-builder changelog bundle [arguments...] [options...] [-h|--help]
```

## Arguments

You can use either profile-based bundling (for example, `bundle elasticsearch-release 9.2.0`) or raw flags (`bundle --all`).
These arguments apply to profile-based bundling:

`[0] <string?>`
: Profile name from `bundle.profiles` in the changelog configuration file.
: For example, "elasticsearch-release".
: When it's specified, the second argument is the version or promotion report URL.

`[1] <string?>`
: Version number or promotion report URL or path.
: For example, "9.2.0" or "https://buildkite.../promotion-report.html".

## Options

`--all`
: Include all changelogs from the directory.
: Only one filter option can be specified: `--all`, `--input-products`, or `--prs`.

`--config <string?>`
: Optional: Path to the changelog.yml configuration file.
: Defaults to `docs/changelog.yml`.

`--directory <string?>`
: Optional: The directory that contains the changelog YAML files.
: Defaults to the current directory.

`--hide-features <string[]?>`
: Optional: Filter by feature IDs (comma-separated), or a path to a newline-delimited file containing feature IDs.
: Can be specified multiple times.
: Entries with matching `feature-id` values will be commented out when the bundle is rendered (by the `changelog render` command or `{changelog}` directive).

`--input-products <List<ProductInfo>?>`
: Filter by products in format "product target lifecycle, ..."
: Only one filter option can be specified: `--all`, `--input-products`, or `--prs`.
Expand All @@ -32,6 +55,9 @@ docs-builder changelog bundle [options...] [-h|--help]
- `"* 9.3.* *"` - match any product with target starting with "9.3."
- `"* * *"` - match all changelogs (equivalent to `--all`)

`--no-resolve`
: Optional: Explicitly turn off the `resolve` option if it's specified in the changelog configuration file.

`--output <string?>`
: Optional: The output path for the bundle.
: Can be either (1) a directory path, in which case `changelog-bundle.yaml` is created in that directory, or (2) a file path ending in `.yml` or `.yaml`.
Expand Down
3 changes: 2 additions & 1 deletion docs/cli/release/changelog-render.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ docs-builder changelog render [options...] [-h|--help]
`--config <string?>`
: Optional: Path to the changelog.yml configuration file.
: Defaults to `docs/changelog.yml`.
: This configuration file is where the command looks `block ... publish` definitions.
: This configuration file is where the command looks for `block ... publish` definitions.

`--hide-features <string[]?>`
: Optional: Filter by feature IDs (comma-separated), or a path to a newline-delimited file containing feature IDs. Can be specified multiple times.
: Each occurrence can be either comma-separated feature IDs (e.g., `--hide-features "feature:new-search-api,feature:enhanced-analytics"`) or a file path (e.g., `--hide-features /path/to/file.txt`).
: When specifying feature IDs directly, provide comma-separated values.
: When specifying a file path, provide a single value that points to a newline-delimited file. The file should contain one feature ID per line.
: Entries with matching `feature-id` values will be commented out in the output and a warning will be emitted.
: If the bundle contains `hide-features` values (that is to say, it was created with the `--hide-features` option), those values are merged with this list and are also hidden.

`--input <string[]>`
: One or more bundle input files.
Expand Down
96 changes: 93 additions & 3 deletions docs/contribute/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,13 @@ Bundle changelogs
Options:
--all Include all changelogs in the directory. Only one filter option can be specified: `--all`, `--input-products`, or `--prs`.
--directory <string?> Optional: Directory containing changelog YAML files. Defaults to current directory [Default: null]
--hide-features <string[]?> Optional: Feature IDs to mark as hidden in the bundle output (comma-separated), or a path to a newline-delimited file containing feature IDs. Can be specified multiple times. When the bundle is rendered (by CLI render or {changelog} directive), entries with matching feature-id values will be commented out. [Default: null]
--input-products <List<ProductInfo>?> Filter by products in format "product target lifecycle, ..." (e.g., "cloud-serverless 2025-12-02 ga, cloud-serverless 2025-12-06 beta"). When specified, all three parts (product, target, lifecycle) are required but can be wildcards (*). Examples: "elasticsearch * *" matches all elasticsearch changelogs, "cloud-serverless 2025-12-02 *" matches cloud-serverless 2025-12-02 with any lifecycle, "* 9.3.* *" matches any product with target starting with "9.3.", "* * *" matches all changelogs (equivalent to --all). Only one filter option can be specified: `--all`, `--input-products`, or `--prs`. [Default: null]
--output <string?> Optional: Output path for the bundled changelog. Can be either (1) a directory path, in which case 'changelog-bundle.yaml' is created in that directory, or (2) a file path ending in .yml or .yaml. Defaults to 'changelog-bundle.yaml' in the input directory [Default: null]
--output-products <List<ProductInfo>?> Optional: Explicitly set the products array in the output file in format "product target lifecycle, ...". Overrides any values from changelogs. [Default: null]
--owner <string?> GitHub repository owner (required only when PRs are specified as numbers) [Default: null]
--prs <string[]?> Filter by 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. Only one filter option can be specified: `--all`, `--input-products`, or `--prs`. [Default: null]
--repo <string?> GitHub repository name (required only when PRs are specified as numbers) [Default: null]
--repo <string?> GitHub repository name. When specified, this value is stored in the bundle's product metadata and used to generate correct PR/issue links during rendering. Required when PRs are specified as numbers. [Default: null]
--resolve Optional: Copy the contents of each changelog file into the entries array. By default, the bundle contains only the file names and checksums.
```

Expand Down Expand Up @@ -538,6 +539,96 @@ The `--output` option supports two formats:

If you specify a file path with a different extension (not `.yml` or `.yaml`), the command returns an error.

### Hide features in bundles [changelog-bundle-hide-features]

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.

```sh
docs-builder changelog bundle \
--input-products "elasticsearch 9.3.0 *" \
--hide-features "feature:hidden-api,feature:experimental" \ <1>
--output /path/to/bundles/9.3.0.yaml
```

1. Feature IDs to hide. Entries with matching `feature-id` values will be commented out when rendered.

The bundle output will include a `hide-features` field:

```yaml
products:
- product: elasticsearch
target: 9.3.0
hide-features:
- feature:hidden-api
- feature:experimental
entries:
- file:
name: 1765495972-new-feature.yaml
checksum: 6c3243f56279b1797b5dfff6c02ebf90b9658464
```

When this bundle is rendered (either via the `changelog render` command or the `{changelog}` directive), entries with `feature-id` values matching any of the listed features will be commented out in the output.

:::{note}
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.
:::

### Repository name in bundles [changelog-bundle-repo]

When you specify the `--repo` option, the repository name is stored in the bundle's product metadata. This ensures that PR and issue links are generated correctly when the bundle is rendered.

```sh
docs-builder changelog bundle \
--input-products "cloud-serverless 2025-12-02 *" \
--repo cloud \ <1>
--output /path/to/bundles/2025-12-02.yaml
```

1. The GitHub repository name. This is stored in each product entry in the bundle.

The bundle output will include a `repo` field in each product:

```yaml
products:
- product: cloud-serverless
target: 2025-12-02
repo: cloud
entries:
- file:
name: 1765495972-new-feature.yaml
checksum: 6c3243f56279b1797b5dfff6c02ebf90b9658464
```

When rendering, PR/issue links will use `https://github.com/elastic/cloud/...` instead of the product ID in the URL.

:::{note}
If the `repo` field is not specified, the product ID is used as a fallback for link generation. This may result in broken links if the product ID doesn't match the GitHub repository name (e.g., `cloud-serverless` vs `cloud`).
:::

### Amend bundles [changelog-bundle-amend]

When you need to add entries to an existing bundle without modifying the original file, you can create amend bundles. Amend bundles follow a specific naming convention: `{parent-bundle-name}.amend-{N}.yaml` where `{N}` is a sequence number.

For example, if you have a bundle named `9.3.0.yaml`, you can create amend files:
- `9.3.0.amend-1.yaml`
- `9.3.0.amend-2.yaml`

Amend bundles contain only the additional entries:

```yaml
# 9.3.0.amend-1.yaml
entries:
- file:
name: late-addition.yaml
checksum: abc123def456
```

When bundles are loaded (either via the `changelog render` command or the `{changelog}` directive), amend files are **automatically merged** with their parent bundles. The entries from all matching amend files are combined with the parent bundle's entries, and the result is rendered as a single release.

:::{note}
Amend bundles do not need to include `products` or `hide-features` fields—they inherit these from their parent bundle. If an amend bundle is found without a matching parent bundle, it remains standalone.
:::

## Create documentation

### Include changelogs inline [changelog-directive]
Expand Down Expand Up @@ -626,8 +717,7 @@ For example, the `index.md` output file contains information derived from the ch

To comment out the pull request and issue links, for example if they relate to a private repository, add `hide-links` to the `--input` option for that bundle. This allows you to selectively hide links per bundle when merging changelogs from multiple repositories.

If you have changelogs with `feature-id` values and you want them to be omitted from the output, use the `--hide-features` option.
For more information, refer to [](/cli/release/changelog-render.md).
If you have changelogs with `feature-id` values and you want them to be omitted from the output, use the `--hide-features` option. Feature IDs specified via `--hide-features` are **merged** with any `hide-features` already present in the bundle files. This means both CLI-specified and bundle-embedded features are hidden in the output.

To create an asciidoc file instead of markdown files, add the `--file-type asciidoc` option:

Expand Down
122 changes: 121 additions & 1 deletion docs/syntax/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ The directive supports the following options:
| `:type: value` | Filter entries by type | Excludes separated types |
| `:subsections:` | Group entries by area/component | false |
| `:config: path` | Path to changelog.yml configuration | auto-discover |
| `:product: id` | Product ID for product-specific publish blockers | auto from docset |

### Example with options

```markdown
:::{changelog} /path/to/bundles
:type: all
:subsections:
:product: kibana
:::
```

Expand Down Expand Up @@ -102,23 +104,104 @@ Explicit path to a `changelog.yml` configuration file. If not specified, the dir

The configuration can include publish blockers to filter entries by type or area.

#### `:product:`

Product ID for loading product-specific publish blockers from `changelog.yml`. The directive resolves the product ID in this order:

1. **Explicit `:product:` option** - if specified, uses that product ID
2. **Docset's single product** - if the docset has exactly one product configured in `docset.yml`, uses that product ID automatically
3. **Global fallback** - uses the global `block.publish` configuration

This automatic fallback means most single-product docsets don't need to specify `:product:` explicitly - the directive will automatically use the docset's product for publish blocker lookup.

**Example docset with single product:**

```yaml
# docset.yml
products:
- id: kibana
toc:
- file: release-notes.md
```

```yaml
# changelog.yml
block:
product:
kibana:
publish:
types:
- docs
areas:
- "Elastic Observability solution"
- "Elastic Security solution"
```

With this configuration, the directive will automatically use the `kibana` product blockers:

```markdown
:::{changelog}
:::
```

**Explicit override:**

You can override the automatic product detection by specifying `:product:` explicitly:

```markdown
:::{changelog}
:product: elasticsearch
:::
```

This is useful when:
- The docset has multiple products and you want a specific one
- You want to use a different product's blockers than the docset default

The product ID matching is case-insensitive.

## Filtering entries with publish blockers

You can filter changelog entries from the rendered output using the `block.publish` configuration in your `changelog.yml` file. This is useful for hiding entries that shouldn't appear in public documentation, such as internal changes or documentation-only updates.
You can filter changelog entries from the rendered output using the `block.publish` or `block.product.{productId}.publish` configuration in your `changelog.yml` file. This is useful for hiding entries that shouldn't appear in public documentation, such as internal changes or documentation-only updates.

### Configuration syntax

Create a `changelog.yml` file in your docset root (or `docs/changelog.yml`):

```yaml
block:
# Global publish blocker (applies to all products)
publish:
types:
- docs # Hide documentation entries
- regression # Hide regression entries
areas:
- Internal # Hide entries with "Internal" area
- Experimental # Hide entries with "Experimental" area

# Product-specific blockers (override global blockers)
product:
kibana:
publish:
types:
- docs
areas:
- "Elastic Observability solution"
- "Elastic Security solution"
cloud-serverless:
publish:
types:
- docs
areas:
- "Snapshot and restore"
```

Product-specific blockers are applied automatically when your docset has a single product configured. For docsets with multiple products or to override the automatic detection, specify the `:product:` option:

```markdown
:::{changelog}
:product: kibana
:::
```

### Filtering by type
Expand Down Expand Up @@ -195,6 +278,28 @@ block:
- known-issue # Known issues shown on dedicated page
```

## Feature hiding from bundles

When bundles contain a `hide-features` field, entries with matching `feature-id` values are automatically filtered out from the rendered output. This allows you to hide unreleased or experimental features without modifying the bundle at render time.

```yaml
# Example bundle with hide-features
products:
- product: elasticsearch
target: 9.3.0
hide-features:
- feature:hidden-api
- feature:experimental
entries:
- file:
name: new-feature.yaml
checksum: abc123
```

When the directive loads multiple bundles, `hide-features` from **all bundles are aggregated** and applied to all entries. This means if bundle A hides `feature:x` and bundle B hides `feature:y`, both features are hidden in the combined output.

To add `hide-features` to a bundle, use the `--hide-features` option when running `changelog bundle`. For more details, see [Hide features in bundles](../contribute/changelog.md#changelog-bundle-hide-features).

## Private repository link hiding

PR and issue links are automatically hidden (commented out) for bundles from private repositories. This is determined by checking the `assembler.yml` configuration:
Expand All @@ -207,6 +312,21 @@ PR and issue links are automatically hidden (commented out) for bundles from pri

Bundles with the same target version/date are automatically merged into a single section. This is useful for Cloud Serverless releases where multiple repositories (e.g., Elasticsearch, Kibana) contribute to a single dated release like `2025-08-05`.

### Amend bundle merging

Bundles can have associated **amend files** that follow the naming pattern `{bundle-name}.amend-{N}.yaml` (e.g., `9.3.0.amend-1.yaml`). When loading bundles, the directive automatically discovers and merges amend files with their parent bundles.

This allows you to add late additions to a release without modifying the original bundle file:

```
bundles/
├── 9.3.0.yaml # Parent bundle
├── 9.3.0.amend-1.yaml # First amend (auto-merged with parent)
└── 9.3.0.amend-2.yaml # Second amend (auto-merged with parent)
```

All entries from the parent and amend bundles are rendered together as a single release section. The parent bundle's metadata (products, hide-features, repo) is preserved.

## Default folder structure

The directive expects bundles in `changelog/bundles/` relative to the docset root:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,10 @@ public record BundleProfile
/// - "serverless-{version}.yaml"
/// </summary>
public string? Output { get; init; }

/// <summary>
/// Feature IDs to mark as hidden in the bundle output.
/// When the bundle is rendered, entries with matching feature-id values will be commented out.
/// </summary>
public IReadOnlyList<string>? HideFeatures { get; init; }
}
Loading
Loading