Skip to content

feat(autodetect): apply plugin-declared project exclusions [FIX-592] - #29

Merged
liamg merged 1 commit into
mainfrom
fix-592-plugin-declared-exclusions
Aug 17, 2026
Merged

liamg merged 1 commit into
mainfrom
fix-592-plugin-declared-exclusions

Conversation

@liamg

@liamg liamg commented Aug 17, 2026

Copy link
Copy Markdown
Member

Autodetect now applies the exclusion conditions plugins declare (proto v1.167.0) instead of hardcoding per-format rules. Fixes FIX-592, where ~2.9k projects in one repo silently disappeared.

  • exclude_if_repo_contains replaces "if terragrunt exists anywhere, drop all terraform projects"
  • exclude_if_inside replaces "drop non-terraform/terragrunt projects nested in a project" — that rule was written for CloudFormation but caught every other type, which is what dropped the projects
  • Only surviving projects can exclude anything. A directory dropped earlier (a .tf with no provider or backend) no longer suppresses its subtree — previously it did so while not even appearing in the output
  • Terragrunt shared-config dirs are now the terragrunt plugin's call, so config's include sniff no longer filters them
  • Pre-plugin rules kept for the no-plugin path, where identification also falls back to local file sniffing. generate_test.go expectations are unchanged.

Needs the plugin releases already out: terraform v0.0.53, cloudformation v0.0.34, terragrunt v0.0.55.

Testing

Full suite green, golangci-lint clean. Four new e2e tests against the released plugins; the two FIX-592 ones were confirmed to fail before this change (0 cisco projects, CFN template suppressed).

Plugins declare when another format supersedes them (exclude_if_repo_contains,
exclude_if_inside) and autodetect applies those instead of hardcoding the rules
per format. Only projects that survive filtering can exclude anything, so a
directory dropped for having no provider or backend no longer silently discards
its whole subtree - which is what dropped ~2.9k projects in one repo.

The pre-plugin rules are kept for the path that runs without any plugins, where
identification also falls back to local file sniffing.
@liamg liamg self-assigned this Aug 17, 2026
@liamg
liamg marked this pull request as ready for review August 17, 2026 10:42
@liamg
liamg merged commit 3338435 into main Aug 17, 2026
3 checks passed
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.

2 participants