CI / Lint () (push) Canceled after 0s
CI / Lint (--all-features) (push) Canceled after 0s
CI / Lint (--no-default-features) (push) Canceled after 0s
CI / MSRV Verification () (push) Canceled after 0s
CI / MSRV Verification (--all-features) (push) Canceled after 0s
CI / MSRV Verification (--no-default-features) (push) Canceled after 0s
CI / Test (macos-latest, nightly, ) (push) Canceled after 0s
CI / Test (macos-latest, stable, ) (push) Canceled after 0s
CI / Test (ubuntu-latest, nightly, ) (push) Canceled after 0s
CI / Test (ubuntu-latest, stable, ) (push) Canceled after 0s
CI / Test (windows-latest, nightly, ) (push) Canceled after 0s
CI / Test (windows-latest, stable, ) (push) Canceled after 0s
CI / Test (macos-latest, nightly, --all-features) (push) Canceled after 0s
CI / Test (macos-latest, stable, --all-features) (push) Canceled after 0s
CI / Test (ubuntu-latest, nightly, --all-features) (push) Canceled after 0s
CI / Test (ubuntu-latest, stable, --all-features) (push) Canceled after 0s
CI / Test (windows-latest, nightly, --all-features) (push) Canceled after 0s
CI / Test (windows-latest, stable, --all-features) (push) Canceled after 0s
CI / Test (macos-latest, nightly, --no-default-features) (push) Canceled after 0s
CI / Test (macos-latest, stable, --no-default-features) (push) Canceled after 0s
CI / Test (ubuntu-latest, nightly, --no-default-features) (push) Canceled after 0s
CI / Test (ubuntu-latest, stable, --no-default-features) (push) Canceled after 0s
CI / Test (windows-latest, nightly, --no-default-features) (push) Canceled after 0s
CI / Test (windows-latest, stable, --no-default-features) (push) Canceled after 0s
CI / Cargo Check () (push) Canceled after 0s
CI / Cargo Check (--all-features) (push) Canceled after 0s
CI / Cargo Check (--no-default-features) (push) Canceled after 0s
CI / Examples (push) Canceled after 0s
CI / Code Coverage (push) Canceled after 0s
CI / Security Audit (push) Canceled after 0s
CI / Documentation () (push) Canceled after 0s
CI / Documentation (--all-features) (push) Canceled after 0s
CI / Documentation (--no-default-features) (push) Canceled after 0s
Rewrites remaining github.com / git.sr.ht references to git.swaits.com, translating GitHub URL shapes to Gitea's (/blob/<ref>/ -> /src/branch/<ref>/, /tree/<tag> -> /src/tag/<tag>, /actions/workflows/X -> /actions?workflow=X, /edit/ -> /_edit/). Left pointing at GitHub on purpose: pull-request links (PRs were not migrated) and GitHub-only surfaces Gitea lacks (security advisories, discussions).
3.7 KiB
3.7 KiB
Contributing to dagx
Thanks for your interest in contributing! Please read our Code of Conduct before getting started.
Quick Start
# Clone and build
git clone https://git.swaits.com/swaits/dagx
cd dagx
cargo build
# Run tests
cargo test
# Check your code
cargo fmt
cargo clippy -- -D warnings
Development Setup
Prerequisites:
- Rust 1.81+ (edition 2021)
- Git
Optional tools:
rustup component add rustfmt clippy
cargo binstall cargo-tarpaulin # For coverage
cargo binstall cargo-audit # For security checks
Making Changes
- Fork and branch: Create a descriptive branch (
fix-xyz,feature-abc) - Code: Make your changes following our style guide
- Test: Add tests for new functionality
- Document: Update docs if needed
- Verify: Run the pre-flight checks below
- PR: Open a pull request with a clear description
Pre-flight Checklist
Before submitting your PR, verify:
cargo test # All tests pass
cargo fmt -- --check # Code is formatted
cargo clippy -- -D warnings # No clippy warnings
cargo doc # Docs build
cargo build --examples # Examples compile
Code Style
- Format: Use
rustfmt(enforced by CI) - Lint: Fix all
clippywarnings - Document: Add doc comments for public APIs
- Test: Cover new code with tests
Documentation Guidelines
- Document why, not what
- Include examples for public APIs
- Keep examples simple and focused
- All doc examples must compile
Example:
/// Adds a task to the DAG.
///
/// # Examples
///
/// ```
/// use dagx::DagRunner;
///
/// let mut dag = DagRunner::new();
/// let task = dag.add_task(MyTask::new());
/// ```
pub fn add_task<T: Task>(&self, task: T) -> TaskBuilder<T> {
// ...
}
Testing
Test organization:
- Unit tests:
#[cfg(test)]modules in source files - Integration tests:
tests/directory - Examples:
examples/directory (must compile) - Doctests: In
///comments (must pass)
Runtime testing:
cargo test # Default (tokio)
Benchmarks:
cargo bench
# View results: open target/criterion/report/index.html
Continuous Integration
Our CI runs on every PR and checks:
- Build: Linux, macOS, Windows
- Test: All tests across multiple runtimes
- Format:
rustfmtcompliance - Lint:
clippywith no warnings - Coverage: Minimum 80% code coverage
- Security:
cargo auditfor vulnerabilities
Commit Guidelines
Use clear, concise commit messages:
type: brief description
Optional longer explanation if needed.
Closes #123
Types: feat, fix, docs, test, refactor, perf, chore
Examples:
feat: add timeout support for tasksfix: correct cycle detection in diamond DAGdocs: clarify TaskHandle usage in README
Pull Requests
PR description should include:
- What changed and why
- How it was tested
- Any breaking changes
- Link to related issue (if applicable)
Review process:
- Maintainer reviews within 1 week
- Address feedback
- Once approved, maintainer merges
- Contributors are credited in releases
Getting Help
- Questions: Open a GitHub Discussion
- Bugs: Open a GitHub Issue
- Security: Email steve@waits.net (see SECURITY.md)
Release Process
(For maintainers only)
- Update version in
Cargo.tomlandCHANGELOG.md - Run full test suite:
cargo test --all-features - Tag release:
git tag -a v0.x.y -m "Release v0.x.y" - Push tag:
git push origin v0.x.y - Publish:
cargo publish - Create GitHub release with changelog
Thank you for contributing! 🎉