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
16 changes: 7 additions & 9 deletions docs/cli/release/changelog-render.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ docs-builder changelog render [options...] [-h|--help]

## Options

`--input <List<BundleInput>>`
`--input <string[]>`
: One or more bundle input files.
: Each item can be specified as "bundle-file-path, changelog-file-path, repo" to accommodate files coming from multiple locations.
: For example, `--input "./changelog-bundle.yaml,./changelogs,elasticsearch"`.
: Only `bundle-file-path` is required.
: Each bundle is specified as "bundle-file-path|changelog-file-path|repo|link-visibility" using pipe (`|`) as delimiter.
: To merge multiple bundles, separate them with commas: `--input "bundle1|dir1|repo1|keep-links,bundle2|dir2|repo2|hide-links"`.
: For example, `--input "/path/to/changelog-bundle.yaml|/path/to/changelogs|elasticsearch|keep-links"`.
: Only `bundle-file-path` is required for each bundle.
: Use `repo` if your changelogs do not contain full URLs for the pull requests or issues; otherwise they will be incorrectly derived with "elastic/elastic" in the URL by default.
: Use `link-visibility` to control whether PR/issue links are shown or hidden for entries from this bundle. Valid values are `keep-links` (default) or `hide-links`. Use `hide-links` for bundles from private repositories.
: **Important**: Paths must be absolute or use environment variables. Tilde (`~`) expansion is not supported.

`--output <string?>`
: Optional: The output directory for rendered markdown files.
Expand All @@ -34,11 +37,6 @@ docs-builder changelog render [options...] [-h|--help]
: Optional: Group entries by area in subsections.
: Defaults to false.

`--hide-private-links`
: Optional: Hide private links by commenting them out in the markdown output.
: This option is useful when rendering changelog bundles in private repositories.
: Defaults to false.

`--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`).
Expand Down
17 changes: 10 additions & 7 deletions docs/contribute/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,10 @@ For up-to-date details, use the `-h` command option:
Render bundled changelog(s) to markdown files

Options:
--input <List<BundleInput>> Required: Bundle input(s) in format "bundle-file-path, changelog-file-path, repo". Can be specified multiple times. Only bundle-file-path is required. [Required]
--input <string[]> Required: Bundle input(s) in format "bundle-file-path|changelog-file-path|repo|link-visibility" (use pipe as delimiter). To merge multiple bundles, separate them with commas. Only bundle-file-path is required. link-visibility can be "hide-links" or "keep-links" (default). Paths must be absolute or use environment variables; tilde (~) expansion is not supported. [Required]
--output <string?> Optional: Output directory for rendered markdown files. Defaults to current directory [Default: null]
--title <string?> Optional: Title to use for section headers in output markdown files. Defaults to version from first bundle [Default: null]
--subsections Optional: Group entries by area/component in subsections. For breaking changes with a subtype, groups by subtype instead of area. 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]
```
Expand Down Expand Up @@ -373,17 +372,21 @@ To create markdown files from this bundle, run the `docs-builder changelog rende

```sh
docs-builder changelog render \
--input "./changelog-bundle.yaml,./changelogs,elasticsearch" \ <1>
--input "/path/to/changelog-bundle.yaml|/path/to/changelogs|elasticsearch|keep-links,/path/to/other-bundle.yaml|/path/to/other-changelogs|kibana|hide-links" \ <1>
--title 9.2.2 \ <2>
--output ./release-notes \ <3>
--subsections \ <4>
--output /path/to/release-notes \ <3>
--subsections <4>
```

1. Provide information about the changelog bundle. The format is `"<bundle-file-path>, <changelog-file-path>, <repository>"`. Only the `<bundle-file-path>` is required. The `<changelog-file-path>` is useful if the changelogs are not in the default directory and are not resolved within the bundle. The `<repository>` is necessary if your changelogs do not contain full URLs for the pull requests or issues. You can specify `--input` multiple times to merge multiple bundles.
1. Provide information about the changelog bundle(s). The format for each bundle is `"<bundle-file-path>|<changelog-file-path>|<repository>|<link-visibility>"` using pipe (`|`) as delimiter. To merge multiple bundles, separate them with commas (`,`). Only the `<bundle-file-path>` is required for each bundle. The `<changelog-file-path>` is useful if the changelogs are not in the default directory and are not resolved within the bundle. The `<repository>` is necessary if your changelogs do not contain full URLs for the pull requests or issues. The `<link-visibility>` can be `hide-links` or `keep-links` (default) to control whether PR/issue links are hidden for entries from private repositories.
2. The `--title` value is used for an output folder name and for section titles in the markdown files. If you omit `--title` and the first bundle contains a product `target` value, that value is used. Otherwise, if none of the bundles have product `target` fields, the title defaults to "unknown".
3. By default the command creates the output files in the current directory.
4. By default the changelog areas are not displayed in the output. Add `--subsections` to group changelog details by their `areas`. For breaking changes that have a `subtype` value, the subsections will be grouped by subtype instead of area.

:::{important}
Paths in the `--input` option must be absolute paths or use environment variables. Tilde (`~`) expansion is not supported.
:::

For example, the `index.md` output file contains information derived from the changelogs:

```md
Expand All @@ -401,7 +404,7 @@ For example, the `index.md` output file contains information derived from the ch
* Break on FieldData when building global ordinals. [#108875](https://github.com/elastic/elastic/pull/108875)
```

To comment out the pull request and issue links, for example if they relate to a private repository, use the `--hide-private-links` option.
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).
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@
namespace Elastic.Documentation.Services.Changelog;

/// <summary>
/// Input for a single bundle file with optional directory and repo
/// Input for a single bundle file with optional directory, repo, and link visibility
/// </summary>
public class BundleInput
{
public string BundleFile { get; set; } = string.Empty;
public string? Directory { get; set; }
public string? Repo { get; set; }
/// <summary>
/// Whether to hide PR/issue links for entries from this bundle.
/// When true, links are commented out in the markdown output.
/// Defaults to false (links are shown).
/// </summary>
public bool HideLinks { get; set; }
}

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public class ChangelogRenderInput
public string? Output { get; set; }
public string? Title { get; set; }
public bool Subsections { get; set; }
public bool HidePrivateLinks { get; set; }
public string[]? HideFeatures { get; set; }
public string? Config { get; set; }
}
Expand Down
Loading
Loading