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
10 changes: 10 additions & 0 deletions .generator/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions .generator/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down
Loading