Commit b511ec0
authored
chore(librarian): Create package changelog if not present (#14963)
When adding a new API version to an existing library, the contents of
the existing package level `CHANGELOG.md` file is removed. The issue is
that a new changelog is created unconditionally here:
https://github.com/googleapis/google-cloud-python/blob/c7696a668a405bdafee59a9341f6d04340d0c45e/.generator/cli.py#L295
As an example, the command below adds the client library code for
`google/cloud/maintenance/api/v1` to an existing package
[google-cloud-maintenance-api](https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-maintenance-api)
```
librarian generate -api=google/cloud/maintenance/api/v1 -library=google-cloud-maintenance-api
```
After running the command locally, see that the contents of this
[CHANGELOG.md](https://raw.githubusercontent.com/googleapis/google-cloud-python/refs/heads/main/packages/google-cloud-maintenance-api/CHANGELOG.md)
is gone. See below
```
(py392) partheniou@partheniou-vm-3:~/git/google-cloud-python$ git diff packages/google-cloud-maintenance-api/CHANGELOG.md
diff --git a/packages/google-cloud-maintenance-api/CHANGELOG.md b/packages/google-cloud-maintenance-api/CHANGELOG.md
index 6436543..d884ea3cedb 100644
--- a/packages/google-cloud-maintenance-api/CHANGELOG.md
+++ b/packages/google-cloud-maintenance-api/CHANGELOG.md
@@ -3,31 +3,3 @@
[PyPI History][1]
[1]: https://pypi.org/project/google-cloud-maintenance-api/#history
-
-## [0.2.0](google-cloud-maintenance-api-v0.1.1...google-cloud-maintenance-api-v0.2.0) (2025-10-20)
-
-
-### Features
-
-* Add support for Python 3.14 ([98ee71a](98ee71a))
-
-
-### Bug Fixes
-
-* Deprecate credentials_file argument ([98ee71a](98ee71a))
-
-## [0.1.1](google-cloud-maintenance-api-v0.1.0...google-cloud-maintenance-api-v0.1.1) (2025-07-23)
-
-
-### Documentation
-
-* Add missing comments for messages ([f955689](f955689))
-
-## 0.1.0 (2025-06-23)
```
With the fix in this PR, a package level changelog will only be created
if it is not present. An existing changelog will remain untouched.1 parent c7696a6 commit b511ec0
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
293 | | - | |
| 293 | + | |
294 | 294 | | |
295 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
296 | 299 | | |
297 | 300 | | |
298 | 301 | | |
| |||
0 commit comments