Skip to content

fix(dart): do not delete CHANGELOG.md - #7817

Merged
brianquinlan merged 1 commit into
googleapis:mainfrom
brianquinlan:changelog
Oct 27, 2026
Merged

brianquinlan merged 1 commit into
googleapis:mainfrom
brianquinlan:changelog

Conversation

@brianquinlan

@brianquinlan brianquinlan commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Fixes a bug where librarian generate deletes CHANGELOG.md unless it is explicitly in keep in librarian.yaml.

@brianquinlan
brianquinlan requested a review from a team as a code owner October 26, 2026 21:07

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 coryan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?).

@brianquinlan

Copy link
Copy Markdown
Contributor Author

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 CHANGELOG.md is a requirement [1] for Dart packages - it is displayed directly in the package manager UI, e.g., https://pub.dev/packages/google_cloud_storage/changelog

I'll look into generating CHANGELOG.md from scratch on bump before landing this change.

[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.

@brianquinlan

Copy link
Copy Markdown
Contributor Author

Actually, I probably still want to avoid deleting CHANGELOG.md in generate because that will cause it to undo the work done by bump (and make for odd git history ;-))

@coryan

coryan commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Actually, I probably still want to avoid deleting CHANGELOG.md in generate because that will cause it to undo the work done by bump (and make for odd git history ;-))

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.

@brianquinlan
brianquinlan merged commit 4f027cb into googleapis:main Oct 27, 2026
49 of 50 checks passed
@brianquinlan
brianquinlan deleted the changelog branch October 27, 2026 21:00
zhumin8 pushed a commit that referenced this pull request Nov 3, 2026
🤖 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants