-
Notifications
You must be signed in to change notification settings - Fork 7.8k
[Experiment DNM] Adds Gemini CLI to Github Actions #2718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: beta
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📋 Review Summary
This PR introduces a comprehensive set of GitHub Actions workflows powered by the Gemini CLI to automate various repository management tasks, including PR reviews, issue triage, and general assistance. The workflows are well-structured and the prompts are detailed, which is great.
🔍 General Feedback
- The workflows are very powerful and will be a great addition to the repository.
- The prompts for the Gemini CLI are well-written and provide clear instructions.
- I've made a few suggestions to improve the readability and maintainability of the workflow files, mainly by simplifying conditions and commands.
- I've also pointed out a few potential issues in the prompt files that could be improved.
- There is one unrelated change in a
pubspec.yaml
file that seems to be a mistake.
Overall, this is a great PR that will significantly improve the automation of this repository.
!contains(github.event.issue.body, '/review') && | ||
!contains(github.event.issue.body, '/triage') && | ||
( | ||
github.event.sender.type == 'User' && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 This condition is very complex and repeated across multiple workflows. To improve readability and maintainability, you can use the contains
function to simplify the author association check.
github.event.sender.type == 'User' && ( | |
( | |
github.event.sender.type == 'User' && | |
contains(['OWNER', 'MEMBER', 'COLLABORATOR'], github.event.issue.author_association) | |
) |
This can be applied to all the author association checks in this file.
(github.event_name == 'issue_comment' && | ||
contains(github.event.comment.body, '@gemini-cli /triage') && | ||
(github.event.comment.author_association == 'OWNER' || | ||
github.event.comment.author_association == 'MEMBER' || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 You can use the contains
function to simplify the author association check, making the condition more readable and maintainable.
github.event.comment.author_association == 'MEMBER' || | |
(github.event_name == 'issue_comment' && | |
contains(github.event.comment.body, '@gemini-cli /triage') && | |
contains(['OWNER', 'MEMBER', 'COLLABORATOR'], github.event.comment.author_association)) |
2. **Analyze Git History**: | ||
* Run `git log` to find the most recent commit to a `.dart` file within that project's directory made by a human (i.e., not a bot). | ||
* **Command**: | ||
```bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 The git command for finding the most recent commit might not be compatible with all git versions due to the negative lookahead in the author filter. A more compatible way to exclude bots is to use --invert-grep
. Also, the path globbing might not work as expected. It's better to run the command from the project root and specify the path.
```bash | |
git log -1 --author='bot' --invert-grep --pretty="format:%ad" --date=short -- path/to/project/**/*.dart |
You would need to replace path/to/project
with the actual path to the project. Or, if running from the project directory, just use .
as the path.
git log -1 --author='bot' --invert-grep --pretty="format:%ad" --date=short -- .
@@ -4,7 +4,7 @@ version: 1.0.0+1 | |||
resolution: workspace | |||
|
|||
environment: | |||
sdk: ^3.9.0-0 | |||
sdk: ^3.8.1-0 | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 This change downgrades the SDK constraint. Given the PR title, this seems unrelated and might be an accidental change. Please verify if this downgrade is intended.
Pre-launch Checklist
///
).