Thank you for your interest in contributing to this project!
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR-USERNAME/terraform-provider-turingpi.git - Create a branch:
git checkout -b feature/your-feature
# Install dependencies
go mod tidy
# Build
go build -o terraform-provider-turingpi
# Run tests
go test -v ./...
# Run tests with race detection
go test -v -race ./...This project uses pre-commit to enforce code quality before commits reach CI.
# Install pre-commit (choose one)
pip install pre-commit
# or: brew install pre-commit
# or: pipx install pre-commit
# Install the hooks
pre-commit install
pre-commit install --hook-type commit-msg
# Run against all files (optional, for first-time setup)
pre-commit run --all-files- Go: formatting (gofmt), vetting, module tidiness, golangci-lint
- Terraform: formatting, validation, TFLint, terraform-docs
- General: trailing whitespace, YAML/JSON validity, large files, merge conflicts
- Security: detect-secrets for accidental credential commits
- Commits: conventional commit message format
- Write clear, concise commit messages
- Add tests for new functionality
- Ensure all tests pass before submitting
- Update documentation if needed
- Follow standard Go conventions (
gofmt,golint) - Run
golangci-lint runbefore submitting - Keep functions focused and well-documented
- Update the CHANGELOG.md with your changes
- Ensure CI checks pass
- Request review from maintainers
- Address any feedback
Releases are automated via Makefile targets. All releases are GPG-signed and published to the Terraform Registry.
# Full release: updates docs, runs tests, commits, tags, and pushes
make release VERSION=1.0.10This command will:
- Update version references in
README.md,docs/, andexamples/ - Run the full test suite
- Commit the version updates (GPG-signed)
- Create a signed tag
v1.0.10 - Push to origin (triggers GitHub Actions release workflow)
# Just update version numbers (no commit/tag)
make release-prep VERSION=1.0.10After the release workflow completes:
- Verify the release on GitHub Releases
- Confirm it appears on Terraform Registry
- Update
CHANGELOG.mdwith release notes
- GPG key configured for commit/tag signing (
git config commit.gpgsign true) - GPG key registered on GitHub for verified badges
- Push access to the repository
If you have access to a Turing Pi 2.5:
-
Set environment variables:
export TURINGPI_USERNAME=root export TURINGPI_PASSWORD=turing export TURINGPI_ENDPOINT=https://your-turingpi-ip
-
Create a test Terraform configuration
-
Run
terraform planandterraform apply
- Use the issue templates provided
- Include Terraform version, provider version, and Go version
- Provide minimal reproduction steps
The main branch has protection rules configured in GitHub. Recommended settings:
Enable "Require status checks to pass before merging" with these checks:
build(Go build and test)lint(golangci-lint)gosec(security scanning)tflint(Terraform example validation)
- Require pull request reviews: At least 1 approving review
- Dismiss stale reviews: When new commits are pushed
- Require review from Code Owners: Enabled (see CODEOWNERS)
- Require signed commits: Recommended for verified releases
- Require linear history: Optional, keeps history clean
- Do not allow bypassing: Even admins should follow the rules
- Go to Settings > Branches > Branch protection rules
- Click Add rule for
main - Configure the settings above
- Save changes
Open a discussion or issue if you have questions about contributing.