Commit Message Format
Commit messages must strictly adhere to the Conventional Commits specification to enable tooling to parse them.Commit Types
The following types are adopted from the Angular Commit Message Guidelines:| Type | Description |
|---|---|
| build | Changes affecting the build system or external dependencies |
| ci | Changes to CI configuration files and scripts |
| docs | Documentation only changes |
| feat | A new feature |
| fix | A bug fix |
| perf | A code change that improves performance |
| refactor | A code change with no externally visible changes |
| test | Adding missing tests or correcting existing tests |
Format Structure
Commit Message Rules
Write imperative descriptions
The description should be a complete imperative sentence:
- ✅ “Delete the Foo method from the Bar service”
- ❌ “Deletes the Foo method from the Bar service”
Add Git trailers
Format footers as valid Git trailers:
Use
BREAKING-CHANGE (with hyphen) instead of BREAKING CHANGE to ensure it’s a valid Git trailer.Additional Trailers
Issue Trailer
Every significant PR should reference at least one GitHub issue:RELNOTES Trailer
For release note text that isn’t a breaking change:Pull Request Format
The PR description populates the commit message when merged:- PR title → First line of commit message
- PR description body → Body and footers of commit message
Code Review Process
Use Reviewable
All code reviews are conducted using Reviewable.io. Read the Reviewable user guide, especially the section on Code review discussions.While reviews happen in Reviewable, PR merging is still done through the GitHub UI.
Review Workflow
Author responds
The author:
- Pushes code changes
- Responds to comments
- Marks comments as “Satisfied” when addressed
Comment Dispositions
- Blocking - Must be resolved before approval
- Non-blocking - Suggestions that don’t block approval
- Satisfied - Author has addressed the comment
- Working - Author is still working on a fix (use rarely)
Review Code Quickly
Prioritize keeping other engineers unblocked:Treat as Urgent
Code review is an urgent asynchronous task. Prioritize it over design docs, coding, and addressing your own PR comments.
Avoid Needless Blocking
- Suggest adding TODOs instead of fixing non-pressing issues
- Preemptively approve straightforward fixes
- Link to citations for style/readability issues
Code Authorship
Review Your Own Code First
Before adding reviewers:Code Style Guidelines
The following language-specific guidelines apply to all contributions.Pull Requests, Issues & Milestones
Pull Requests
- Every PR should be associated with an existing Issue
- If associated with an issue, the PR must have an
Issuetrailer in the commit message
Issues
Type
Each issue must have a type (e.g., Bug, Feature request)
Title
Titles must be self-contained and meaningful without parent context
Dependencies
Declare blocking relationships in the issue’s Relationships field
Milestones
- Only issues (not PRs) should be linked to milestones
- Process issues (not related to
srcfiles) have type “Process” and aren’t associated with milestones
Code Style
Detailed code style guidelines are organized by language and topic.General Principles
Thorough Testing
- Test the contract (public API), not implementation
- Use appropriate test doubles (fakes, mocks, stubs)
- Prefer more, smaller test cases
Code Quality
- Autoformat and lint all code
- Keep code free of compiler warnings
- Limit unnecessary third-party dependencies
Handling Compiler Warnings
Suppress if false alarm
If the code is safe and correct, suppress the warning with a comment explaining why.
Project Conventions
- Tests go in
src/test/tree - Test infrastructure used by multiple packages goes in
testingsubpackages insrc/main/(markedtestonly) - Public service APIs follow AIPs with noted exceptions
- Database access is restricted to internal API servers
- Database internal IDs must not be exposed outside internal APIs
- Protobuf messages for database rows end in
Details
Language-Specific Guidelines
Kotlin
Kotlin
- Follow Google Android Kotlin style guide
- Exception: Use 2 spaces instead of 4 for indentation
- Use Truth for test assertions
- Use ProtoTruth for protobuf assertions
- Prefer Kotlin DSL builders for protocol buffers
- Specify types explicitly except when obvious
- Use companion objects for constants
- Catch
StatusExceptionfrom RPCs immediately at call site
ktfmt with --google-styleC++
C++
- Follow Google C++ Style Guide
- Follow Abseil’s Tips of the Week
- Don’t rely on transitive includes
- Use
include-what-you-usetool
clang-format with --style=GoogleBazel BUILD and Starlark
Bazel BUILD and Starlark
- Follow Bazel BUILD style guide
- Follow .bzl style guide
- Don’t rely on transitive dependencies
- Include all directly referenced dependencies in
deps
BuildifierProtocol Buffers
Protocol Buffers
Follow Protocol Buffers style guide
Markdown
Markdown
- Follow Google Markdown Style Guide
- Maintain compatibility with GitHub Flavored Markdown and Gitiles
TODOs
Use TODO comments to point out desired improvements. Each TODO should be actionable, explaining how it can be resolved.Format
Next Steps
Testing Guide
Learn about testing procedures
Contributing
How to contribute to the project