Repository navigation
fix: match changed files against block include_patterns when gating terragrunt generation - #2766
Open
kornelwencek-esky wants to merge 1 commit into
Conversation
…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
marked this pull request as ready for review
November 4, 2026 11:43
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #2485
HandleYamlProjectGenerationgates terragrunt block processing oncheckBlockInChangedFiles, which only matched changed files under the block'sroot_dir. When a PR changed only files matching a block'sinclude_patterns(and nothing insideroot_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 samedoublestar.PathMatchmatching as the rest of the config. The skip optimization is preserved for unrelated changes.Changes
checkBlockInChangedFilestakes the block's include patterns and matches changed files against theminclude_patternsignored unless at least one project has direct changes #2485)Both new tests fail on
developand pass with this change;go test ./libs/digger_config/...and theterragrunt/tacpackage 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.