Thank you for your interest in contributing to CNPG Storage Manager! This document provides guidelines for contributing to the project.
By participating in this project, you agree to abide by our code of conduct. Please be respectful and constructive in all interactions.
- Go 1.21 or later
- Docker (for building container images)
- kubectl and access to a Kubernetes cluster
- make
-
Fork and clone the repository:
git clone https://github.com/YOUR-USERNAME/cnpg-storage-manager.git cd cnpg-storage-manager -
Install dependencies:
go mod download
-
Generate manifests and code:
make manifests generate
-
Run tests:
make test
-
Install CRDs in your cluster:
make install
-
Run the controller locally:
make run
main- Production-ready codefeature/*- New featuresfix/*- Bug fixesdocs/*- Documentation updates
-
Create a new branch:
git checkout -b feature/your-feature-name
-
Make your changes and ensure tests pass:
make test make lint -
Commit your changes:
git commit -m "feat: description of your changes" -
Push and create a pull request:
git push origin feature/your-feature-name
We follow Conventional Commits:
feat:- A new featurefix:- A bug fixdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringtest:- Adding or updating testschore:- Maintenance tasks
- Title: Use a clear, descriptive title following conventional commits
- Description: Explain what changes you made and why
- Tests: Include tests for new functionality
- Documentation: Update documentation as needed
- Breaking Changes: Clearly document any breaking changes
- Follow Go best practices and idioms
- Run
make lintbefore submitting - Keep functions small and focused
- Add comments for complex logic
- Include unit tests for new code
make testmake test-integrationRequires a Kubernetes cluster with CNPG installed:
make test-e2eGenerate coverage report:
go test -coverprofile=coverage.out ./pkg/...
go tool cover -html=coverage.outmake buildmake docker-buildhelm lint charts/cnpg-storage-manager
helm package charts/cnpg-storage-managerReleases are automated via GitHub Actions when a version tag is pushed:
git tag -a v1.0.0 -m "Release v1.0.0"
git push origin v1.0.0- Issues: Open a GitHub issue for bugs or feature requests
- Discussions: Use GitHub Discussions for questions
- Documentation: Check the README and docs folder
By contributing, you agree that your contributions will be licensed under the Apache 2.0 License.