Add script to speed up reviewing PRs adding a worktree.#21748
Conversation
|
Hi @jacob314, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this. We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines. Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed. Thank you for your understanding and for being a part of our community! |
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 enhances the developer experience for reviewing pull requests by introducing an automated helper script. This script streamlines the process of checking out a PR into a dedicated Git worktree, installing dependencies, building the project, and launching the automated review tool, thereby reducing manual setup time and promoting consistent review practices. Highlights
Changelog
Activity
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
|
|
Size Change: -4 B (0%) Total Size: 26 MB ℹ️ View Unchanged
|
|
Hi there! Thank you for your contribution to Gemini CLI. To improve our contribution process and better track changes, we now require all pull requests to be associated with an existing issue, as announced in our recent discussion and as detailed in our CONTRIBUTING.md. This pull request is being closed because it is not currently linked to an issue. Once you have updated the description of this PR to link an issue (e.g., by adding How to link an issue: Thank you for your understanding and for being a part of our community! |
There was a problem hiding this comment.
Code Review
This pull request introduces a new script, scripts/review.sh, to streamline the process of reviewing pull requests by automating the setup of a worktree. The CONTRIBUTING.md file is also updated to document this new script.
My review focuses on improving the maintainability and robustness of the new script. I've suggested using the project's existing npm run clean script instead of manually deleting directories, which will make the script more resilient to future changes in the project structure.
| echo "review: Clearing possibly stale node_modules..." | ||
| rm -rf node_modules | ||
| rm -rf packages/core/dist/ | ||
| rm -rf packages/cli/node_modules/ | ||
| rm -rf packages/core/node_modules/ |
There was a problem hiding this comment.
The script manually removes build artifacts and dependencies. This can be brittle and hard to maintain. For instance, if a new package with a build output directory is added, this script would need to be updated.
The project already provides a dedicated clean script (npm run clean) for this purpose. It's better to use this script as it's the single source of truth for cleaning the project. This will make the review script more robust and maintainable.
| echo "review: Clearing possibly stale node_modules..." | |
| rm -rf node_modules | |
| rm -rf packages/core/dist/ | |
| rm -rf packages/cli/node_modules/ | |
| rm -rf packages/core/node_modules/ | |
| echo "review: Cleaning the project..." | |
| npm run clean |
References
- Rely on project conventions to simplify code, instead of engineering for theoretical edge cases that the conventions are designed to prevent.
| exit 1 | ||
| fi | ||
| pr="$1" | ||
| model="${2:-gemini-3.1-pro-preview}" |
There was a problem hiding this comment.
feels weird to hardcode gemini 3.1
|
Hi there! Thank you for your contribution to Gemini CLI. To improve our contribution process and better track changes, we now require all pull requests to be associated with an existing issue, as announced in our recent discussion and as detailed in our CONTRIBUTING.md. This pull request is being closed because it is not currently linked to an issue. Once you have updated the description of this PR to link an issue (e.g., by adding How to link an issue: Thank you for your understanding and for being a part of our community! |
Summary
This script speeds up queuing manual review of PRs giving you a git worktree with the PR checked out locally and the review script run.
Run
scripts/review.sh <PR#>to test
Verify that you have a new worktree with the pr running locally and the /review-frontend script auto-started using the pro model.
Fixes #21757