Skip to content

feat: add dependency file triggers for terraform matching#2640

Open
vedant-rox wants to merge 1 commit into
diggerhq:developfrom
vedant-rox:codex/issue-791-trigger-patterns
Open

feat: add dependency file triggers for terraform matching#2640
vedant-rox wants to merge 1 commit into
diggerhq:developfrom
vedant-rox:codex/issue-791-trigger-patterns

Conversation

@vedant-rox
Copy link
Copy Markdown

Summary

This PR is the new first reviewable slice of #791.

It adds an opt-in dependency_file_triggers feature for Terraform/OpenTofu projects that narrows changed-file matching by following local module imports recursively and adding the imported module *.tf* files to each project's trigger patterns.

Scope

This PR intentionally stays within docs/ and libs/digger_config/.

Included here:

  • YAML/config support for dependency_file_triggers
  • trigger-pattern discovery for local Terraform/OpenTofu modules
  • generated-project support for Terraform/OpenTofu generation paths
  • validation for unsupported Terragrunt/Pulumi usage
  • docs and regression tests

Explicitly not included here:

  • inferred project dependency edges
  • hard dependency propagation changes
  • GitHub/GitLab event semantics
  • Terragrunt trigger discovery or hardening

Safety

  • the feature is opt-in via dependency_file_triggers: true
  • existing include_patterns / exclude_patterns behavior remains in place
  • exclude_patterns still take precedence over derived trigger paths
  • generated Terraform/OpenTofu projects can opt in
  • Terragrunt and Pulumi reject dependency_file_triggers explicitly in this slice

Validation

  • cd libs && env GOTOOLCHAIN=local GOTELEMETRY=off GOCACHE=/tmp/digger-go-cache GOMODCACHE=/tmp/digger-go-modcache /opt/homebrew/opt/go@1.25/bin/go test ./digger_config/...

Docs

  • updated the config reference for dependency_file_triggers
  • updated the include/exclude patterns guide with the narrower dependency-file-based triggering option

Follow-up

The inferred dependency-edge / hard-mode propagation behavior is being kept as a separate follow-up PR because that is where the recent review feedback and CI-semantic risk has been concentrated.

AI disclosure

This PR was prepared with assistance from Codex (OpenAI).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant