Contributing to SERENDER
Thank you for your interest in contributing to SERENDER! This document provides guidelines and information for contributors and maintainers.
Table of Contents
- Getting Started
- How to Contribute
- Development Workflow
- Coding Standards
- Testing Requirements
- Pull Request Process
- Issue Reporting
- Maintainer Guidelines
- Release Process
- Community
Getting Started
Prerequisites
Before contributing, ensure you have the following installed:
- .NET 9.0 SDK or higher
- Docker Desktop (for infrastructure services)
- Visual Studio 2022 or VS Code
- Git
- Node.js (for frontend contributions)
Development Environment Setup
-
Fork the Repository
-
Set Up Upstream Remote
-
Install Dependencies
-
Verify Setup
How to Contribute
Types of Contributions
We welcome various types of contributions:
- Bug Fixes: Help us fix issues and improve stability
- Feature Development: Implement new features and enhancements
- Documentation: Improve guides, API docs, and code comments
- Testing: Add test coverage and improve existing tests
- Performance: Optimize code and improve system performance
- Security: Identify and fix security vulnerabilities
- Refactoring: Improve code quality and maintainability
Finding Work
- Check the Issues tab for open tickets
- Look for issues labeled
good first issuefor beginners - Check issues labeled
help wantedfor priority items - Review the Project Roadmap for planned features
Development Workflow
Branch Strategy
We follow GitFlow branching model:
main: Production-ready codedevelop: Integration branch for featuresfeature/*: New features and enhancementsbugfix/*: Bug fixes for develop branchhotfix/*: Critical fixes for productionrelease/*: Release preparation
Branch Naming Convention
feature/[issue-number]-brief-description
bugfix/[issue-number]-brief-description
hotfix/[issue-number]-brief-description
release/v[version-number]
Examples:
- feature/123-add-user-authentication
- bugfix/456-fix-memory-leak
- hotfix/789-security-patch
Working on a Feature
-
Create a Branch
-
Make Changes
- Write clean, well-documented code
- Follow coding standards
- Add/update tests as needed
-
Update documentation if required
-
Commit Changes
-
Push and Create PR
Coding Standards
C# Guidelines
- Follow Microsoft C# Coding Conventions
- Use PascalCase for public members
- Use camelCase for private members
- Use meaningful names for variables and methods
- Document public APIs with XML comments
- Keep methods small and focused (max 20-30 lines)
- Use async/await for asynchronous operations
Code Style
// Good
public async Task<UserDto> GetUserByIdAsync(int userId)
{
if (userId <= 0)
throw new ArgumentException("User ID must be positive", nameof(userId));
var user = await _userRepository.GetByIdAsync(userId);
return _mapper.Map<UserDto>(user);
}
// Bad
public UserDto GetUser(int id)
{
var u = _repo.GetById(id);
return new UserDto { Name = u.Name, Email = u.Email };
}
Project Structure
Follow Hexagonal Architecture principles:
├── Domain/ # Core business logic
├── Application/ # Use cases and business rules
├── Infrastructure/ # External concerns
│ ├── Persistence/ # Database implementation
│ ├── Bus/ # Message bus implementation
│ └── Rest/ # HTTP API implementation
├── Bootstrap/ # Application entry point
└── Test/ # Test projects
Testing Requirements
Test Coverage
- Minimum 80% code coverage for new features
- Unit tests for all business logic
- Integration tests for API endpoints
- Contract tests for external integrations
Test Categories
-
Unit Tests
[Test] public async Task GetUserById_ValidId_ReturnsUser() { // Arrange var userId = 1; var expectedUser = new User { Id = userId, Name = "John Doe" }; _mockRepository.Setup(r => r.GetByIdAsync(userId)) .ReturnsAsync(expectedUser); // Act var result = await _userService.GetUserByIdAsync(userId); // Assert Assert.That(result.Id, Is.EqualTo(userId)); Assert.That(result.Name, Is.EqualTo("John Doe")); } -
Integration Tests
[Test] public async Task CreateUser_ValidData_ReturnsCreatedUser() { // Arrange var newUser = new CreateUserRequest { Name = "Jane Doe", Email = "jane@example.com" }; // Act var response = await _client.PostAsJsonAsync("/api/users", newUser); // Assert response.StatusCode.Should().Be(HttpStatusCode.Created); var user = await response.Content.ReadFromJsonAsync<UserDto>(); user.Name.Should().Be("Jane Doe"); }
Running Tests
# Run all tests
dotnet test
# Run with coverage
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
# Run specific test category
dotnet test --filter Category=Unit
Pull Request Process
Before Submitting
- [ ] Ensure all tests pass
- [ ] Code coverage meets requirements
- [ ] Code follows style guidelines
- [ ] Documentation is updated
- [ ] Commit messages follow convention
- [ ] Branch is up to date with target branch
PR Template
Use this template for your pull requests:
## Description
Brief description of the changes made.
## Type of Change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
## Testing
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing completed
## Related Issues
Closes #[issue_number]
## Screenshots (if applicable)
Add screenshots to help explain your changes.
## Checklist
- [ ] My code follows the style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
Review Process
- Automated Checks: CI/CD pipeline runs automatically
- Code Review: At least one maintainer reviews the code
- Testing: QA team tests the changes (if applicable)
- Approval: Maintainer approves and merges the PR
Issue Reporting
Bug Reports
Use the bug report template:
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Environment:**
- OS: [e.g. Windows 10]
- .NET Version: [e.g. 9.0]
- Browser: [e.g. chrome, safari]
- Version: [e.g. 22]
**Additional context**
Add any other context about the problem here.
Feature Requests
Use the feature request template:
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is.
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
Maintainer Guidelines
Responsibilities
Code Maintainers: - Review and merge pull requests - Ensure code quality and standards - Provide feedback to contributors - Manage releases and versioning - Monitor project health
Community Maintainers: - Moderate discussions and issues - Help new contributors - Maintain documentation - Organize community events
Review Guidelines
- Code Quality
- Follows coding standards
- Has appropriate test coverage
- Documentation is updated
-
No security vulnerabilities
-
Functional Requirements
- Meets acceptance criteria
- Doesn't break existing functionality
-
Performance impact is acceptable
-
Review Checklist
- [ ] Code compiles without warnings
- [ ] Tests pass and coverage is adequate
- [ ] Code follows project conventions
- [ ] Documentation is updated
- [ ] Security considerations are addressed
- [ ] Performance impact is acceptable
Merge Requirements
- 2 approvals required for major changes
- 1 approval required for minor changes
- All checks must pass before merging
- Squash and merge for feature branches
- Merge commit for release branches
Release Process
Versioning
We follow Semantic Versioning (SemVer): - MAJOR: Breaking changes - MINOR: New features (backward compatible) - PATCH: Bug fixes (backward compatible)
Release Steps
-
Create Release Branch
-
Update Version Numbers
- Update assembly versions
- Update package.json files
-
Update CHANGELOG.md
-
Final Testing
- Run full test suite
- Perform manual testing
-
Security scan
-
Create Release PR
- Create PR from release branch to main
- Get required approvals
-
Merge to main
-
Tag and Deploy
-
Update Develop
Community
Communication Channels
- GitHub Issues: Bug reports and feature requests
- GitHub Discussions: General discussions and Q&A
- Email: [MAINTAINER_EMAIL] for sensitive issues
- Slack/Discord: [COMMUNITY_CHAT_LINK] for real-time chat
Getting Help
- Check existing Issues and Discussions
- Read the Documentation
- Ask questions in Community Chat
- Contact Maintainers directly for urgent issues
Recognition
We recognize contributors through: - Contributors file listing all contributors - Release notes mentioning significant contributions - Community highlights for outstanding contributions - Maintainer nominations for consistent contributors
Thank You!
Your contributions make this project better for everyone. We appreciate your time and effort in helping us build something amazing together!
For questions about this contributing guide, please open an issue or contact the maintainers.