Repository navigation
fix(dart): do not delete CHANGELOG.md - #7817
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a mechanism to preserve the CHANGELOG.md file when cleaning the output directory for Dart libraries. It defines a changelogFile constant and implements a Keep function in the dart package to dynamically append CHANGELOG.md to the list of preserved files if it exists. Additionally, unit tests for the Keep function have been added, and the library cleaning process in internal/librarian/generate.go has been updated to utilize this new function. There are no review comments, so no feedback is provided.
coryan
left a comment
There was a problem hiding this comment.
We would like to avoid files that work as both inputs and outputs. That leads to brittle workflows where one may be tempted to tweak a file and expect the generator to preserve the teaks. An append-only file seems less terrible than your typical input/output files. I would encourage you to consider alternatives such as (1) not have a CHANGELOG.md (the generated change logs tend to be pretty terrible anyway), or (2) generate the CHANGELOG.md from scratch (maybe from some git history?).
Having a I'll look into generating CHANGELOG.md from scratch on [1] It is soft requirement - the package manager generates a warning at upload time and will reduce the package's "score" that is shown to the user. |
|
Actually, I probably still want to avoid deleting |
No worries. I approved this PR because I thought you may want to. We can always change our mind and do something different in the future. |
🤖 I have created a release *beep* *boop* --- ## [0.51.0](v0.50.0...v0.51.0) (2026-10-31) ### Features * **dart:** support per-call retry ([#7787](#7787)) ([24344b6](24344b6)) * **sidekick/rust:** convert proto2 optionals ([#7867](#7867)) ([c9629b6](c9629b6)) * **sidekick:** mark `proto2` optional fields ([#7865](#7865)) ([b91651f](b91651f)) ### Bug Fixes * **dart:** do not delete CHANGELOG.md ([#7817](#7817)) ([4f027cb](4f027cb)) * **dart:** restore package description position ([#7370](#7370)) ([bac42b7](bac42b7)) * **internal/librarian/dart:** set initial `librarian.yaml` version on `bump` ([#7808](#7808)) ([9f9042e](9f9042e)) * **internal/serviceconfig:** add title for shopping merchant reviews v1 ([#7805](#7805)) ([bf53ece](bf53ece)) * **internal/serviceconfig:** add title for shopping merchant reviews v1 ([#7805](#7805)) ([affbeb4](affbeb4)) * **sidekick/swift:** use fast WKTAny helpers ([#7826](#7826)) ([b6c93c5](b6c93c5)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Fixes a bug where
librarian generatedeletesCHANGELOG.mdunless it is explicitly inkeepinlibrarian.yaml.