|
| 1 | +# Project Description |
| 2 | + |
| 3 | +This is the Ruby driver for the MongoDB database. It provides a Ruby interface for connecting to MongoDB, performing CRUD operations, and managing database connections. The API is standardized across all MongoDB drivers, via the specifications defined in the MongoDB Specifications repository: https://github.com/mongodb/specifications. |
| 4 | + |
| 5 | +# Project Structure |
| 6 | + |
| 7 | +The project is organized into the following directories: |
| 8 | + |
| 9 | +- `lib/`: the main codebase |
| 10 | +- `spec/`: RSpec tests for the project, and shared test data |
| 11 | +- `bin/`: executable scripts |
| 12 | +- `examples/`: example usage of the library |
| 13 | +- `gemfiles/`: Gemfile files for different usage scenarios (primarily testing, aside from standard.gemfile which is used for development and production) |
| 14 | +- `profile/`: profiling scripts and results |
| 15 | + |
| 16 | + |
| 17 | +# Code Reviews |
| 18 | + |
| 19 | +When reviewing code, focus on: |
| 20 | + |
| 21 | +## Security Critical Issues |
| 22 | +- Check for hardcoded secrets, API keys, or credentials |
| 23 | +- Check for instances of potential method call injection, dynamic code execution, symbol injection or other code injection vulnerabilities. |
| 24 | + |
| 25 | +## Performance Red Flags |
| 26 | +- Spot inefficient loops and algorithmic issues. |
| 27 | +- Check for memory leaks and resource cleanup. |
| 28 | + |
| 29 | +## Code Quality Essentials |
| 30 | +- Methods should be focused and appropriately sized. If a method is doing too much, suggest refactorings to split it up. |
| 31 | +- Use clear, descriptive naming conventions. |
| 32 | +- Avoid encapsulation violations and ensure proper separation of concerns. |
| 33 | +- All public classes, modules, and methods should have clear documentation in YARD format. |
| 34 | +- If `method_missing` is implemented, ensure that `respond_to_missing?` is also implemented. |
| 35 | +- Rubocop is used by this project to enforce code style. Always refer to the project's .rubocop.yml file for guidance on the project's style preferences. |
| 36 | + |
| 37 | +## Driver-specific Concerns |
| 38 | +- Look for code that might cause issues in a multi-threaded (or multi-fiber) environment. |
| 39 | + |
| 40 | +## Review Style |
| 41 | +- Be specific and actionable in feedback |
| 42 | +- Explain the "why" behind recommendations |
| 43 | +- Acknowledge good patterns when you see them |
| 44 | +- Ask clarifying questions when code intent is unclear |
| 45 | +- When possible, suggest that the pull request be labeled as a `bug`, a `feature`, or a `bcbreak` (a "backwards-compatibility break"). |
| 46 | +- PR's with no user-visible effect do not need to be labeled. |
| 47 | +- Do not review YAML files under the `spec/` directory; these are test fixtures shared between all drivers. |
| 48 | + |
| 49 | +Always prioritize security vulnerabilities and performance issues that could impact users. |
| 50 | + |
| 51 | +Always suggest changes to improve readability and testability. |
| 52 | + |
| 53 | +Be encouraging. |
| 54 | + |
0 commit comments