Skip to content

fix: match changed files against block include_patterns when gating terragrunt generation - #2766

Open
kornelwencek-esky wants to merge 1 commit into
diggerhq:developfrom
kornelwencek-esky:fix/terragrunt-block-include-patterns-gate
Open

kornelwencek-esky wants to merge 1 commit into
diggerhq:developfrom
kornelwencek-esky:fix/terragrunt-block-include-patterns-gate

Conversation

@kornelwencek-esky

Copy link
Copy Markdown

Description

Fixes #2485

HandleYamlProjectGeneration gates terragrunt block processing on checkBlockInChangedFiles, which only matched changed files under the block's root_dir. When a PR changed only files matching a block's include_patterns (and nothing inside root_dir), the block was skipped entirely: no projects were generated and no plans ran, although the generated projects have those patterns merged into their autoplan triggers.

The gate now also matches changed files against the block's include_patterns, using the same doublestar.PathMatch matching as the rest of the config. The skip optimization is preserved for unrelated changes.

Changes

Both new tests fail on develop and pass with this change; go test ./libs/digger_config/... and the terragrunt/tac package pass locally.

🧠 Ai UsageDetails (if applicable):

Used an AI coding assistant to draft the fix and tests; reviewed and verified manually, all tests run locally.

…erragrunt generation

HandleYamlProjectGeneration gates terragrunt block processing on
checkBlockInChangedFiles, which only matched changed files under the
block's root_dir. When a PR changed only files matching a block's
include_patterns (and nothing inside root_dir), the block was skipped
entirely: no projects were generated and no plans ran, even though
include_patterns are merged into the generated projects' autoplan
triggers.

The gate now also matches changed files against the block's
include_patterns (same doublestar matching as the rest of the config),
preserving the skip optimization for unrelated changes.

Fixes diggerhq#2485
@kornelwencek-esky
kornelwencek-esky marked this pull request as ready for review November 4, 2026 11:43

This branch has not been deployed

No deployments
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.

include_patterns ignored unless at least one project has direct changes

1 participant