Thank you for your interest in contributing to Minexus! This guide will help you get started with contributing to our distributed command execution system.
- Code of Conduct
- Getting Started
- Development Setup
- Making Changes
- Pull Request Process
- Code Quality Requirements
- Testing
- Coding Standards
- Documentation
- Reporting Issues
- Getting Help
This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers.
- Go 1.23 or later
- Git
- Docker and Docker Compose (for integration tests)
- Protocol Buffers compiler (
protoc) - Make
-
Fork the repository on GitHub
-
Clone your fork locally:
git clone https://github.com/your-username/minexus.git cd minexus -
Add the upstream repository as a remote:
git remote add upstream https://github.com/original-owner/minexus.git
-
Install development tools:
make tools
This installs all necessary development and audit tools including:
staticcheck- Static analysis toolgovulncheck- Vulnerability scannergoimports- Code formatting and import managementgolangci-lint- Comprehensive Go linterrevive- Fast and extensible Go linter- Protocol buffer generators
-
Generate your certs
Generate your own certificates and place them into /internal/certs/file/ (Follow the documentation about certificates generation for more details))
- Verify your setup:
make build make test
- Create a new branch for each feature or bug fix
- Use descriptive branch names (e.g.,
feature/add-retry-mechanism,fix/connection-timeout) - Branch from
developunless otherwise specified
git checkout develop
git pull upstream develop
git checkout -b feature/your-feature-name- Make your changes in logical, atomic commits
- Write or update tests for your changes
- Update documentation as needed
- Run the full test suite (
SLOW_TESTS=1 make test) to ensure nothing is broken - Run full audit (race conditions, security...) (
make audit) to really ensure nothing is broken - Check that your code isn't overly complex (OPTIONAL) (
go run github.com/fzipp/gocyclo/cmd/gocyclo@latest .) - Format and lint your code using provided tools
IMPORTANT: Before submitting any pull request, you must run the audit command and ensure all issues are resolved:
make auditThis command performs comprehensive code quality checks including:
- Module verification (
go mod verify) - Vet analysis (
go vet ./...) - Static analysis (
staticcheck) - Linting (
revive) - Vulnerability scanning (
govulncheck) - Race condition testing (
go test -race)
All issues reported by make audit must be fixed before your pull request will be considered.
-
Push your branch to your fork:
git push origin feature/your-feature-name
-
Create a pull request from your fork to the main repository
-
Fill out the pull request template completely, including:
- Clear description of what the PR does
- Link to any related issues
- Testing instructions
- Screenshots (if applicable)
-
Ensure all CI checks pass
-
Respond to code review feedback promptly
- Title: Use a clear, descriptive title
- Description: Provide a detailed description of your changes
- Size: Keep PRs focused and reasonably sized
- Commits: Use meaningful commit messages following conventional commit format
- Tests: Include tests for new functionality
- Documentation: Update relevant documentation
We will try to follow the Conventional Commits specification:
type(scope): description
[optional body]
[optional footer]
Types:
feat: A new featurefix: A bug fixdocs: Documentation only changesstyle: Changes that do not affect the meaning of the coderefactor: A code change that neither fixes a bug nor adds a featureperf: A code change that improves performancetest: Adding missing tests or correcting existing testschore: Changes to the build process or auxiliary tools
Examples:
feat(minion): add connection retry mechanism
fix(nexus): resolve database connection timeout
docs(api): update gRPC service documentation
test(integration): add Docker Compose test scenarios
All code must pass the following automated checks (run via make audit):
- Go Vet: Static analysis for common Go programming errors
- Staticcheck: Advanced static analysis for Go
- Revive: Fast, configurable, extensible, flexible, and beautiful linter for Go
- Govulncheck: Vulnerability scanning for Go dependencies
- Race Detection: Concurrent execution testing
- Module Verification: Dependency integrity checks
- Code follows Go best practices and idioms
- Functions and methods are well-documented
- Error handling is appropriate and consistent
- Code is readable and maintainable
- Performance considerations are addressed
- Security implications are considered
- Unit tests for all new functionality
- Integration tests for cross-component interactions
- Minimum 80% code coverage for new code
- All existing tests must pass
# Run unit tests only
make test
# Run all tests including integration tests
SLOW_TESTS=1 make test
# Run tests with coverage analysis
make cover- Write tests that are fast, reliable, and maintainable
- Use table-driven tests where appropriate
- Mock external dependencies
- Test both success and failure scenarios
- Include edge cases and boundary conditions
- Follow the Go Code Review Comments
- Use
gofmtfor formatting (automatically applied bymake tidy) - Use
goimportsfor import management - Follow standard Go naming conventions
- Keep things as simple as possible, bu no not make them simpler
- Use structured logging with appropriate log levels
- Handle errors explicitly and provide meaningful error messages
- Use context for cancellation and timeouts
- Follow the established project architecture patterns
- Maintain backward compatibility where possible
- Public APIs: All exported functions, types, and methods must have Go doc comments
- README updates: Update README.md for user-facing changes
- Architecture docs: Update architecture documentation for significant changes
- API docs: Update gRPC/API documentation when protocols change
- Use clear, concise language
- Include examples where helpful
- Follow Go documentation conventions
- Keep documentation up-to-date with code changes
- Check existing issues to avoid duplicates
- Search the documentation for solutions
- Try to reproduce the issue with the latest code
When reporting issues, please include:
- Environment: Go version, OS, architecture
- Steps to reproduce: Detailed reproduction steps
- Expected behavior: What should happen
- Actual behavior: What actually happens
- Logs: Relevant log output or error messages
- Additional context: Any other relevant information
We use labels to categorize issues:
bug: Something isn't workingenhancement: New feature or requestdocumentation: Improvements or additions to documentationgood first issue: Good for newcomershelp wanted: Extra attention is needed
- GitHub Issues: For bug reports and feature requests
- Pull Request Reviews: For code-specific discussions
README.md: Project overview and usagedocumentation/: Detailed documentationMakefile: Build and development commands.github/workflows/: CI/CD configuration
Contributors who make significant contributions to the project will be recognized in the project's acknowledgments and may be invited to become maintainers.
Thank you for contributing to Minexus! Your contributions help make this project better for everyone.