$ show diggerhq/digger
Digger (now OpenTaco) is an infrastructure-as-code orchestration platform that automates Terraform, OpenTofu, Terragrunt, and Pulumi workflows within existing CI/CD pipelines. The system provides PR-level automation (plan/apply comments), drift detection, policy-as-code via OPA, and an optional Terraform Enterprise-compatible state management and remote execution layer. It integrates with GitHub, GitLab, Bitbucket, Azure DevOps, and Buildkite through webhooks and CI backends. The architecture is a multi-service monorepo: a Go backend (Gin/GORM) handles webhooks, job scheduling, and a web UI; a separate CLI tool (cobra) runs directly in CI; a drift detection service with cron scheduling; a sandbox sidecar (TypeScript/Node) for remote execution; and the Taco service (Echo) that reimplements TFE APIs for state management, RBAC, and run execution. The UI is a React/TanStack Router app with WorkOS authentication. The codebase is actively maintained with frequent releases, extensive SQL migrations, Helm charts for Kubernetes deployment, and dual open-core and enterprise (ee/) feature sets.
The LLM identified 5 files worth highlighting for reuse:
Provides a clean interface for distributed locks with implementations for AWS DynamoDB, Azure Storage Tables, GCP Cloud Storage, and an in-memory NoOp variant. The factory function 'GetLock' selects the correct backend from environment config. This is a self-contained, pluggable component that could be extracted and reused in any system requiring distributed mutexes.
Core configuration engine that loads digger.yml, discovers projects from filesystem (Terraform/Terragrunt/Pulumi folders), resolves dependencies, validates apply requirements, and handles environment variable interpolation. Includes multiple DirWalker implementations and Terragrunt HCL parsing via a partial parser. Reusable as a generic IaC configuration library.
Evaluates OPA/Rego policies for access control, plan approval, apply approval, and drift detection. Implements hierarchical policy resolution (project-level → org-level → default) with caching and multiple provider backends (HTTP, file, management repo). A clean abstraction that could be reused for any Rego-based policy evaluation in CI/CD pipelines.
Implements the UnitStore interface using S3-compatible object storage. Handles Terraform state versioning with timestamped versions, lock files, cleanup of old versions (configurable max), and async blob creation. Uses AWS SDK and supports SigV4 signing. The versioning pattern, lock management, and cleanup logic are reusable for any versioned blob storage need.
Provides topological sort and impact analysis for project dependencies. Implements 'ImpactedProjectsOnlyGraph' to filter projects affected by changes and 'TraverseGraphVisitAllParentsFirst' for ordered execution. Small (<100 lines), purely algorithmic, with zero internal imports beyond standard library. Directly reusable in any Go project needing DAG traversal.