Contributing to NetMediate
Thank you for your interest in contributing to NetMediate! We welcome contributions from the community and are pleased to have you join us.
Table of Contents
- Code of Conduct
- Getting Started
- Development Setup
- Making Changes
- Code Style
- Testing
- Submitting Changes
- Release Process
Code of Conduct
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.
Getting Started
Prerequisites
- .NET 9.0 SDK or later
- Git
- A GitHub account
Development Setup
-
Fork the repository on GitHub
-
Clone your fork locally:
git clone https://github.com/yourusername/net-mediate.gitcd net-mediate -
Add the original repository as upstream:
git remote add upstream https://github.com/schivei/net-mediate.git -
Restore dependencies:
dotnet restore -
Build the project:
dotnet build -
Run tests to ensure everything works:
dotnet test
Making Changes
Branch Naming
Use descriptive branch names with the following prefixes:
feature/- New featuresbugfix/- Bug fixeshotfix/- Critical fixesdocs/- Documentation updatesrefactor/- Code refactoring
Example: feature/add-new-mediator-pattern
Commit Messages
Follow conventional commit format:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringtest:- Adding or updating testschore:- Maintenance tasks
Example: feat: add support for async request handlers
Code Style
This project uses CSharpier for code formatting. All code must be properly formatted before submission.
Formatting Your Code
Run the formatter before committing:
dotnet csharpier format .
Check Formatting
Verify your code meets formatting standards:
dotnet csharpier check .
Note: The CI pipeline will automatically check code formatting and fail if standards are not met.
Testing
Writing Tests
- Write unit tests for all new functionality
- Aim for high test coverage (minimum 95% required)
- Use descriptive test names that explain what is being tested
- Follow the Arrange-Act-Assert pattern
Running Tests
# Run all tests
dotnet test
# Run tests with coverage
dotnet test --collect:"XPlat Code Coverage"
Test Coverage Requirements
- All pull requests must maintain at least 95% code coverage
- The CI pipeline will enforce this requirement
- Coverage reports are automatically generated and uploaded to Codecov
Submitting Changes
Pull Request Process
-
Ensure your branch is up to date with the main branch:
git fetch upstreamgit checkout maingit merge upstream/maingit checkout your-feature-branchgit rebase main -
Run all tests and ensure they pass:
dotnet test -
Format your code:
dotnet csharpier format . -
Push your changes to your fork:
git push origin your-feature-branch -
Create a pull request through GitHub's web interface
Pull Request Guidelines
- Fill out the pull request template completely
- Provide a clear description of the changes
- Reference any related issues
- Ensure all CI checks pass
- Be responsive to code review feedback
What to Expect
- All pull requests require review before merging
- CI checks must pass (build, tests, formatting, coverage)
- Code coverage must be at least 95%
- Changes may require documentation updates
Release Process
Releases are handled by maintainers:
- Version tags follow semantic versioning (e.g.,
v1.2.3) - Releases are automatically built and published to NuGet
- Release notes are generated automatically from commit messages
Getting Help
- Create an issue for bugs or feature requests
- Use discussions for questions about usage
- Check existing issues and documentation first
Recognition
Contributors are recognized in our release notes and README. Thank you for making NetMediate better!