Fix broken terragrunt stack output functionality and tests#1578
Merged
james00012 merged 2 commits intomainfrom Aug 5, 2025
Merged
Fix broken terragrunt stack output functionality and tests#1578james00012 merged 2 commits intomainfrom
james00012 merged 2 commits intomainfrom
Conversation
96c28cd to
0e88f19
Compare
The terragrunt stack output commands were failing because runTerragruntStackCommandE was adding a "--" separator that the output subcommand doesn't support. This commit fixes the issue by adding a new function that allows callers to control whether the separator is used. Changes: - Add runTerragruntStackCommandWithSeparatorE that accepts a useArgSeparator parameter - Update runTerragruntStackCommandE to call the new function with useArgSeparator=true for backward compatibility - Update TgOutputE and TgOutputJsonE to call runTerragruntStackCommandWithSeparatorE with useArgSeparator=false The output command has different argument handling than other stack subcommands (like run) and cannot use the -- separator.
0e88f19 to
ed5147e
Compare
denis256
approved these changes
Aug 4, 2025
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.
Summary
This PR fixes the broken terragrunt stack output functionality by ensuring the
outputsubcommand doesn't use the--separator, which was causing empty output and failing tests.Problem
The terragrunt stack output command was incorrectly using the
--separator, which is only needed for therunsubcommand. This caused:terragrunt stack outputcommandsTestTgOutputIntegrationandTestTgOutputErrorHandlingterragrunt stack output -- -no-color motherinstead ofterragrunt stack output -no-color motherSolution
runTerragruntStackSubCommandEto only add--separator forrunsubcommandTgOutputEandTgOutputJsonEto use the shared command execution logicChanges
runTerragruntStackSubCommandETest plan
TestTgOutputIntegration- tests basic output functionalityTestTgOutputErrorHandling- tests error cases