Skip to content

Conversation

@justushar
Copy link
Collaborator

WHAT

Adds Terragrunt Parser and Terragrunt consolidated output mode for Plan operations to provide a single consolidated plan. Adds default support for Terragrunt run-all command in tfnotify.

(Write the change being made with this pull request)

WHY

For better UX in case of Terragrunt.
(Write the motivation why you submit this pull request)

@justushar justushar requested a review from j-njoto as a code owner December 24, 2025 07:14
The TerragruntParser was always calling ParseWithConsolidation with
consolidated=false, even when the --consolidated flag was set. This
prevented the consolidation logic from ever executing, resulting in
multiple separate comments instead of one consolidated comment.

Changes:
- Add Consolidated field to TerragruntParser struct
- Update NewTerragruntParser to accept consolidated parameter
- Modified Parse() to use p.Consolidated instead of hardcoded false
- Update plan.go and apply.go to pass true when consolidated mode enabled
- Fix test files to pass explicit false for non-consolidated tests

This fixes the issue where Terragrunt run-all would post separate
comments for each module instead of consolidating them into a single
comment when --consolidated flag is used.
…lidated mode

- Capture 'No changes' and 'Plan: X to add' summary lines
- Capture resource diff details (lines with +, -, ~, #)
- Capture terraform action headers
- Strip terragrunt prefix before appending to buffer

This fixes empty module summaries in consolidated comments.
…onsolidation

- Skip duplicate consecutive lines in module buffers
- Exclude root module '.' from consolidated output
- Prevent 'No changes' from appearing multiple times
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