-
Notifications
You must be signed in to change notification settings - Fork 571
Fix: include_patterns ignored for terragrunt blocks without direct changes #2515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Fix: include_patterns ignored for terragrunt blocks without direct changes #2515
Conversation
…nges This commit fixes issue diggerhq#2485 where include_patterns were only evaluated when at least one project had direct file changes in its root directory. The bug was in the HandleYamlProjectGeneration function where the entire terragrunt block processing was wrapped in a checkBlockInChangedFiles() conditional. This prevented include_patterns from being merged into projects when only files matching the include_patterns changed (but not files in the project's root directory). Changes: - Removed the checkBlockInChangedFiles() conditional wrapper for terragrunt block processing - Terragrunt projects are now always generated for blocks - include_patterns and exclude_patterns are always merged, allowing pattern matching to occur in GetModifiedProjects() regardless of direct changes This ensures consistent behavior between terragrunt and non-terragrunt blocks, where include_patterns are evaluated independently of direct project changes. Fixes diggerhq#2485 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
|
this is an AI project test please ignore |
🤖 AI Code ReviewSummaryThis PR successfully fixes issue #2485 where Verdict: ✅ APPROVE - This is a correct and necessary bug fix. AnalysisThe Root CauseThe bug was in This caused three different behaviors:
The FixThe PR removes the conditional wrapper (lines 9, 103-105 in the diff), ensuring that:
Issues Found✅ No Critical Issues 🟡 Performance Consideration (Important)The removed
Recommendation: Monitor performance in production environments with large numbers of Terragrunt blocks. If performance degrades, consider:
🔵 Test Coverage Gap (Minor)The existing test Recommendation: Add a regression test that:
Code Quality✅ Strengths:
✅ Correctness:
Test Results
Security Review✅ No Security Concerns
Suggestions
RecommendationAPPROVE - This PR should be merged. It correctly fixes the reported bug with a minimal, well-documented change. The performance consideration is worth monitoring but doesn't block the fix, as correctness takes precedence over optimization. The fix ensures that Digger's 🤖 Reviewed by Claude Code AI PR Reviewer |
Summary
This PR fixes issue #2485 where
include_patternswere only evaluated when at least one project had direct file changes in its root directory.Problem
The bug was in the
HandleYamlProjectGenerationfunction where the entire terragrunt block processing (including the merging ofinclude_patternsandexclude_patterns) was wrapped in acheckBlockInChangedFiles()conditional at line 422.This caused three different behaviors:
Case 1 (Working): Modifying files within a project → Project is planned ✅
Case 2 (Working): Modifying both project files AND files matching
include_patterns→ All projects are planned ✅Case 3 (Broken): Modifying only files matching
include_patterns→ No projects are planned ❌Solution
Removed the
checkBlockInChangedFiles()conditional wrapper that was preventing pattern evaluation. Now:include_patternsandexclude_patternsare always merged into projectsGetModifiedProjects()regardless of direct project changesChanges
libs/digger_config/digger_config.goTest plan
include_patternsfiles changeinclude_patternsfiles changeFixes #2485
🤖 Generated with Claude Code