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
3 changes: 2 additions & 1 deletion .generator/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,7 @@ def _process_changelog(
type_key = "type"
source_commit_hash_key = "source_commit_hash"
subject_key = "subject"
body_key = "body"
library_changes.sort(key=lambda x: x[type_key])
grouped_changes = itertools.groupby(library_changes, key=lambda x: x[type_key])

Expand All @@ -948,7 +949,7 @@ def _process_changelog(
entry_parts.append(f"\n\n### {change_type_map[adjusted_change_type]}\n")
for change in library_changes:
commit_link = f"([{change[source_commit_hash_key]}]({_REPO_URL}/commit/{change[source_commit_hash_key]}))"
entry_parts.append(f"* {change[subject_key]} {commit_link}")
entry_parts.append(f"* {change[subject_key]} {change[body_key]} {commit_link}")

new_entry_text = "\n".join(entry_parts)
anchor_pattern = re.compile(
Expand Down
20 changes: 13 additions & 7 deletions .generator/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
{
"type": "fix",
"subject": "some fix",
"body": "",
"body": "some body",
"piper_cl_number": "786353208",
"source_commit_hash": "1231532e7d19c8d71709ec3b502e5d81340fb661",
},
Expand Down Expand Up @@ -304,7 +304,10 @@ def test_get_new_library_config_not_found():
"""Tests that an empty dictionary is returned when no new library is found."""
request_data = {
"libraries": [
{"id": "existing-library", "apis": [{"path": "path/v1", "status": "existing"}]},
{
"id": "existing-library",
"apis": [{"path": "path/v1", "status": "existing"}],
},
]
}
config = _get_new_library_config(request_data)
Expand Down Expand Up @@ -333,7 +336,10 @@ def test_prepare_new_library_config():
assert "status" not in prepared_config["apis"][0]
# Check that defaults are added
assert prepared_config["source_roots"] == ["packages/google-cloud-language"]
assert "packages/google-cloud-language/CHANGELOG.md" in prepared_config["preserve_regex"]
assert (
"packages/google-cloud-language/CHANGELOG.md"
in prepared_config["preserve_regex"]
)
assert prepared_config["remove_regex"] == ["packages/google-cloud-language"]
assert prepared_config["tag_format"] == "{{id}}-v{{version}}"

Expand Down Expand Up @@ -957,12 +963,12 @@ def test_process_changelog_success():
expected_result = f"""# Changelog\n[PyPI History][1]\n[1]: https://pypi.org/project/google-cloud-language/#history\n
## [1.2.3](https://github.com/googleapis/google-cloud-python/compare/google-cloud-language-v1.2.2...google-cloud-language-v1.2.3) ({current_date})\n\n
### Documentation\n
* fix typo in BranchRule comment ([9461532e7d19c8d71709ec3b502e5d81340fb661](https://github.com/googleapis/google-cloud-python/commit/9461532e7d19c8d71709ec3b502e5d81340fb661))\n\n
* fix typo in BranchRule comment ([9461532e7d19c8d71709ec3b502e5d81340fb661](https://github.com/googleapis/google-cloud-python/commit/9461532e7d19c8d71709ec3b502e5d81340fb661))\n\n
### Features\n
* add new UpdateRepository API ([9461532e7d19c8d71709ec3b502e5d81340fb661](https://github.com/googleapis/google-cloud-python/commit/9461532e7d19c8d71709ec3b502e5d81340fb661))\n\n
* add new UpdateRepository API This adds the ability to update a repository's properties. ([9461532e7d19c8d71709ec3b502e5d81340fb661](https://github.com/googleapis/google-cloud-python/commit/9461532e7d19c8d71709ec3b502e5d81340fb661))\n\n
### Bug Fixes\n
* some fix ([1231532e7d19c8d71709ec3b502e5d81340fb661](https://github.com/googleapis/google-cloud-python/commit/1231532e7d19c8d71709ec3b502e5d81340fb661))
* another fix ([1241532e7d19c8d71709ec3b502e5d81340fb661](https://github.com/googleapis/google-cloud-python/commit/1241532e7d19c8d71709ec3b502e5d81340fb661))\n
* some fix some body ([1231532e7d19c8d71709ec3b502e5d81340fb661](https://github.com/googleapis/google-cloud-python/commit/1231532e7d19c8d71709ec3b502e5d81340fb661))
* another fix ([1241532e7d19c8d71709ec3b502e5d81340fb661](https://github.com/googleapis/google-cloud-python/commit/1241532e7d19c8d71709ec3b502e5d81340fb661))\n
## [1.2.2](https://github.com/googleapis/google-cloud-python/compare/google-cloud-language-v1.2.1...google-cloud-language-v1.2.2) (2025-06-11)"""
version = "1.2.3"
previous_version = "1.2.2"
Expand Down
Loading