Skip to content

Commit 93d241b

Browse files
[ci] Add Gemini Code Assist review config (#9632)
This adds initial configuration files for [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code) in preparation for turing it on for this repository on a trial basis. These config files are based on [the official docs](https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github) It also adds a note to the PR template to provide some notice/guidance to contributors about how to use automated feedback, to clarify the role of the automated reviews and hopefully minimize potential issues in case the bot leaves incorrect feedback.
1 parent 207859e commit 93d241b

File tree

5 files changed

+63
-15
lines changed

5 files changed

+63
-15
lines changed

.gemini/config.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Minimize verbosity.
2+
have_fun: false
3+
code_review:
4+
# For now, use the default of MEDIUM for testing. Based on desired verbosity,
5+
# we can change this to LOW or HIGH in the future.
6+
comment_severity_threshold: MEDIUM
7+
pull_request_opened:
8+
# Explicitly set help to false in case the default changes in the future, as
9+
# having a help message on every PR would be spammy.
10+
help: false
11+
# These tend to be verbose, and since we expect PR authors to clearly
12+
# describe their PRs this would be at best duplicative.
13+
summary: false

.gemini/styleguide.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Flutter Packages Style Guide
2+
3+
## Introduction
4+
5+
This style guide outlines the coding conventions for contributions to the
6+
flutter/packages repository.
7+
8+
## Style Guides
9+
10+
Code should follow the relevant style guides, and use the correct
11+
auto-formatter, for each language, as described in
12+
[the repository contributing guide's Style section](https://github.com/flutter/packages/blob/main/CONTRIBUTING.md#style).
13+
14+
## Best Practices
15+
16+
- Code should follow the guidance and principles described in
17+
[the flutter/packages contribution guide](https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md).
18+
- Code should be tested. Changes to plugin packages, which include code written
19+
in C, C++, Java, Kotlin, Objective-C, or Swift, should have appropriate tests
20+
as described in [the plugin test guidance](https://github.com/flutter/flutter/blob/master/docs/ecosystem/testing/Plugin-Tests.md).
21+
- PR descriptions should include the Pre-Review Checklist from
22+
[the PR template](https://github.com/flutter/packages/blob/main/.github/PULL_REQUEST_TEMPLATE.md),
23+
with all of the steps completed.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@
1818

1919
If you need help, consider asking for advice on the #hackers-new channel on [Discord].
2020

21+
**Note**: The Flutter team is currently trialing the use of
22+
[Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
23+
Comments from the `gemini-code-assist` bot should not be taken as authoritative
24+
feedback from the Flutter team. If you find its comments useful you can
25+
update your code accordingly, but if you are unsure or disagree with the
26+
feedback, please feel free to wait for a Flutter team member's review for
27+
guidance on which automated comments should be addressed.
28+
2129
[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
2230

2331
<!-- Links -->

script/tool/lib/src/common/file_filters.dart

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,24 @@
88
/// commands that are only affected by package code.
99
bool isRepoLevelNonCodeImpactingFile(String path) {
1010
return <String>[
11-
'AUTHORS',
12-
'CODEOWNERS',
13-
'CONTRIBUTING.md',
14-
'LICENSE',
15-
'README.md',
16-
// This deliberate lists specific files rather than excluding the whole
17-
// .github directory since it's better to have false negatives than to
18-
// accidentally skip tests if something is later added to the directory
19-
// that could affect packages.
20-
'.github/PULL_REQUEST_TEMPLATE.md',
21-
'.github/dependabot.yml',
22-
'.github/labeler.yml',
23-
'.github/post_merge_labeler.yml',
24-
'.github/workflows/pull_request_label.yml',
25-
].contains(path);
11+
'AUTHORS',
12+
'CODEOWNERS',
13+
'CONTRIBUTING.md',
14+
'LICENSE',
15+
'README.md',
16+
// This deliberate lists specific files rather than excluding the whole
17+
// .github directory since it's better to have false negatives than to
18+
// accidentally skip tests if something is later added to the directory
19+
// that could affect packages.
20+
'.github/PULL_REQUEST_TEMPLATE.md',
21+
'.github/dependabot.yml',
22+
'.github/labeler.yml',
23+
'.github/post_merge_labeler.yml',
24+
'.github/workflows/pull_request_label.yml',
25+
].contains(path) ||
26+
// This directory only affects automated code reviews, so cannot affect
27+
// any package tests.
28+
path.startsWith('.gemini/');
2629
}
2730

2831
/// Returns true for native (non-Dart) code files, for use in command-ignored-

script/tool/test/xcode_analyze_command_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@ packages/package_a/$file
599599
gitProcessRunner.mockProcessesForExecutable['git-diff'] =
600600
<FakeProcessInfo>[
601601
FakeProcessInfo(MockProcess(stdout: '''
602+
.gemini/config.yaml
602603
README.md
603604
CODEOWNERS
604605
packages/package_a/CHANGELOG.md

0 commit comments

Comments
 (0)