Skip to content

Commit d2011dd

Browse files
authored
feat: update changelog in configure command (#14734)
This PR updates the global changelog which is required for the configure command to be run successfully.
1 parent 6ff4ec9 commit d2011dd

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.generator/cli.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ def handle_configure(
228228
source: str = SOURCE_DIR,
229229
repo: str = REPO_DIR,
230230
input: str = INPUT_DIR,
231+
output: str = OUTPUT_DIR
231232
):
232233
"""Onboards a new library by completing its configuration.
233234
@@ -248,6 +249,8 @@ def handle_configure(
248249
the config.yaml.
249250
input(str): The path to the directory in the container
250251
which contains additional generator input.
252+
output(str): Path to the directory in the container where code
253+
should be generated.
251254
252255
Raises:
253256
ValueError: If configuring a new library fails.
@@ -256,6 +259,12 @@ def handle_configure(
256259
# configure-request.json contains the library definitions.
257260
request_data = _read_json_file(f"{librarian}/{CONFIGURE_REQUEST_FILE}")
258261
new_library_config = _get_new_library_config(request_data)
262+
263+
_update_global_changelog(
264+
f"{repo}/CHANGELOG.md",
265+
f"{output}/CHANGELOG.md",
266+
[new_library_config],
267+
)
259268
prepared_config = _prepare_new_library_config(new_library_config)
260269

261270
# Write the new library configuration to configure-response.json.
@@ -1418,6 +1427,7 @@ def handle_release_init(
14181427
source=args.source,
14191428
repo=args.repo,
14201429
input=args.input,
1430+
output=args.output,
14211431
)
14221432
elif args.command == "generate":
14231433
args.func(

.generator/test_cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ def mock_state_file(tmp_path, monkeypatch):
287287

288288
def test_handle_configure_success(mock_configure_request_file, mocker):
289289
"""Tests the successful execution path of handle_configure."""
290+
mocker.patch("cli._update_global_changelog", return_value=None)
290291
mock_write_json = mocker.patch("cli._write_json_file")
291292
mock_prepare_config = mocker.patch(
292293
"cli._prepare_new_library_config", return_value={"id": "prepared"}

0 commit comments

Comments
 (0)