Thank you for your interest in contributing to cachkit! This document provides guidelines and information for contributors.
- Code of Conduct
- Getting Started
- Development Setup
- How to Contribute
- Pull Request Process
- Coding Standards
- Testing Guidelines
- Documentation
- Community
This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to ferrite.db@gmail.com.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/cachekit.git cd cachekit - Add the upstream remote:
git remote add upstream https://github.com/OxidizeLabs/cachekit.git
- Create a branch for your work:
git checkout -b feature/your-feature-name
- Rust toolchain: Install via rustup (stable channel)
- Git: For version control
- Make (optional): For using Makefile shortcuts
# Debug build
cargo build
# Release build
cargo build --release
# Build with all features
cargo build --all-features# Run all tests
cargo test
# Run specific test
cargo test test_name
# Run tests with output
cargo test -- --nocapture
# Run integration tests only
cargo test --test integration_testscargo benchBefore creating bug reports, please check existing issues to avoid duplicates. When filing a bug report, include:
- Clear title describing the issue
- Steps to reproduce the behavior
- Expected behavior vs. actual behavior
- Environment details (OS, Rust version, cachekit version)
- Relevant logs or error messages
- Minimal reproduction case if possible
Feature requests are welcome! Please:
- Check existing issues to avoid duplicates
- Describe the use case clearly
- Explain the expected behavior
- Consider implementation complexity
- Find or create an issue for the work you want to do
- Comment on the issue to let others know you're working on it
- Fork and branch from
main - Write your code following our coding standards
- Add tests for new functionality
- Update documentation as needed
- Submit a pull request
Look for issues labeled good first issue - these are curated for newcomers and typically have clear scope and guidance.
-
Ensure your code compiles without warnings:
cargo build --all-features
-
Run the full test suite:
cargo test -
Format your code:
cargo fmt
-
Run clippy and address any warnings:
cargo clippy -- -D warnings
-
Update documentation if you changed public APIs
-
Write a clear PR description that:
- References the related issue(s)
- Describes what changes were made and why
- Notes any breaking changes
- Includes testing instructions if relevant
-
Request review from maintainers
-
Address review feedback promptly
Use conventional commit format for PR titles:
feat: add new B+ tree implementationfix: resolve deadlock in lock managerdocs: update architecture documentationtest: add integration tests for recoveryrefactor: simplify buffer pool logicperf: optimize page serializationchore: update dependencies
- Follow the Rust API Guidelines
- Use
cargo fmtfor consistent formatting - Use
cargo clippyfor linting - Prefer explicit types over
impl Traitin public APIs
snake_casefor functions, variables, modulesPascalCasefor types, traits, enumsSCREAMING_SNAKE_CASEfor constants- Use descriptive names:
page_idnotpid,frame_idnotfid
- Define specific error types using
thiserror - Implement
Fromconversions between error types - Use
Result<T, DBError>as the primary return type - Log errors appropriately:
error!()for serious issues,warn!()for recoverable
- Use
parking_lot::RwLockfor performance-critical locks - Prefer
Arc<RwLock<T>>for shared mutable state - Document lock ordering to prevent deadlocks
- Use
AtomicU64for counters and IDs
- Document all public APIs with
///comments - Include examples in documentation where helpful
- Explain complex algorithms and invariants
- Keep documentation up to date with code changes
- Write tests for each public function
- Test both success and error paths
- Use descriptive test names:
test_buffer_pool_evicts_unpinned_pages - Mock external dependencies when appropriate
- Test complete workflows end-to-end
- Test transaction commit/abort scenarios
- Test recovery after simulated crashes
- Test concurrent access patterns
Consider using proptest for testing complex invariants.
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_feature_happy_path() {
// Test normal operation
}
#[test]
fn test_feature_error_condition() {
// Test error handling
}
}- Code comments: Explain "why", not "what"
- API docs: Document all public items
- Architecture docs: Update
docs/when making architectural changes - README: Keep getting started instructions current
- CHANGELOG: Add entries for notable changes
- GitHub Issues: For bugs and feature requests
- Discussions: For questions and general discussion
All contributors will be recognized in release notes. Significant contributions may be acknowledged in the README.
By contributing to cachekit, you agree that your contributions will be licensed under the same terms as the project (MIT or Apache-2.0, at your option).
Thank you for contributing to cachekit! Your efforts help make database technology more accessible and reliable.