We welcome contributions to FCR! This document provides guidelines and information for contributors.
FCR provides both functional wrappers for controller-runtime packages and additional functional utilities designed specifically for Kubernetes development with functional programming patterns.
- devbox for development environment
# Clone the repository
git clone https://github.com/appthrust/fcr.git
cd fcr
# Setup development environment
devbox shell
# Install dependencies
go mod download
# Generate code
task generate
# Run tests (requires Kubernetes cluster)
task test# Generate code and manifests
task generate
# Run linting
task lint
# Run tests
task test
# Create local Kubernetes cluster
task cluster:create
# Delete local Kubernetes cluster
task cluster:delete
# Run CI checks
task ciThis project uses controller-gen for generating:
- DeepCopy methods
- Kubernetes Custom Resource Definitions (CRDs)
# Generate all code
task generate
# Generate only DeepCopy methods
task generate:deepcopy
# Generate only CRD manifests
task generate:manifestsTests require a running Kubernetes cluster. The test suite will:
- Create a Kind cluster automatically
- Apply necessary CRDs
- Run comprehensive integration tests
- Clean up resources
# Run all tests
task test
# Run tests with verbose output
go test -v -race ./...- All new functionality must include comprehensive tests
- Tests should use real Kubernetes clusters when possible
- Use the existing test patterns and helpers
- Ensure tests clean up resources properly
- Test both success and error paths
- Fork the repository on GitHub
- Create a feature branch from
main:git checkout -b feature/your-feature-name
- Make your changes following our coding standards
- Add tests for new functionality
- Run the full test suite:
task ci
- Commit your changes with clear commit messages
- Push to your fork and submit a pull request
- Ensure your PR description clearly describes the changes
- Link any relevant issues
- Ensure all CI checks pass
- Update documentation if needed
- Request review from maintainers
- Follow standard Go conventions (gofmt, golint, etc.)
- Use functional programming patterns where appropriate
- Prefer composition over inheritance
- Write clear, self-documenting code
- Include comprehensive documentation for public APIs
- Use meaningful variable and function names
- Leverage monadic patterns (Either, IO, Reader) from IBM/fp-go
- Prefer pure functions with explicit error handling
- Use composition to build complex operations from simple ones
- Avoid side effects where possible
- Make dependencies explicit through function parameters
When creating new functional wrapper packages:
- Mirror controller-runtime structure with
fprefix - Maintain consistent API patterns across packages
- Use generic types where appropriate for type safety
- Provide parameter constructors (e.g.,
ToGetParams) - Include comprehensive examples in package documentation
When creating new utility packages:
- Focus on specific functional programming patterns (composition, transformation, validation, etc.)
- Design for composability with other FCR packages
- Provide monadic interfaces consistent with FCR patterns
- Include practical examples showing integration with wrappers
- Ensure utilities are reusable across different Kubernetes use cases
- Update README.md for user-facing changes
- Add GoDoc comments for all public functions and types
- Include usage examples in package documentation
- Update package status in the main README if needed
Use clear, descriptive commit messages:
feat(fclient): add support for server-side apply
- Add ServerSideApply parameter to patch operations
- Update tests to cover new functionality
- Add documentation examples
Fixes #123
feat: New featurefix: Bug fixdocs: Documentation changesrefactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
FCR provides both functional wrappers and utilities:
pkg/
# Functional Wrappers (mirror controller-runtime with 'f' prefix)
├── fclient/ # ✅ Functional client operations
├── fcontroller/ # 🚧 Functional controller patterns (planned)
├── fmanager/ # 🚧 Functional manager utilities (planned)
├── fbuilder/ # 🚧 Functional controller builders (planned)
├── fcache/ # 🚧 Functional caching operations (planned)
├── fhandler/ # 🚧 Functional event handlers (planned)
├── fwebhook/ # 🚧 Functional webhooks (planned)
├── fpredicate/ # 🚧 Functional predicates (planned)
└── freconcile/ # 🚧 Functional reconciler utilities (planned)
- Functional First: Use functional programming patterns consistently
- Type Safety: Leverage Go's type system for compile-time safety
- Composability: Build complex operations from simple, reusable parts
- Error Safety: Handle errors explicitly through Either types
- Performance: Maintain performance characteristics of controller-runtime
- Unit Tests: Test individual functions and components
- Integration Tests: Test interactions with real Kubernetes clusters
- End-to-End Tests: Test complete workflows
var _ = Describe("FunctionName", func() {
var env fclient.Env
BeforeEach(func() {
// Setup test environment
})
AfterEach(func() {
// Cleanup resources
})
It("should handle success case", func() {
// Test implementation
})
It("should handle error case", func() {
// Test error paths
})
})- Update version numbers
- Update CHANGELOG.md
- Run full test suite
- Create release PR
- Tag release after merge
- Publish to pkg.go.dev
- GitHub Issues: For bug reports and feature requests
- Discussions: For questions and general discussion
- Code Review: Ask questions in PR comments
Contributors are recognized in:
- Git commit history
- Release notes for significant contributions
- README acknowledgments for major features
Thank you for contributing to FCR! 🚀