Thank you for your interest in contributing to DNSControl! This guide will help you get started.
- Go 1.27+ (see
go.modfor the exact version) - golangci-lint (optional, used by CI and
bin/generate-all.sh) - staticcheck (optional, used by
bin/generate-all.sh)
Build the binary:
go build .Run all unit tests:
go test ./...Run tests for a specific package:
go test ./pkg/spflib/Run a single test:
go test ./pkg/spflib/ -run TestParseQualifiedMechanismsRun the linter:
golangci-lint runRun bin/generate-all.sh from the repository root. This script handles formatting, code generation, linting, and keeping generated files in sync:
bin/generate-all.shIt runs go fmt, go generate, go mod tidy, JSON formatting, and optionally golangci-lint and staticcheck if they are installed.
DNSControl squash-merges pull requests, so the pull request title becomes the commit message on main. The title must follow Conventional Commits: type(scope): subject. The PR: Commitlint check enforces this with the rules in commitlint.config.js. The commits inside your pull request are not checked.
| Type | Use for |
|---|---|
feat |
New functionality |
fix |
Bug fixes |
docs |
Documentation changes |
perf |
Performance improvements |
refactor |
Code refactoring |
style |
Code style changes |
test |
Test additions or changes |
build or ci |
Build and CI/CD changes |
chore |
Maintenance, dependency updates |
Rules:
- Provider-specific changes use the scope
p/PROVIDERNAME, for examplefix(p/CLOUDFLAREAPI): correct TTL roundingorfeat(p/ROUTE53): support alias records for NS. - Other scopes are optional and must be a single word, for example
chore(deps): update dependencies. - The subject starts with a lowercase letter.
fix(p/ROUTE53): Fix ...fails the check. - Mark a breaking change with
!after the type or scope, for examplefeat(p/BIND)!: ....
To check a title locally, run npm install once, then:
echo "fix(p/ROUTE53): correct TTL rounding" | npx commitlintGoReleaser uses the type and scope to group the release changelog. test and chore changes are left out of the changelog. See .goreleaser.yml for the exact patterns.
Integration tests run real DNS operations against a provider's API. They require credentials and a dedicated test zone. See the integration test documentation for setup instructions.
go test ./integrationTest/ -v -args -provider PROVIDERNAMESee Writing new DNS providers for a step-by-step guide on implementing a new DNS provider.
Additional developer resources are available in the developer info section of the documentation.