Skip to content

Conversation

@ldetmer
Copy link
Contributor

@ldetmer ldetmer commented Dec 23, 2025

Add logic to generic release command that if --all flag is specified only release libraries if a change has been made since the previous release.

Fix #3327

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ldetmer, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the library release mechanism by introducing an intelligent check to determine if a library has undergone any changes since its last release. This ensures that when a full release is triggered (e.g., with the --all flag), only those libraries with actual modifications are processed, thereby optimizing the release pipeline and preventing redundant operations. The changes involve refactoring core release functions, integrating Git-based change detection, and updating test suites to reflect this new conditional behavior.

Highlights

  • Conditional Library Release: Implemented logic to prevent releasing libraries if no changes have occurred since the last release, specifically when the --all flag is used during the release process.
  • Git Integration for Change Detection: Introduced new functionality to check for changes within a library's source path by comparing against the last Git release tag, leveraging githelpers for repository interactions.
  • Refactored Release Functions: The ReleaseLibrary function in the Rust internal package was refactored to directly accept the source path, and the deriveSrcPath helper was made public as DeriveSrcPath.
  • Enhanced Release Command Validation: Added a check to ensure the Release.Config field is not empty and that the Git working directory is clean before initiating a release, improving robustness.
  • Updated Test Coverage: Expanded test cases to cover scenarios where libraries are conditionally released or skipped, and added tests for missing release configuration and Git repository setup.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

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

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 adds logic to only release libraries that have changed since the last release tag. The implementation is sound and includes updated tests to cover the new git-based logic. I've identified a few areas for improvement: a redundant check, a logic issue where single-library releases are checked for changes (which seems to contradict the PR description), and a potential problem with how empty library paths are handled. My detailed comments provide suggestions to address these points.

@ldetmer
Copy link
Contributor Author

ldetmer commented Dec 23, 2025

/gemini review

Copy link
Contributor

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

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 valuable enhancement to the release process by adding logic to only release libraries that have changed since the last tag when using the --all flag. The implementation is solid, leveraging git history to determine changes. The refactoring of source path derivation and function signatures across multiple files has improved code organization and clarity. The accompanying test changes are comprehensive, using a real git repository to validate the new functionality, which significantly increases confidence in the changes. Overall, this is a well-executed change.

@codecov
Copy link

codecov bot commented Dec 23, 2025

Codecov Report

❌ Patch coverage is 71.42857% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.78%. Comparing base (fb067a8) to head (e91d47c).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
internal/librarian/release.go 68.42% 7 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3339      +/-   ##
==========================================
+ Coverage   80.70%   80.78%   +0.08%     
==========================================
  Files         163      163              
  Lines       13920    14032     +112     
==========================================
+ Hits        11234    11336     +102     
- Misses       2098     2100       +2     
- Partials      588      596       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ldetmer ldetmer marked this pull request as ready for review December 23, 2025 18:49
@ldetmer ldetmer requested a review from a team as a code owner December 23, 2025 18:49
@ldetmer ldetmer merged commit bd087bc into main Dec 23, 2025
11 of 12 checks passed
@ldetmer ldetmer deleted the release-lib branch December 23, 2025 20:55
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.

librarian[release]: should only perform release if code has changed when running release --all

2 participants