4.3 KiB
Contributing to Buque
Thank you for your interest in contributing to Buque! This document provides guidelines and instructions for contributing.
Code of Conduct
This project adheres to a code of conduct. By participating, you are expected to uphold this code. Please be respectful and constructive in all interactions.
How to Contribute
Reporting Bugs
Before creating bug reports, please check existing issues to avoid duplicates. When creating a bug report, include:
- Clear title and description
- Steps to reproduce the issue
- Expected behavior
- Actual behavior
- Environment details (OS, Docker version, Go version)
- Log output if applicable
Suggesting Enhancements
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, include:
- Clear title and description
- Use case for the enhancement
- Proposed solution or implementation ideas
- Alternatives considered
Pull Requests
- Fork the repository and create your branch from
main - Make your changes following the coding standards
- Add tests if applicable
- Update documentation if needed
- Ensure tests pass (
make test) - Format your code (
make fmt) - Run linter (
make vet) - Commit your changes with clear commit messages
- Push to your fork and submit a pull request
Pull Request Guidelines
- Use descriptive titles and descriptions
- Reference related issues
- Keep changes focused and atomic
- Add tests for new functionality
- Update README.md if needed
- Follow the existing code style
Development Setup
Prerequisites
- Go 1.21 or higher
- Docker 20.10 or higher
- Make
Setting Up Development Environment
# Clone your fork
git clone https://github.com/yourusername/buque.git
cd buque
# Install dependencies
make deps
# Build the project
make build
# Run tests
make test
Running Tests
# Run all tests
make test
# Run specific tests
go test ./internal/docker/...
# Run with coverage
go test -cover ./...
Code Style
- Follow standard Go conventions and idioms
- Use
gofmtfor formatting - Write clear, self-documenting code
- Add comments for complex logic
- Keep functions small and focused
Commit Messages
Follow conventional commit format:
type(scope): subject
body
footer
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
Example:
feat(proxy): add support for custom SSL certificates
Add ability to specify custom SSL certificates for nginx-proxy
instead of relying only on Let's Encrypt.
Closes #123
Project Structure
buque/
├── cmd/buque/ # Main application entry point
├── internal/
│ ├── cmd/ # CLI command implementations
│ ├── config/ # Configuration management
│ ├── docker/ # Docker operations
│ ├── models/ # Data models
│ ├── proxy/ # Nginx-proxy management
│ └── stats/ # Statistics collection
├── examples/ # Example configurations
├── Makefile # Build automation
├── go.mod # Go dependencies
└── README.md # Project documentation
Testing
Unit Tests
Place unit tests in _test.go files alongside the code they test.
func TestFunction(t *testing.T) {
// Test implementation
}
Integration Tests
Integration tests that require Docker should be tagged:
//go:build integration
// +build integration
func TestDockerIntegration(t *testing.T) {
// Test implementation
}
Run integration tests:
go test -tags=integration ./...
Documentation
- Update README.md for user-facing changes
- Update code comments for API changes
- Add examples for new features
- Keep documentation clear and concise
Release Process
Releases are managed by maintainers:
- Update version in code
- Update CHANGELOG.md
- Create and push git tag
- Build and upload binaries
- Create GitHub release
Questions?
Feel free to open an issue for questions or reach out to maintainers.
Thank you for contributing to Buque! 🚢