Welcome to the Fluree contributor documentation! This section provides everything you need to contribute to Fluree.
Set up your development environment:
- Install dependencies
- Clone repository
- Build from source
- Run development server
- IDE configuration
Testing guide:
- Running tests
- Writing tests
- Test organization
- Integration tests
- Benchmarking
- Continuous integration
How to instrument new code paths with tracing spans:
- The two-tier span strategy (info / debug / trace)
- Code patterns for sync and async spans
- Deferred field recording
- Testing spans with SpanCaptureLayer
- Common gotchas (
!Sendguards, OTEL floods, etc.)
Guide to the manifest-driven W3C compliance test suite:
- Running and interpreting results
- Debugging failures
- From failure to issue/PR workflow
- Using Claude Code for compliance work
- Architecture overview
- Report Bugs: File issues with reproduction steps
- Suggest Features: Propose enhancements with use cases
- Fix Bugs: Submit pull requests for bug fixes
- Add Features: Implement new capabilities
- Improve Documentation: Fix typos, clarify explanations, add examples
- Review Pull Requests: Help review others' contributions
- Answer Questions: Help users in discussions
- Check existing issues: Search for duplicate issues
- Read documentation: Understand the feature area
- Discuss major changes: Open issue before large PRs
- Follow style guide: Match existing code style
- Add tests: Include tests for new features
- Update docs: Document new features
# Fork on GitHub, then clone
git clone https://github.com/YOUR-USERNAME/db.git
cd dbgit checkout -b feature/my-featureBranch naming:
feature/- New featuresfix/- Bug fixesdocs/- Documentationrefactor/- Code refactoringtest/- Test additions
Edit code, following style guidelines.
# Run existing tests
cargo test
# Add new tests
# Edit tests/test_my_feature.rs# Format code
cargo fmt
# Lint code
cargo clippy
# Run all tests
cargo test --allgit add .
git commit -m "Add feature: description"Commit message format:
Short summary (50 chars or less)
More detailed explanation if needed. Wrap at 72 characters.
- Key point 1
- Key point 2
Fixes #123
A Fixes #123 trailer closes the issue once the commit reaches the default branch, but it does
not create the linked pull request relationship — so put the closing keyword in the PR body
as well (or instead). See Linking issues from PRs for the three reference
forms and how they behave on stacked PRs.
git push origin feature/my-featureCreate pull request on GitHub. Put Fixes #N / Follow-up: #N / Partially addresses #N in the
PR body so the reference direction is explicit — see Linking issues from PRs.
Respond to reviewer feedback, make requested changes.
Follow Rust standard style:
# Format all code
cargo fmt
# Check style
cargo clippyTypes: PascalCase
struct Dataset { ... }
enum QueryResult { ... }Functions: snake_case
fn execute_query() { ... }
fn parse_json_ld() { ... }Constants: SCREAMING_SNAKE_CASE
const MAX_QUERY_SIZE: usize = 1_048_576;Modules: snake_case
mod query_engine;
mod storage_backend;Document public APIs:
/// Executes a query against the dataset.
///
/// # Arguments
///
/// * `query` - The query to execute
/// * `context` - Execution context
///
/// # Returns
///
/// Query results or error
///
/// # Examples
///
/// ```
/// let results = dataset.query(&query, &context)?;
/// ```
pub fn query(&self, query: &Query, context: &Context) -> Result<Vec<Solution>> {
// Implementation
}Use Result types:
// Good
pub fn parse_query(input: &str) -> Result<Query, ParseError> {
// ...
}
// Bad
pub fn parse_query(input: &str) -> Query {
// No error handling
}Write tests for new code:
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_query_execution() {
let query = Query::parse("...").unwrap();
let result = execute(&query).unwrap();
assert_eq!(result.len(), 2);
}
}Format: category: short description
Examples:
feat: Add SPARQL property paths supportfix: Correct transaction time orderingdocs: Update query examplestest: Add integration tests for time travelrefactor: Simplify index scan logic
Include:
- Summary: What does this PR do?
- Motivation: Why is this needed?
- Changes: What changed?
- Testing: How was it tested?
- Breaking Changes: Any breaking changes?
Example:
## Summary
Adds support for SPARQL property paths, enabling recursive graph traversal.
## Motivation
Many users need to query hierarchical data structures. Property paths are a standard SPARQL feature.
## Changes
- Added property path parser to fluree-db-sparql
- Implemented path evaluation in query engine
- Added tests for various path patterns
## Testing
- Unit tests for parser
- Integration tests for path queries
- Benchmarks show acceptable performance
## Breaking Changes
None- Code follows style guidelines
- Tests added/updated
- Documentation updated
- All tests pass
- No clippy warnings
- Commit messages clear
- PR description complete
- Correctness: Does it work as intended?
- Tests: Adequate test coverage?
- Style: Follows conventions?
- Documentation: Properly documented?
- Performance: No obvious performance issues?
- Breaking Changes: Backward compatible?
- Be receptive to feedback
- Ask questions if unclear
- Make requested changes promptly
- Explain your reasoning when appropriate
- Say thanks for helpful reviews
- Be respectful and inclusive
- Assume good intentions
- Give constructive feedback
- Welcome newcomers
- No harassment or discrimination
- GitHub Issues: Bug reports, feature requests
- Pull Requests: Code contributions
- Discussions: Questions, ideas, help
- Read documentation first
- Search existing issues
- Ask specific questions
- Provide reproduction steps
- Be patient and respectful
Fluree DB is distributed under the Business Source License 1.1, which converts to Apache License 2.0 on each version's Change Date.
By contributing, you license your contributions to Fluree, PBC under the Apache License 2.0, and agree that Fluree may distribute them as part of Fluree DB under the Business Source License, the Apache License 2.0, and Fluree's commercial licenses.
Contributors are recognized in:
- CONTRIBUTORS.md file
- Release notes
- GitHub contributors page
Thank you for contributing to Fluree!
- Dev Setup - Development environment
- Tests - Testing guide
- Graph Identities and Naming - Naming conventions