Thank you for your interest in contributing to confd! This document provides guidelines and information for contributors.
- Code of Conduct
- Getting Started
- Development Setup
- Making Changes
- Pull Request Process
- Code Style
- Testing
- Adding New Features
Please be respectful and constructive in all interactions. We welcome contributors of all experience levels.
- Fork the repository on GitHub
- Clone your fork locally
- Set up your development environment (see Development Guide)
- Create a branch for your changes
- Make your changes and test them
- Submit a pull request
For detailed instructions on setting up your development environment, installing prerequisites, and running tests, see the Development Guide.
Quick start:
# Clone and build
git clone https://github.com/YOUR_USERNAME/confd.git
cd confd
make build
# Run tests
make test
# Run linter
make lintUse descriptive branch names:
feature/add-xyz-backend- New featuresfix/issue-123-description- Bug fixesdocs/update-readme- Documentation changesrefactor/cleanup-template-code- Code refactoring
We use Conventional Commits format:
<type>: <description>
[optional body]
[optional footer]
Types:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changesrefactor:- Code refactoring (no functional changes)test:- Adding or updating testschore:- Maintenance tasks (dependencies, CI, etc.)
Examples:
feat: add Redis TLS support
fix: resolve template cache invalidation on SIGHUP
docs: update installation guide for v0.40.0
refactor: extract command execution into separate module
test: add integration tests for Vault KV v2
- Focused: One logical change per PR
- Tested: Include tests for new functionality
- Documented: Update docs if behavior changes
- Backward compatible: Avoid breaking changes when possible
-
Before submitting:
- Run
make testand ensure all tests pass - Run
make lintand fix any issues - Update documentation if needed
- Add tests for new functionality
- Run
-
PR description should include:
- What the change does
- Why it's needed
- How it was tested
- Any breaking changes
-
Review process:
- PRs require review before merging
- Address review feedback promptly
- Keep PRs updated with main branch
-
After approval:
- Squash commits if requested
- Maintainer will merge the PR
Important: Always target abtreece/confd repository, not the upstream kelseyhightower/confd.
- Follow standard Go conventions and idioms
- Use
gofmtfor formatting (enforced by CI) - Run
golangci-lintbefore submitting
- Error handling: Return errors, don't panic
- Logging: Use the
pkg/logpackage for structured logging - Context: Pass
context.Contextfor cancellation and timeouts - Testing: Table-driven tests preferred
cmd/confd/ # CLI entry point
pkg/backends/ # Backend implementations
pkg/template/ # Template processing
pkg/metrics/ # Prometheus metrics
pkg/service/ # Service management (shutdown, reload)
pkg/log/ # Logging
pkg/util/ # Utilities
# Unit tests with linting
make test
# Unit tests only
go test ./...
# Specific package
go test ./pkg/template/...
# With coverage
go test ./... -coverprofile=coverage.out
# Integration tests (requires backend services)
make integration- Place tests in
*_test.gofiles alongside the code - Use table-driven tests for multiple cases
- Mock external dependencies
- Integration tests go in
test/integration/
See the Development Guide for detailed testing instructions.
- Create package under
pkg/backends/<name>/ - Implement the
StoreClientinterface - Add to factory in
pkg/backends/client.go - Add CLI command in
cmd/confd/cli.go - Create
pkg/backends/<name>/README.md - Add integration tests in
test/integration/backends/<name>/ - Update documentation
See Architecture: Extension Points for details.
- Add function to
pkg/template/template_funcs.go - Add tests in
pkg/template/template_funcs_test.go - Document in
docs/templates.md
- Add field to appropriate struct in
cmd/confd/cli.go - Update
docs/command-line-flags.md - Update
docs/configuration-guide.mdif config file option
- Check existing issues
- Open a new issue for questions or discussion
- Review the Architecture Guide for design context
By contributing, you agree that your contributions will be licensed under the same license as the project.