|
| 1 | +# Add changelog entries |
| 2 | + |
| 3 | +The `docs-builder changelog add` command creates a new changelog file from command-line input. |
| 4 | +By adding a file for each notable change, you can ultimately generate release documention with a consistent layout for all your products. |
| 5 | + |
| 6 | +:::{note} |
| 7 | +This command is associated with an ongoing release docs initiative. |
| 8 | +Additional workflows are still to come for managing the list of changelogs in each release. |
| 9 | +::: |
| 10 | + |
| 11 | +The command generates a YAML file that uses the following schema: |
| 12 | + |
| 13 | +:::{dropdown} Changelog schema |
| 14 | +::::{include} /contribute/_snippets/changelog-fields.md |
| 15 | +:::: |
| 16 | +::: |
| 17 | + |
| 18 | +## Command options |
| 19 | + |
| 20 | +The command supports all of the following options, which generally align with fields in the changelog schema: |
| 21 | + |
| 22 | +```sh |
| 23 | +Usage: changelog add [options...] [-h|--help] [--version] |
| 24 | + |
| 25 | +Add a new changelog fragment from command-line input |
| 26 | + |
| 27 | +Options: |
| 28 | + --title <string> Required: A short, user-facing title (max 80 characters) (Required) |
| 29 | + --type <string> Required: Type of change (feature, enhancement, bug-fix, breaking-change, etc.) (Required) |
| 30 | + --products <List<ProductInfo>> Required: Products affected in format "product target lifecycle, ..." (e.g., "elasticsearch 9.2.0 ga, cloud-serverless 2025-08-05") (Required) |
| 31 | + --subtype <string?> Optional: Subtype for breaking changes (api, behavioral, configuration, etc.) (Default: null) |
| 32 | + --areas <string[]?> Optional: Area(s) affected (comma-separated or specify multiple times) (Default: null) |
| 33 | + --pr <string?> Optional: Pull request URL (Default: null) |
| 34 | + --issues <string[]?> Optional: Issue URL(s) (comma-separated or specify multiple times) (Default: null) |
| 35 | + --description <string?> Optional: Additional information about the change (max 600 characters) (Default: null) |
| 36 | + --impact <string?> Optional: How the user's environment is affected (Default: null) |
| 37 | + --action <string?> Optional: What users must do to mitigate (Default: null) |
| 38 | + --feature-id <string?> Optional: Feature flag ID (Default: null) |
| 39 | + --highlight <bool?> Optional: Include in release highlights (Default: null) |
| 40 | + --output <string?> Optional: Output directory for the changelog fragment. Defaults to current directory (Default: null) |
| 41 | + --config <string?> Optional: Path to the changelog.yml configuration file. Defaults to 'docs/changelog.yml' (Default: null) |
| 42 | +``` |
| 43 | +
|
| 44 | +### Product format |
| 45 | +
|
| 46 | +The `--products` parameter accepts products in the format `"product target lifecycle, ..."` where: |
| 47 | +
|
| 48 | +- `product` is the product ID from [products.yml](https://github.com/elastic/docs-builder/blob/main/config/products.yml) (required) |
| 49 | +- `target` is the target version or date (optional) |
| 50 | +- `lifecycle` is one of: `preview`, `beta`, or `ga` (optional) |
| 51 | +
|
| 52 | +Examples: |
| 53 | +
|
| 54 | +- `"kibana 9.2.0 ga"` |
| 55 | +- `"cloud-serverless 2025-08-05"` |
| 56 | +- `"cloud-enterprise 4.0.3, cloud-hosted 2025-10-31"` |
| 57 | +
|
| 58 | +## Changelog configuration |
| 59 | +
|
| 60 | +Some of the fields in the changelog accept only a specific set of values. |
| 61 | +
|
| 62 | +:::{important} |
| 63 | +
|
| 64 | +- Product values must exist in [products.yml](https://github.com/elastic/docs-builder/blob/main/config/products.yml). Invalid products will cause the command to fail. |
| 65 | +- Type, subtype, and lifecycle values must match the available values defined in [ChangelogConfiguration.cs](https://github.com/elastic/docs-builder/blob/main/src/services/Elastic.Documentation.Services/Changelog/ChangelogConfiguration.cs). Invalid values will cause the command to fail. |
| 66 | +::: |
| 67 | +
|
| 68 | +If you want to further limit the list of values, you can optionally create a configuration file. |
| 69 | +Refer to [changelog.yml.example](https://github.com/elastic/docs-builder/blob/main/config/changelog.yml.example). |
| 70 | +
|
| 71 | +By default, the command checks the following path: `docs/changelog.yml`. |
| 72 | +You can specify a different path with the `--config` command option. |
| 73 | +
|
| 74 | +If a configuration file exists, the command validates all its values before generating the changelog file: |
| 75 | +
|
| 76 | +- 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. |
| 77 | +- 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. |
| 78 | +
|
| 79 | +## Examples |
| 80 | +
|
| 81 | +The following command creates a changelog for a bug fix that applies to two products: |
| 82 | +
|
| 83 | +```sh |
| 84 | +docs-builder changelog add \ |
| 85 | + --title "Fixes enrich and lookup join resolution based on minimum transport version" \ |
| 86 | + --type bug-fix \ <1> |
| 87 | + --products "elasticsearch 9.2.3, cloud-serverless 2025-12-02" \ <2> |
| 88 | + --areas "ES|QL" |
| 89 | + --pr "https://github.com/elastic/elasticsearch/pull/137431" <3> |
| 90 | +``` |
| 91 | +
|
| 92 | +1. The type values are defined in [ChangelogConfiguration.cs](https://github.com/elastic/docs-builder/blob/main/src/services/Elastic.Documentation.Services/Changelog/ChangelogConfiguration.cs). |
| 93 | +2. The product values are defined in [products.yml](https://github.com/elastic/docs-builder/blob/main/config/products.yml). |
| 94 | +3. At this time, the PR value can be a number or a URL; it is not validated. |
| 95 | +
|
| 96 | +The output file has the following format: |
| 97 | +
|
| 98 | +```yaml |
| 99 | +pr: https://github.com/elastic/elasticsearch/pull/137431 |
| 100 | +type: bug-fix |
| 101 | +products: |
| 102 | +- product: elasticsearch |
| 103 | + target: 9.2.3 |
| 104 | +- product: cloud-serverless |
| 105 | + target: 2025-12-02 |
| 106 | +title: Fixes enrich and lookup join resolution based on minimum transport version |
| 107 | +areas: |
| 108 | +- ES|QL |
| 109 | +``` |
0 commit comments