feat(dart): implement bump - #6989
Conversation
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for bumping Dart packages in the workspace, utilizing dart-apitool to recommend version updates, updating pubspec.yaml and CHANGELOG.md files, and managing dependencies. It also refactors common git operations (FormatTagName and HasChangesIn) into the internal/git package. The review feedback highlights a bug in the manual version increment logic that prevents file updates and changelog generation, as well as a potential file collision issue when creating temporary reports in os.TempDir().
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for bumping Dart packages, adding dependency sorting, pubspec updates, and changelog generation, alongside refactoring git helper functions into the git package. The review feedback highlights several critical issues: potential corruption of nested dependencies in pubspec.yaml due to line-by-line replacement, a potential crash in recommendedVersion when a package is not yet published, a security/collision risk from using a predictable temporary file path, and incorrect matching of nested version fields. Additionally, a style improvement was suggested to remove an unnecessary else block after a return statement.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for bumping Dart packages in the workspace. It adds a new internal/librarian/dart package that implements the bumping logic, including dependency sorting, version recommendations using dart-apitool, and updating pubspec.yaml and CHANGELOG.md. It also refactors common Git helper functions into internal/git. The review feedback highlights several improvement opportunities: ensuring the version: field update in pubspec.yaml only matches top-level keys, avoiding indented success flows after error checks, removing an unused newDeps map, and using os.CreateTemp to safely generate unique temporary files.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Brian Quinlan <bquinlan@google.com>
…brarian into design_doc_ideas
|
I'm away all next week so there is no hurry for this review. |
librarian bumpworks differently for Dart compared to other languages:bumpfor Dart does not work on single librariesbumpfor Dart uses analysis of the package interface as a heuristic to determine how much to bump the versionbumpalso updates CHANGELOG.md and dependency constraintsExpected publishing workflow:
Refactors:
FormatTagNameandHasChangesInto internal/librarian/bump.go from internal/git/git.goRepository Package Release Algorithm (excluding edge cases)
dart-apitoolto determine the recommended next version.pubspec.yaml.CHANGELOG.md.dependencies:section of each dependent package.cfg.Default.Dart.Packagesif the package has an entry there.