Skip to content

Commit ebad570

Browse files
authored
feat(#168): add support for gemini 3 pro preview (#169)
1 parent ce2afef commit ebad570

11 files changed

+1336
-251
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Review for PR: PR-1-trivial
2+
3+
> Sample 1
4+
5+
> Using model: gemini-3-pro-preview
6+
7+
8+
## 🦉 lgtm Review
9+
10+
> **Score:** LGTM 👍
11+
12+
### 🔍 Summary
13+
14+
The pull request successfully updates the project boilerplate via cruft and modernizes the pre-commit configuration by renaming hook stages to their standard names (`pre-push` and `pre-commit`). These changes ensure compatibility with recent pre-commit versions. The PR is clean and ready to be merged.
15+
16+
17+
18+
<details><summary>More information</summary>
19+
20+
- **Id**: `612143f1a5d9494bb91afaa1d20547a0`
21+
- **Model**: `gemini-3-pro-preview`
22+
- **Created at**: `2025-11-19T09:08:15.252111+00:00`
23+
24+
25+
<details><summary>Usage summary</summary>
26+
27+
- **Request count**: `2`
28+
- **Request tokens**: `5,786`
29+
- **Response tokens**: `4,820`
30+
- **Total tokens**: `10,606`
31+
32+
</details>
33+
34+
35+
> See the [📚 lgtm-ai repository](https://github.com/elementsinteractive/lgtm-ai) for more information about lgtm.
36+
37+
</details>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Review for PR: PR-1-trivial
2+
3+
> Sample 2
4+
5+
> Using model: gemini-3-pro-preview
6+
7+
8+
## 🦉 lgtm Review
9+
10+
> **Score:** LGTM 👍
11+
12+
### 🔍 Summary
13+
14+
This PR correctly updates the cruft state and modernizes the pre-commit configuration by renaming stages to their explicit hook names (`pre-commit` and `pre-push`), which aligns with recent best practices to avoid deprecation warnings. The changes are straightforward and ready to merge.
15+
16+
17+
18+
<details><summary>More information</summary>
19+
20+
- **Id**: `ee113e01ae8d443b9730a3c9a51df2d7`
21+
- **Model**: `gemini-3-pro-preview`
22+
- **Created at**: `2025-11-19T09:08:57.231798+00:00`
23+
24+
25+
<details><summary>Usage summary</summary>
26+
27+
- **Request count**: `2`
28+
- **Request tokens**: `5,786`
29+
- **Response tokens**: `2,745`
30+
- **Total tokens**: `8,531`
31+
32+
</details>
33+
34+
35+
> See the [📚 lgtm-ai repository](https://github.com/elementsinteractive/lgtm-ai) for more information about lgtm.
36+
37+
</details>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Review for PR: PR-1-trivial
2+
3+
> Sample 3
4+
5+
> Using model: gemini-3-pro-preview
6+
7+
8+
## 🦉 lgtm Review
9+
10+
> **Score:** LGTM 👍
11+
12+
### 🔍 Summary
13+
14+
The PR updates the cruft state and corrects the pre-commit configuration to use the standard git hook names (`pre-push` and `pre-commit`). The changes are straightforward and look correct.
15+
16+
17+
18+
<details><summary>More information</summary>
19+
20+
- **Id**: `6d0567a5e96d41f580c9be2ebd2e8bb6`
21+
- **Model**: `gemini-3-pro-preview`
22+
- **Created at**: `2025-11-19T09:09:44.341436+00:00`
23+
24+
25+
<details><summary>Usage summary</summary>
26+
27+
- **Request count**: `2`
28+
- **Request tokens**: `5,786`
29+
- **Response tokens**: `3,631`
30+
- **Total tokens**: `9,417`
31+
32+
</details>
33+
34+
35+
> See the [📚 lgtm-ai repository](https://github.com/elementsinteractive/lgtm-ai) for more information about lgtm.
36+
37+
</details>
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Review for PR: PR-2-quality
2+
3+
> Sample 1
4+
5+
> Using model: gemini-3-pro-preview
6+
7+
8+
## 🦉 lgtm Review
9+
10+
> **Score:** Nitpicks 🤓
11+
12+
### 🔍 Summary
13+
14+
The refactoring successfully decouples formatting logic from the GitLab client, introducing a cleaner `ReviewFormatter` protocol. This improves maintainability and extensibility. However, the new `TerminalFormatter` lacks test coverage, and the Markdown formatter produces redundant location information when used for inline comments. Addressing these points will solidify the quality of the PR.
15+
16+
17+
**Specific Comments:**
18+
19+
- #### 🦉 ✨ Quality
20+
21+
> **Severity:** MEDIUM 🟡
22+
23+
24+
`````python
25+
def format_comment(self, comment: ReviewComment) -> str:
26+
return f"🦉 **[{comment.category}]** {SEVERITY_MAP[comment.severity]} `{comment.new_path}:{comment.line_number}` {comment.comment}"
27+
`````
28+
29+
30+
Since this formatter is used for inline comments in GitLab (where the file and line are already evident from the UI context), including `{comment.new_path}:{comment.line_number}` creates redundancy.
31+
32+
Consider modifying the formatter or the client usage to avoid duplicating location information in inline comments, while preserving it for the summary section where it is needed. You might need to adjust the `ReviewFormatter` protocol or how the `format_comment` method is implemented/used.
33+
34+
35+
36+
37+
- #### 🦉 🧪 Testing
38+
39+
> **Severity:** MEDIUM 🟡
40+
41+
42+
`````python
43+
class TerminalFormatter(ReviewFormatter[Panel | Layout]):
44+
`````
45+
46+
47+
The `TerminalFormatter` class is new but lacks corresponding tests.
48+
49+
Even if it handles visual output, basic tests should be added to verify that `format_summary_section` and `format_comments_section` execute without errors and that mappings (like `SCORE_MAP`) are correctly accessed.
50+
51+
52+
53+
54+
55+
56+
57+
58+
<details><summary>More information</summary>
59+
60+
- **Id**: `0abb42766c014b60a2ccfed2d842810c`
61+
- **Model**: `gemini-3-pro-preview`
62+
- **Created at**: `2025-11-19T09:11:56.547066+00:00`
63+
64+
65+
<details><summary>Usage summary</summary>
66+
67+
- **Request count**: `2`
68+
- **Request tokens**: `76,422`
69+
- **Response tokens**: `11,077`
70+
- **Total tokens**: `87,499`
71+
72+
</details>
73+
74+
75+
> See the [📚 lgtm-ai repository](https://github.com/elementsinteractive/lgtm-ai) for more information about lgtm.
76+
77+
</details>
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# Review for PR: PR-2-quality
2+
3+
> Sample 2
4+
5+
> Using model: gemini-3-pro-preview
6+
7+
8+
## 🦉 lgtm Review
9+
10+
> **Score:** Nitpicks 🤓
11+
12+
### 🔍 Summary
13+
14+
The refactoring correctly implements the Strategy pattern to decouple formatting from the client logic, which is a significant improvement for maintainability and extensibility. However, I identified a UX regression in the GitLab inline comments where file paths and line numbers are redundantly displayed. There are also a few minor stylistic adjustments regarding naming conventions and string formatting. Addressing the redundancy issue is important to maintain a clean review interface.
15+
16+
17+
**Specific Comments:**
18+
19+
- #### 🦉 ✨ Quality
20+
21+
> **Severity:** MEDIUM 🟡
22+
23+
24+
`````python
25+
gitlab_comment = {
26+
"body": self.formatter.format_comment(review_comment),
27+
"position": position,
28+
}
29+
`````
30+
31+
32+
The `MarkDownFormatter.format_comment` method currently appends the file path and line number to the comment text. When used in `GitlabClient` for inline comments (discussions), this information is redundant as the UI already places the comment on the specific line.
33+
34+
In the previous implementation, this information was omitted for inline comments.
35+
Please update the `ReviewFormatter` protocol and implementations (e.g., add a `include_context` boolean flag) to allow generating comment bodies without the location prefix for this use case.
36+
37+
38+
39+
`````python
40+
gitlab_comment = {
41+
# TODO: Update formatter to support excluding context (path/line) for inline comments
42+
"body": self.formatter.format_comment(review_comment, include_context=False),
43+
"position": position,
44+
}
45+
`````
46+
47+
48+
49+
50+
- #### 🦉 ✨ Quality
51+
52+
> **Severity:** LOW 🔵
53+
54+
55+
`````python
56+
class MarkDownFormatter(ReviewFormatter[str]):
57+
`````
58+
59+
60+
Nitpick: The standard casing is `Markdown`, not `MarkDown`. Consider renaming the class to `MarkdownFormatter` to follow common conventions.
61+
62+
63+
64+
`````suggestion
65+
class MarkdownFormatter(ReviewFormatter[str]):
66+
`````
67+
68+
69+
70+
71+
- #### 🦉 ✨ Quality
72+
73+
> **Severity:** LOW 🔵
74+
75+
76+
`````python
77+
def format_summary_section(self, review: Review, comments: list[ReviewComment] | None = None) -> str:
78+
header = textwrap.dedent(f"""
79+
🦉 **lgtm Review**
80+
81+
> **Score:** {self._format_score(review.review_response.score)}
82+
83+
**Summary:**
84+
85+
""")
86+
`````
87+
88+
89+
The current usage of `textwrap.dedent` with a starting newline inside the triple quotes will result in a leading newline in the output string.
90+
```python
91+
header = textwrap.dedent(f"""
92+
```
93+
It is cleaner to escape the first newline to ensure the string starts immediately.
94+
95+
96+
97+
`````suggestion
98+
def format_summary_section(self, review: Review, comments: list[ReviewComment] | None = None) -> str:
99+
header = textwrap.dedent(f"""\
100+
🦉 **lgtm Review**
101+
102+
> **Score:** {self._format_score(review.review_response.score)}
103+
104+
**Summary:**
105+
106+
""")
107+
`````
108+
109+
110+
111+
112+
113+
114+
115+
116+
<details><summary>More information</summary>
117+
118+
- **Id**: `683063f847fb4be6933398f3d398e000`
119+
- **Model**: `gemini-3-pro-preview`
120+
- **Created at**: `2025-11-19T09:13:59.976358+00:00`
121+
122+
123+
<details><summary>Usage summary</summary>
124+
125+
- **Request count**: `2`
126+
- **Request tokens**: `77,025`
127+
- **Response tokens**: `10,233`
128+
- **Total tokens**: `87,258`
129+
130+
</details>
131+
132+
133+
> See the [📚 lgtm-ai repository](https://github.com/elementsinteractive/lgtm-ai) for more information about lgtm.
134+
135+
</details>

0 commit comments

Comments
 (0)