You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Felipe Cotti <felipe.cotti@elastic.co>
: The valid types are listed in [ChangelogConfiguration.cs](https://github.com/elastic/docs-builder/blob/main/src/services/Elastic.Documentation.Services/Changelog/ChangelogConfiguration.cs).
111
111
112
112
`--use-pr-number`
113
-
: Optional: Use the PR number(s) as the filename instead of generating it from a timestamp and title.
114
-
: With multiple PRs, uses hyphen-separated numbers (for example, `137431-137432.yaml`).
115
-
: Requires `--prs`. Mutually exclusive with `--use-issue-number`.
113
+
: Optional: Use PR numbers for filenames instead of timestamp-slug. With both `--prs` (which creates one changelog per specified PR) and `--issues` (which creates one changelog per specified issue), each changelog filename will be derived from its PR numbers. Requires `--prs` or `--issues`. Mutually exclusive with `--use-issue-number`.
116
114
117
115
`--use-issue-number`
118
-
: Optional: Use the issue number(s) as the filename instead of generating it from a timestamp and title.
119
-
: With multiple issues, uses hyphen-separated numbers (for example, `12345-12346.yaml`).
120
-
: Requires `--issues`. When both `--issues` and `--prs` are specified, still uses the issue number for the filename if this flag is set. Mutually exclusive with `--use-pr-number`.
116
+
: Optional: Use issue numbers for filenames instead of timestamp-slug. With both `--prs` (which creates one changelog per specified PR) and `--issues` (which creates one changelog per specified issue), each changelog filename will be derived from its issues. Requires `--prs` or `--issues`. Mutually exclusive with `--use-pr-number`.
121
117
122
118
:::{important}
123
119
`--use-pr-number` and `--use-issue-number` are mutually exclusive; specify only one.
Copy file name to clipboardExpand all lines: docs/cli/release/changelog-remove.md
+67-16Lines changed: 67 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,12 +26,18 @@ These arguments apply to profile-based removal:
26
26
`[0] <string?>`
27
27
: Profile name from `bundle.profiles` in the changelog configuration file.
28
28
: For example, "elasticsearch-release".
29
-
: When specified, the second argument is the version or promotion report URL.
30
-
: Mutually exclusive with `--all`, `--products`, `--prs`, `--issues`, `--owner`, `--repo`, `--config`, `--directory`, and `--bundles-dir`.
29
+
: When specified, the second argument is the version, promotion report URL, or URL list file.
30
+
: Mutually exclusive with `--all`, `--products`, `--prs`, `--issues`, `--report`, `--owner`, `--repo`, `--config`, `--directory`, and `--bundles-dir`.
31
31
32
32
`[1] <string?>`
33
-
: Version number or promotion report URL or path.
34
-
: For example, "9.2.0" or "https://buildkite.../promotion-report.html".
33
+
: Version number, promotion report URL/path, or URL list file.
34
+
: For example, `9.2.0`, `https://buildkite.../promotion-report.html`, or `/path/to/prs.txt`.
35
+
: See [Profile argument types](/cli/release/changelog-bundle.md#profile-argument-types) for details on accepted formats.
36
+
37
+
`[2] <string?>`
38
+
: Optional: Promotion report URL/path or URL list file when the second argument is a version string.
39
+
: When provided, `[1]` must be a version string and `[2]` is the PR/issue filter source.
40
+
: For example, `docs-builder changelog remove serverless-release 2026-02 ./promotion-report.html`.
35
41
36
42
## Options
37
43
@@ -42,8 +48,8 @@ These arguments apply to profile-based removal:
42
48
43
49
`--bundles-dir <string?>`
44
50
: Optional: Override the directory scanned for bundles during the dependency check.
45
-
: When not specified, the directory is discovered automatically from config or fallback paths.
46
-
: Not allowed with a profile argument. In profile mode, the bundles directory is derived from `bundle.output_directory` in the changelog configuration.
51
+
: When not specified, the directory is resolved in order: `bundle.output_directory`from the changelog configuration, then `{changelog-dir}/bundles`, then `{changelog-dir}/../bundles`.
52
+
: Not allowed with a profile argument. In profile mode, the same automatic discovery applies.
47
53
48
54
`--config <string?>`
49
55
: Optional: Path to the changelog configuration file.
@@ -52,8 +58,8 @@ These arguments apply to profile-based removal:
52
58
53
59
`--directory <string?>`
54
60
: Optional: The directory that contains the changelog YAML files.
55
-
: When not specified, uses `bundle.directory` from the changelog configuration if set, otherwise the current directory.
56
-
: Not allowed with a profile argument. In profile mode, the directory is derived from `bundle.directory` in the changelog configuration.
61
+
: When not specified, falls back to `bundle.directory` from the changelog configuration, then the current working directory.
62
+
: Not allowed with a profile argument. In profile mode, the same fallback applies (starting from `bundle.directory`).
57
63
58
64
`--dry-run`
59
65
: Print the files that would be removed and any bundle dependency conflicts, without deleting anything.
@@ -65,9 +71,10 @@ These arguments apply to profile-based removal:
65
71
: Valid in both profile and option-based mode.
66
72
67
73
`--issues <string[]?>`
68
-
: Filter by issue URLs or numbers (comma-separated), or a path to a newline-delimited file containing issue URLs or numbers.
74
+
: Filter by issue URLs (comma-separated), or a path to a newline-delimited file.
69
75
: Can be specified multiple times.
70
-
: Exactly one filter option must be specified: `--all`, `--products`, `--prs`, or `--issues`.
76
+
: Exactly one filter option must be specified: `--all`, `--products`, `--prs`, `--issues`, or `--report`.
77
+
: When using a file, every line must be a fully-qualified GitHub issue URL. Bare numbers and short forms are not allowed in files.
71
78
: Not allowed with a profile argument.
72
79
73
80
`--owner <string?>`
@@ -87,23 +94,53 @@ These arguments apply to profile-based removal:
87
94
-`"* * *"` — all changelogs (equivalent to `--all`)
88
95
89
96
`--prs <string[]?>`
90
-
: Filter by pull request URLs or numbers (comma-separated), or a path to a newline-delimited file containing PR URLs or numbers.
97
+
: Filter by pull request URLs (comma-separated), or a path to a newline-delimited file.
91
98
: Can be specified multiple times.
92
-
: Exactly one filter option must be specified: `--all`, `--products`, `--prs`, or `--issues`.
99
+
: Exactly one filter option must be specified: `--all`, `--products`, `--prs`, `--issues`, or `--report`.
100
+
: When using a file, every line must be a fully-qualified GitHub PR URL. Bare numbers and short forms are not allowed in files.
93
101
: Not allowed with a profile argument.
94
102
95
103
`--repo <string?>`
96
104
: The GitHub repository name, which is required when pull requests or issues are specified as numbers.
97
105
: Not allowed with a profile argument.
98
106
107
+
`--report <string?>`
108
+
: Filter by pull requests extracted from a promotion report. Accepts a URL or a local file path.
109
+
: Exactly one filter option must be specified: `--all`, `--products`, `--prs`, `--issues`, or `--report`.
110
+
: Not allowed with a profile argument.
111
+
112
+
## Directory resolution [changelog-remove-dirs]
113
+
114
+
Both modes use the same ordered fallback to locate changelog YAML files and existing bundles.
115
+
116
+
**Changelog files directory** (where changelog YAML files are read from):
117
+
118
+
| Priority | Profile-based | Option-based |
119
+
|----------|---------------|--------------|
120
+
| 1 |`bundle.directory` in `changelog.yml`|`--directory` CLI option |
121
+
| 2 | Current working directory |`bundle.directory` in `changelog.yml`|
122
+
| 3 | — | Current working directory |
123
+
124
+
**Bundles directory** (scanned for existing bundles during the dependency check):
| 2 |`bundle.output_directory` in `changelog.yml`|
130
+
| 3 |`{changelog-dir}/bundles`|
131
+
| 4 |`{changelog-dir}/../bundles`|
132
+
133
+
:::{note}
134
+
"Current working directory" means the directory you are in when you run the command (`pwd`).
135
+
Setting `bundle.directory` and `bundle.output_directory` in `changelog.yml` is recommended so you don't need to rely on running the command from a specific directory.
When a `changelog.yml` configuration file defines `bundle.profiles`, you can use those same profiles with `changelog remove` to remove exactly the changelogs that would be included in a matching bundle.
102
141
103
142
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.
104
143
105
-
Only the `products` field from a profile is used for removal. The `output`, `output_products`, `repo`, `owner`, and `hide_features` fields are bundle-specific and are ignored.
This removes changelogs for `elasticsearch 9.2.0 ga` — the same set that `docs-builder changelog bundle elasticsearch-release 9.2.0` would include.
124
161
125
-
You can also pass a promotion report URL or file path as the second argument, in which case the command removes changelogs whose PR URLs appear in the report:
162
+
:::{note}
163
+
The `output_products`, `repo`, `owner`, and `hide_features` fields are not relevant to changelog removal and are ignored.
164
+
:::
165
+
166
+
You can also pass a promotion report URL or file path, in which case the command removes changelogs that have `prs` that match the report.
167
+
The following commands perform the same task with and without a profile:
0 commit comments