Thank you for considering contributing to Needle! This document outlines the process and guidelines for contributing.
Be respectful and constructive in all interactions with the project and community members.
When reporting issues, please include:
- A clear, descriptive title
- Steps to reproduce the problem
- Expected vs actual behavior
- Your environment (OS, Go version, Needle version)
- Relevant logs or error messages
- Fork the repository and create your branch from
main - Make your changes following the coding standards
- Add tests for any new functionality
- Ensure all tests pass with
make test - Run linters with
make lintand fix any issues - Format your code with
make fmt - Commit your changes following the commit message format
- Push to your fork and submit a pull request
- Go 1.24 or later
- Make
- golangci-lint 2.8.0 or later
- step-cli (for certificate testing)
- Clone the repository:
git clone https://github.com/pixelfactoryio/needle.git
cd needle- Install dependencies:
go mod download- Run tests:
make test- Build the binary:
make build- Run locally:
./bin/needle --http-port 8080 --https-port 8443make build- Build the binarymake test- Run tests with coveragemake lint- Run golangci-lintmake fmt- Format code with gofmtmake vet- Run go vetmake mocks- Generate test mocksmake ca-test- Create test CA certificatesmake cert-test- Create test certificates
- Follow Effective Go
- Use
gofmtfor code formatting - Write clear, self-documenting code
- Add comments for exported functions and types
- Keep functions focused and concise
- Place business logic in
internal/app/ - Place infrastructure code in
internal/infra/ - Write tests alongside the code they test
- Use interfaces for dependencies
- Write table-driven tests where appropriate
- Aim for high test coverage on business logic
- Use mocks for external dependencies
- Test error paths and edge cases
- Document all exported functions and types
- Keep README.md up to date
- Add inline comments for complex logic
- Update CHANGELOG.md for user-facing changes
We follow Conventional Commits for clear and structured commit history.
<type>(<scope>): <subject>
<body>
<footer>
feat: New featurefix: Bug fixdocs: Documentation changeschore: Maintenance tasksci: CI/CD changesrefactor: Code refactoringtest: Test additions or changesperf: Performance improvements
feat(dns): add support for custom CoreDNS configuration
Added ability to specify custom Corefile for CoreDNS server,
allowing users to configure advanced DNS routing rules.
Closes #24
fix(tls): resolve certificate caching race condition
Fixed race condition in certificate cache that could cause
duplicate certificate generation under high load.
docs: update installation instructions
Added Docker Compose example and clarified prerequisite versions.
Optional but recommended. Examples: dns, tls, http, pki, docs, ci
For breaking changes, add BREAKING CHANGE: in the footer:
feat(config)!: change default ports to 8080/8443
BREAKING CHANGE: Default HTTP port changed from 80 to 8080,
default HTTPS port changed from 443 to 8443 to avoid requiring
root privileges.
- Rebase your branch on latest
main - Ensure all tests pass
- Ensure linters pass with no errors
- Update documentation if needed
- Add entries to CHANGELOG.md for user-facing changes
Include in your PR description:
- What changes were made and why
- Link to related issues
- Screenshots/examples if applicable
- Testing notes
- Breaking changes (if any)
- Maintainers will review your PR
- Address feedback in new commits
- Once approved, maintainer will merge
- PRs may be squashed on merge
- Open an issue for bugs or feature requests
- Reach out to maintainers for questions
- Check existing issues and PRs first
By contributing to Needle, you agree that your contributions will be licensed under the MIT License.