Conversation
Summary of ChangesHello, 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 significantly refines the Highlights
Changelog
Using Gemini Code AssistThe 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
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 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
|
GitHub's GraphQL API returns "gemini-code-assist" while the REST API returns "gemini-code-assist[bot]" for the same GitHub App. The bot_username? check now strips the [bot] suffix from both sides before comparing, so bot reviews are correctly filtered regardless of which API sourced the author login. This was causing the review sweep to flag all gemini-code-assist activity as actionable findings (25 false positives). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request enhances the reap_dead_worktrees! functionality to also clean up worktrees associated with abandoned (closed but not merged) pull requests. The logic has been thoughtfully refactored to introduce a generic closed_prs_for_branch helper, which is then used by more specific finders for merged and abandoned PRs. The bot_username? check has also been made more robust to handle inconsistencies between GitHub's APIs. Additionally, new linter configurations have been added for Biome, ERB-Lint, RuboCop, and Ruff, which will help maintain code quality and consistency across the project. The accompanying tests are thorough and cover the new logic well. I've left a suggestion to further improve performance and readability by optimizing a helper method.
| def bot_username?( author: ) | ||
| config.review_bot_usernames.any? { it.downcase == author.to_s.downcase } | ||
| normalised = author.to_s.downcase.delete_suffix( "[bot]" ) | ||
| config.review_bot_usernames.any? { it.downcase.delete_suffix( "[bot]" ) == normalised } |
There was a problem hiding this comment.
This implementation correctly handles the different bot username formats. However, it re-processes the config.review_bot_usernames array on every call by iterating and normalizing each entry. This can be inefficient if the list is large or the method is called frequently.
To improve performance and readability, consider normalizing and memoizing the list of bot usernames once. You could introduce a private helper method for this.
For example:
# In lib/carson/runtime/review/gate_support.rb
def bot_username?(author:)
normalised_author = author.to_s.downcase.delete_suffix("[bot]")
normalised_bot_usernames.include?(normalised_author)
end
private
def normalised_bot_usernames
@normalised_bot_usernames ||= config.review_bot_usernames.map { |name| name.downcase.delete_suffix("[bot]") }.to_set
endUsing a Set here provides fast lookups, which is ideal for this kind of check.
The cop produces mixed tabs+spaces when correcting outdented private keywords with tab-based indentation. The 3 excluded files follow the same outdent convention as the rest of the codebase but trigger a tab-width calculation bug. Also sets IndentationWidth: 1 on the cop to prevent similar issues in new files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
d18e55a to
92c99bb
Compare
The Carson template sync wiped the IndentationWidth and file exclusions that PR #266 added. Re-apply them so CI passes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The Carson template sync wiped the IndentationWidth and file exclusions that PR #266 added. Re-apply them so CI passes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
No description provided.