Contributing to HDDS
Thank you for your interest in contributing to HDDS! This guide explains how to get started.
Ways to Contribute
Report Issues
Found a bug or have a feature request?
- Check existing issues first
- If not found, create a new issue
- Use the appropriate template:
- Bug Report: For bugs and unexpected behavior
- Feature Request: For new functionality
- Documentation: For doc improvements
Submit Code
Ready to contribute code?
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
Improve Documentation
Documentation contributions are always welcome:
- Fix typos and clarify wording
- Add examples and tutorials
- Translate to other languages
- Improve API documentation
Development Setup
Prerequisites
# Rust (1.75+)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup update stable
# Development tools
cargo install cargo-watch cargo-nextest cargo-llvm-cov
Clone and Build
git clone https://github.com/skylab/hdds.git
cd hdds
# Build all components
cargo build --workspace
# Run tests
cargo nextest run
# Run with debug logging
RUST_LOG=hdds=debug cargo run --example hello_world
Project Structure
hdds/
├── hdds/ # Core DDS library
│ ├── src/
│ │ ├── domain/ # Domain participant
│ │ ├── transport/ # Network transports
│ │ ├── discovery/ # SPDP/SEDP
│ │ ├── qos/ # QoS policies
│ │ └── rtps/ # RTPS protocol
│ └── tests/
├── hdds-gen/ # Code generator
├── hdds-derive/ # Proc macros
├── tools/
│ ├── hdds-viewer/ # Traffic analyzer
│ └── hdds-studio/ # Visual editor
└── examples/ # Usage examples
Code Guidelines
Rust Style
Follow Rust idioms and conventions:
// Good: Use Result for fallible operations
pub fn create_topic(&self, name: &str) -> Result<Topic, HddsError> {
// ...
}
// Good: Use builders for complex configuration
let writer = DataWriterBuilder::new(&topic)
.reliability(Reliability::Reliable)
.history(History::KeepLast { depth: 10 })
.build()?;
// Good: Document public APIs
/// Creates a new DataWriter for the specified topic.
///
/// # Errors
///
/// Returns `HddsError::TopicNotFound` if the topic doesn't exist.
pub fn create_datawriter(&self, topic: &Topic) -> Result<DataWriter, HddsError> {
// ...
}
Formatting
# Format code
cargo fmt
# Check formatting
cargo fmt --check
Linting
# Run clippy
cargo clippy --workspace --all-targets -- -D warnings
# With pedantic lints (recommended for new code)
cargo clippy --workspace -- -W clippy::pedantic
Testing
# Run all tests
cargo nextest run
# Run specific test
cargo nextest run test_reliable_delivery
# Run with coverage
cargo llvm-cov nextest --workspace
# Integration tests
cargo test --test integration
Pull Request Process
Before Submitting
-
Ensure tests pass:
cargo nextest run
cargo clippy --workspace -- -D warnings
cargo fmt --check -
Add tests for new functionality
-
Update documentation if needed
-
Write a clear commit message:
feat(transport): add shared memory transport
Implements zero-copy shared memory transport for same-host
communication. Supports automatic fallback to UDP.
Closes #123
Commit Message Format
Use Conventional Commits:
<type>(<scope>): <description>
[optional body]
[optional footer]
Types:
feat: New featurefix: Bug fixdocs: Documentation onlystyle: Formatting, no code changerefactor: Code change, no new feature or fixperf: Performance improvementtest: Adding testschore: Build process or tooling
PR Review Process
-
Automated checks run on all PRs:
- Build and test on Linux, macOS, Windows
- Clippy lints
- Format check
- Security audit
-
Code review by maintainers:
- Architecture and design
- Code quality
- Test coverage
- Documentation
-
Approval and merge:
- At least one maintainer approval required
- All checks must pass
- Squash merge preferred
Adding New Features
Proposing Changes
For significant changes:
- Open an issue describing the proposal
- Discuss with maintainers
- Get approval before implementing
Feature Branches
# Create feature branch
git checkout -b feat/shared-memory-transport
# Make changes and commit
git add .
git commit -m "feat(transport): implement shared memory"
# Push and create PR
git push origin feat/shared-memory-transport
Example: Adding a New QoS Policy
- Define the policy in
hdds/src/qos/mod.rs:
#[derive(Clone, Debug, Default)]
pub struct NewPolicy {
pub setting: bool,
}
- Add to QoS builders:
impl DataWriterQos {
pub fn new_policy(mut self, policy: NewPolicy) -> Self {
self.new_policy = policy;
self
}
}
-
Implement wire format in
hdds/src/rtps/parameter.rs -
Add tests:
#[test]
fn test_new_policy() {
let qos = DataWriterQos::default()
.new_policy(NewPolicy { setting: true });
assert!(qos.new_policy.setting);
}
- Update documentation
Documentation Contributions
Building Docs
cd docs
npm install
npm run start # Local preview
npm run build # Production build
Doc Structure
docs/
├── getting-started/ # Tutorials
├── guides/ # How-to guides
├── concepts/ # Explanations
├── reference/ # API reference
└── tools/ # Tool documentation
Writing Style
- Use clear, concise language
- Include code examples
- Add diagrams where helpful
- Test all code snippets
Release Process
Versioning
HDDS follows Semantic Versioning:
- Major (1.x.x): Breaking changes
- Minor (x.1.x): New features, backwards compatible
- Patch (x.x.1): Bug fixes
Release Checklist
- Update
CHANGELOG.md - Update version in
Cargo.toml - Create release tag
- Build and publish crates
- Update documentation
Getting Help
Questions
Real-Time Chat
Join our Discord server for:
- Development discussions
- Quick questions
- Community support
Recognition
Contributors are recognized in:
CONTRIBUTORS.mdfile- Release notes
- Annual contributor spotlight
Thank you for contributing to HDDS!