diff --git a/.generator/cli.py b/.generator/cli.py index c26934b788cc..81443779bd71 100644 --- a/.generator/cli.py +++ b/.generator/cli.py @@ -228,6 +228,7 @@ def handle_configure( source: str = SOURCE_DIR, repo: str = REPO_DIR, input: str = INPUT_DIR, + output: str = OUTPUT_DIR ): """Onboards a new library by completing its configuration. @@ -248,6 +249,8 @@ def handle_configure( the config.yaml. input(str): The path to the directory in the container which contains additional generator input. + output(str): Path to the directory in the container where code + should be generated. Raises: ValueError: If configuring a new library fails. @@ -256,6 +259,12 @@ def handle_configure( # configure-request.json contains the library definitions. request_data = _read_json_file(f"{librarian}/{CONFIGURE_REQUEST_FILE}") new_library_config = _get_new_library_config(request_data) + + _update_global_changelog( + f"{repo}/CHANGELOG.md", + f"{output}/CHANGELOG.md", + [new_library_config], + ) prepared_config = _prepare_new_library_config(new_library_config) # Write the new library configuration to configure-response.json. @@ -1418,6 +1427,7 @@ def handle_release_init( source=args.source, repo=args.repo, input=args.input, + output=args.output, ) elif args.command == "generate": args.func( diff --git a/.generator/test_cli.py b/.generator/test_cli.py index ee5963a033fe..34535910eefd 100644 --- a/.generator/test_cli.py +++ b/.generator/test_cli.py @@ -287,6 +287,7 @@ def mock_state_file(tmp_path, monkeypatch): def test_handle_configure_success(mock_configure_request_file, mocker): """Tests the successful execution path of handle_configure.""" + mocker.patch("cli._update_global_changelog", return_value=None) mock_write_json = mocker.patch("cli._write_json_file") mock_prepare_config = mocker.patch( "cli._prepare_new_library_config", return_value={"id": "prepared"}