title: "Contribution Guide" description: "Step-by-step guide for making contributions to the Navius project" category: "Contributing" tags: ["contributing", "development", "workflow", "guide", "pull request"] last_updated: "April 5, 2025" version: "1.0"
Contributing Guide
Overview
Thank you for your interest in contributing to the Navius project! This guide will walk you through the process of making contributions, from setting up your development environment to submitting your changes for review.
Prerequisites
Before you begin, ensure you have the following installed:
- Rust (latest stable version)
- Git
- A code editor (we recommend VS Code with the Rust extension)
- Docker (for running integration tests)
- PostgreSQL (for local development)
Getting Started
1. Fork the Repository
- Visit the Navius repository
- Click the "Fork" button in the top-right corner
- Clone your fork to your local machine:
git clone https://github.com/YOUR_USERNAME/navius.git cd navius
2. Set Up the Development Environment
-
Add the original repository as an upstream remote:
git remote add upstream https://github.com/example/navius.git
-
Install project dependencies:
cargo build
-
Set up the database:
./scripts/setup_db.sh
-
Run the test suite to make sure everything is working:
cargo test
Making Changes
1. Create a Feature Branch
Always create a new branch for your changes:
git checkout -b feature/your-feature-name
Use a descriptive branch name that reflects the changes you're making.
2. Development Workflow
- Make your changes in small, focused commits
- Follow our coding standards
- Include tests for your changes
- Update documentation as needed
Code Style
- Run
cargo fmt
before committing to ensure your code follows our style guidelines - Use
cargo clippy
to catch common mistakes and improve your code
Testing
- Write unit tests for all new functions
- Create integration tests for API endpoints
- Run tests with
cargo test
before submitting your changes
3. Keep Your Branch Updated
Regularly sync your branch with the upstream repository:
git fetch upstream
git rebase upstream/main
Resolve any conflicts that arise during the rebase.
Submitting Your Contribution
1. Prepare Your Changes
Before submitting, make sure:
- All tests pass:
cargo test
- Code passes linting:
cargo clippy
- Your code is formatted:
cargo fmt
- You've added/updated documentation
2. Create a Pull Request
-
Push your changes to your fork:
git push origin feature/your-feature-name
-
Go to the Navius repository
-
Click "Pull Requests" and then "New Pull Request"
-
Select your fork and the feature branch containing your changes
-
Provide a clear title and description for your pull request:
- What changes does it introduce?
- Why are these changes necessary?
- How do these changes address the issue?
- Any specific areas you'd like reviewers to focus on?
-
Link any related issues by including "Fixes #issue-number" or "Relates to #issue-number" in the description
3. Code Review Process
- Wait for the CI/CD pipeline to complete
- Address any feedback from reviewers
- Make requested changes in new commits
- Push the changes to the same branch
- Mark resolved conversations as resolved
See our Code Review Process for more details.
Types of Contributions
Bug Fixes
- Check if the bug is already reported in the issues
- If not, create a new issue describing the bug
- Follow the steps above to submit a fix
Features
- For significant features, open an issue to discuss the proposal first
- Once consensus is reached, implement the feature
- Include comprehensive tests and documentation
Documentation
- For typos and minor corrections, you can edit directly on GitHub
- For significant changes, follow the standard contribution process
- Follow our Documentation Standards
Local Development Tips
Running the Application
cargo run
Visit http://localhost:8080
to see the application running.
Debugging
- Use
println!()
or thelog
crate for debugging - For more advanced debugging, VS Code's Rust debugger works well
Common Issues
- Database connection errors: Ensure PostgreSQL is running and credentials are correct
- Compilation errors: Run
cargo clean
followed bycargo build
- Test failures: Check for environment-specific issues like file permissions
Contributor Expectations
- Follow our Code of Conduct
- Be respectful and constructive in discussions
- Respond to feedback in a timely manner
- Help review other contributions when possible
Recognition
Contributors are recognized in several ways:
- Added to the contributors list in the README
- Mentioned in release notes for significant contributions
- Potential for direct commit access after consistent quality contributions
Related Resources
Thank you for contributing to Navius! Your efforts help make this project better for everyone.