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
75 changes: 45 additions & 30 deletions config/changelog.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@

# Available types for changelog entries
available_types:
- feature
- enhancement
- bug-fix
- known-issue
- breaking-change
- bug-fix
- deprecation
- docs
- enhancement
- feature
- known-issue
- other
- regression
- security
- other

# Available subtypes for breaking changes
available_subtypes:
Expand All @@ -34,45 +34,60 @@ available_lifecycles:

# Available areas (optional - if not specified, all areas are allowed)
available_areas:
- search
- security
- machine-learning
- observability
- index-management
# - Autoscaling
# - Search
# - Security
# - Watcher
# Add more areas as needed

# Available products (optional - if not specified, all products are allowed)
available_products:
- elasticsearch
- kibana
- apm
- beats
- elastic-agent
- fleet
- cloud-hosted
- cloud-serverless
- cloud-enterprise
# - elasticsearch
# - kibana
# - apm
# - beats
# - elastic-agent
# - fleet
# - cloud-hosted
# - cloud-serverless
# - cloud-enterprise
# Add more products as needed

# GitHub label mappings (optional - used when --pr option is specified)
# Maps GitHub PR labels to changelog type values
# When a PR has a label that matches a key, the corresponding type value is used
label_to_type:
# Example mappings - customize based on your label naming conventions
# "type:feature": feature
# "type:bug": bug-fix
# "type:enhancement": enhancement
# "type:breaking": breaking-change
# "type:security": security
# ">breaking": breaking-change
# ">bug": bug-fix
# ">docs": docs
# ">enhancement": enhancement
# ">feature": feature

# Maps GitHub PR labels to changelog area values
# Multiple labels can map to the same area, and a single label can map to multiple areas (comma-separated)
label_to_areas:
# Example mappings - customize based on your label naming conventions
# "area:search": search
# "area:security": security
# "area:ml": machine-learning
# "area:observability": observability
# "area:index": index-management
# "area:multiple": "search, security" # Multiple areas comma-separated
# ":Distributed Coordination/Autoscaling": Autoscaling
# ":Search/Search": Search
# ":Security/Security": Security
# ":Data Management/Watcher": Watcher
# "area:multiple": "Search, Security" # Multiple areas comma-separated

# Render blockers (optional - used by the "docs-builder changelog render" command)
# Changelogs matching the specified products and areas/types will be commented out in rendered output files
# Dictionary key can be a single product ID or comma-separated product IDs (e.g., "elasticsearch, cloud-serverless")
# Dictionary value contains areas and/or types that should be blocked for those products
render_blockers:
# Multiple products (comma-separated) with areas and types that should be blocked
"cloud-hosted, cloud-serverless":
areas: # List of area values that should be blocked (commented out) during render
- Autoscaling
- Watcher
types: # List of type values that should be blocked (commented out) during render
- docs
# Single product with areas that should be blocked
elasticsearch:
areas:
- Security

8 changes: 8 additions & 0 deletions docs/cli/release/changelog-render.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,11 @@ docs-builder changelog render [options...] [-h|--help]
: 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 markdown output and a warning will be emitted.

`--config <string?>`
: Optional: Path to the changelog.yml configuration file.
: Defaults to `docs/changelog.yml`.
: This configuration file is where the command looks for `render_blockers` details.

You can configure `render_blockers` in your `changelog.yml` configuration file to automatically block changelog entries from being rendered based on their products, areas, and/or types.
For more information, refer to [](/contribute/changelog.md#render-blockers).
46 changes: 46 additions & 0 deletions docs/contribute/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,58 @@ If a configuration file exists, the command validates all its values before gene
- 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.
- 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.

The `available_types`, `available_subtypes`, and `available_lifecycles` fields are optional in the configuration file.
If not specified, all default values from `ChangelogConfiguration.cs` are used.

### GitHub label mappings

You can optionally add `label_to_type` and `label_to_areas` mappings in your changelog configuration.
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.

Refer to [changelog.yml.example](https://github.com/elastic/docs-builder/blob/main/config/changelog.yml.example).

### Render blockers [render-blockers]

You can optionally add `render_blockers` in your changelog configuration to block specific changelog entries from being rendered in markdown output files.
When you run the `docs-builder changelog render` command, changelog entries that match the specified products and areas/types will be commented out in the markdown output.

By default, the `docs-builder changelog render` command checks the following path: `docs/changelog.yml`.
You can specify a different path with the `--config` command option.

The `render_blockers` configuration uses a dictionary format where:

- The key can be a single product ID or comma-separated product IDs (e.g., `"elasticsearch, cloud-serverless"`)
- The value contains `areas` and/or `types` that should be blocked for those products

An entry is blocked if any product in the changelog entry matches any product key in `render_blockers` AND (any area matches OR any type matches).
If a changelog entry has multiple products, all matching products in `render_blockers` are checked.

The `types` values in `render_blockers` must exist in the `available_types` list (or in the default types if `available_types` is not specified).

Example configuration:

```yaml
render_blockers:
"cloud-hosted, cloud-serverless":
areas: # List of area values that should be blocked (commented out) during render
- Autoscaling
- Watcher
types: # List of type values that should be blocked (commented out) during render
- docs
elasticsearch: # Another single product case
areas:
- Security
```

When rendering, entries with:

- Product `cloud-hosted` or `cloud-serverless` AND (area `Autoscaling` or `Watcher` OR type `docs`) will be commented out
- Product `elasticsearch` AND area `Security` will be commented out

The command will emit warnings indicating which changelog entries were commented out and why.

Refer to [changelog.yml.example](https://github.com/elastic/docs-builder/blob/main/config/changelog.yml.example).

## Create bundles [changelog-bundle]

You can use the `docs-builder changelog bundle` command to create a YAML file that lists multiple changelogs.
Expand Down Expand Up @@ -261,6 +306,7 @@ Options:
--subsections Optional: Group entries by area/component in subsections. Defaults to false
--hide-private-links Optional: Hide private links by commenting them out in the markdown output. Defaults to false
--hide-features <string[]?> 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 in the markdown output. [Default: null]
--config <string?> Optional: Path to the changelog.yml configuration file. Defaults to 'docs/changelog.yml' [Default: null]
```

Before you can use this command you must create changelog files and collect them into bundles.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,31 @@ public class ChangelogConfiguration
/// </summary>
public Dictionary<string, string>? LabelToAreas { get; set; }

/// <summary>
/// Configuration for blocking changelogs from being rendered (commented out in markdown output)
/// Dictionary key can be a single product ID or comma-separated product IDs (e.g., "elasticsearch, cloud-serverless")
/// Dictionary value contains areas and/or types that should be blocked for those products
/// Changelogs matching any product key and any area/type in the corresponding entry will be commented out
/// </summary>
public Dictionary<string, RenderBlockersEntry>? RenderBlockers { get; set; }

public static ChangelogConfiguration Default => new();
}

/// <summary>
/// Configuration entry for blocking changelogs during render
/// </summary>
public class RenderBlockersEntry
{
/// <summary>
/// List of area values that should be blocked (commented out) during render
/// </summary>
public List<string>? Areas { get; set; }

/// <summary>
/// List of type values that should be blocked (commented out) during render
/// Types must exist in the available_types list (or default AvailableTypes if not specified)
/// </summary>
public List<string>? Types { get; set; }
}

Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ public class ChangelogRenderInput
public bool Subsections { get; set; }
public bool HidePrivateLinks { get; set; }
public string[]? HideFeatures { get; set; }
public string? Config { get; set; }
}

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace Elastic.Documentation.Services.Changelog;
[YamlSerializable(typeof(ChangelogData))]
[YamlSerializable(typeof(ProductInfo))]
[YamlSerializable(typeof(ChangelogConfiguration))]
[YamlSerializable(typeof(RenderBlockersEntry))]
[YamlSerializable(typeof(BundledChangelogData))]
[YamlSerializable(typeof(BundledProduct))]
[YamlSerializable(typeof(BundledEntry))]
Expand Down
Loading
Loading