common: Add REVIEW.md with code review guidelines#63
common: Add REVIEW.md with code review guidelines#63cgwalters merged 1 commit intobootc-dev:mainfrom
Conversation
Add a REVIEW.md file capturing code review expectations derived from analysis of PR feedback across the bootc-dev organization. This includes guidance on testing, code quality, commit organization, architecture decisions, and Rust-specific patterns. Update AGENTS.md to reference REVIEW.md, encouraging AI agents to spawn review subagents using these guidelines after completing work. Assisted-by: OpenCode (Sonnet 4) Signed-off-by: Colin Walters <walters@verbum.org>
Summary of ChangesHello @cgwalters, 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 introduces a foundational document, Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive REVIEW.md file with code review guidelines and updates AGENTS.md to reference it. The guidelines are well-structured, clear, and cover important aspects of software development from testing to architecture. This is a valuable addition for promoting consistency and quality. I've included a couple of minor grammatical suggestions for the documentation.
|
One thing I am strongly considering is dropping Gemini Code Assist from our repositories, and going to a model where a human initiates review using our common guidelines, using their own tools (and AI budget). I think an important thing if we do this though is to ensure humans can easily ingest an AI-generated review that is targeting the GH Checks API and tweak it where necessary. This needs some careful consideration - we should make it clear when the human is effectively just passing through AI content versus having performed some edits. Maybe the review "header" has Then if they do any editing or research, they can drop that prefix. (Again, the "using the GH Checks API" is I think quite important for large PRs to ensure the comments are inline next to the relevant code) |
|
I gave this prompt to OpenCode+Opus 4.5:
Plus some more iteration, it came up with this summary...and my conclusion is we could likely get by with AI-assisted human review by default, and don't need the Gemini Code Review app. AI generated content follows Gemini Code Review vs OpenCode (Opus): Comparative AnalysisThis document summarizes findings from analyzing 20+ recent PRs in the bootc-dev/bootc repository to compare Gemini Code Review's catches against what our REVIEW.md guidelines can detect. Executive SummaryOur REVIEW.md guidelines are sufficient to catch all high-value issues Gemini found. The gap is not in the guidelines themselves, but in consistent application. When subagents were explicitly asked to apply the guidelines to specific code, they found 5/5 issues that Gemini had caught and received +1 reactions from maintainers. Methodology
High-Value Gemini Catches That Received +1 ReactionsCategories of Validated Catches
The 5 Cases Selected for Replication
Replication ResultsCan Our Guidelines Catch These Issues?
Result: 5/5 (100%) - All issues were independently found by subagents using only REVIEW.md guidelines. Subagent Findings DetailPR #1502: Missing
|
| Guideline | What It Catches |
|---|---|
| "Don't swallow errors silently" | Ignored Results, missing ? operators |
| "Extract magic numbers/strings into constants" | Forces attention on format strings during refactoring |
| "Handle edge cases explicitly" | Boundary conditions, off-by-one errors |
| "Document limitations and caveats" | Undocumented behavioral changes |
| "Shell scripts should be under 50 lines" + scrutiny | Shell conditional bugs |
The Real Gap
The issue is not what our guidelines say, but consistent application:
- Gemini checks every line, every time - Humans and AI reviewers can miss things when not focused
- Gemini is particularly attentive to string manipulation - Format strings, paths, configuration values
- Gemini systematically compares old vs new - Easier to spot when refactoring drops something
Recommendations
No Major Guideline Changes Needed
The current REVIEW.md is sufficient. However, consider adding explicit callouts for:
-
Format string verification - "When refactoring code that constructs strings (especially command lines, paths, URLs), verify all delimiters and separators are preserved"
-
Boundary condition checklist - "For array/slice access, verify:
>vs>=,<vs<=, off-by-one in loops" -
Shell boolean patterns - "For boolean-like shell variables, use explicit value comparison (
= "1") rather than empty/non-empty tests (-n)"
Process Recommendations
- Use Gemini as a complement, not replacement - It catches things humans miss through fatigue
- Trust +1'd Gemini comments - When maintainers validate a catch, it's worth learning from
- Gemini is less reliable for Rust-specific issues - The compiler handles most of those anyway
Conclusion
Our REVIEW.md guidelines are comprehensive enough to catch all the high-value issues Gemini found. The value Gemini provides is in consistent, tireless application of review principles to every line of every PR. When our guidelines are explicitly and carefully applied (as the subagents did), they produce equivalent results.
The best approach is to use both: Gemini for consistent coverage, human/AI reviewers for deeper architectural and design feedback that requires context beyond the immediate diff.
Add a REVIEW.md file capturing code review expectations derived from analysis of PR feedback across the bootc-dev organization. This includes guidance on testing, code quality, commit organization, architecture decisions, and Rust-specific patterns.
Update AGENTS.md to reference REVIEW.md, encouraging AI agents to spawn review subagents using these guidelines after completing work.
Assisted-by: OpenCode (Opus 4.5)