Thank you for your interest in contributing to the bucket synchronisation service! This document provides guidelines and information for contributors.
- Go 1.25 or later
- Git
- Make
- Docker (optional, for containerized development)
-
Fork the repository on GitHub
-
Clone your fork locally:
git clone https://github.com/your-username/bucketsyncd.git cd bucketsyncd -
Install development dependencies:
# Install pre-commit hooks pip install pre-commit pre-commit install # Install Go tools go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest go install github.com/securecodewarrior/gosec/v2/cmd/gosec@latest
-
Run the test suite to ensure everything works:
make test
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes following the code standards
-
Run tests and linting:
make test make lint -
Commit your changes with a descriptive commit message
-
Push to your fork and create a pull request
- Follow standard Go formatting (
gofmt) - Use
golangci-lintfor linting - Maintain test coverage above 60%
- Write clear, documented code
- Use meaningful variable and function names
Follow the conventional commit format:
type(scope): description
- feat: new features
- fix: bug fixes
- docs: documentation changes
- style: formatting changes
- refactor: code restructuring
- test: adding or updating tests
- chore: maintenance tasks
Example:
feat(inbound): add support for SQS message processing
fix(config): handle missing configuration files gracefully
docs(readme): update installation instructions
- Keep functions small and focused
- Group related functionality in appropriate files
- Use interfaces for external dependencies
- Handle errors explicitly
- Log appropriately (use structured logging)
- Unit tests for all public functions
- Integration tests for complex workflows
- Minimum 60% code coverage
- Tests should be deterministic and isolated
# Run all tests
go test ./...
# Run tests with coverage
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out
# Run tests with race detection
go test -race ./...
# Run linting
golangci-lint run
# Run security scanning
gosec ./...func TestFunctionName(t *testing.T) {
// Arrange
input := "test input"
expected := "expected output"
// Act
result := FunctionName(input)
// Assert
if result != expected {
t.Errorf("Expected %s, got %s", expected, result)
}
}# Build for current platform
make build
# Build for all platforms
make build-all
# Build specific platform
GOOS=linux GOARCH=amd64 go build -o build/bucketsyncd# Build Docker image
docker build -t bucketsyncd .
# Multi-arch build
docker buildx build --platform linux/amd64,linux/arm64 -t bucketsyncd .- Ensure your code follows all standards and passes all tests
- Update documentation if necessary
- Add or update tests for new functionality
- Fill out the pull request template completely
- Request review from maintainers
- Tests pass locally and in CI
- Code coverage is maintained or improved
- Documentation is updated if needed
- Commit messages follow conventional format
- No merge conflicts with master branch
- Security scan passes (no new vulnerabilities)
- Automated checks must pass (CI/CD pipeline)
- At least one maintainer review required
- Address all review feedback
- Maintain clean commit history (squash if necessary)
Include the following information:
- Go version and OS
- bucketsyncd version
- Configuration details (sanitized)
- Steps to reproduce
- Expected vs actual behavior
- Relevant log output
- Clear description of the proposed feature
- Use case and business justification
- Proposed implementation approach (if applicable)
- Backward compatibility considerations
Do not open public issues for security vulnerabilities. Report security issues privately to the maintainers.
- Never commit secrets, tokens, or passwords
- Use environment variables for sensitive configuration
- Validate all input data
- Follow secure coding practices
- Keep dependencies updated
- Regularly update Go modules
- Review security advisories
- Use
go mod tidyto clean up dependencies - Pin versions for reproducible builds
make build # Build binary
make test # Run tests
make lint # Run linter
make fmt # Format code
make clean # Clean build artifacts
make docker # Build Docker image
make install-tools # Install development toolsRecommended VS Code extensions:
- Go (by Google)
- golangci-lint
- Test Explorer for Go
- Git Lens
Use delve for debugging:
# Install delve
go install github.com/go-delve/delve/cmd/dlv@latest
# Debug with delve
dlv debug -- -c config.yamlBy contributing to this project, you agree that your contributions will be licensed under the MIT License.
- Open an issue for bugs or feature requests
- Check existing issues and documentation first
- Be respectful and constructive in all interactions
Thank you for contributing!