-
-
Notifications
You must be signed in to change notification settings - Fork 980
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
Output run-all plan errors #1604
Open
boekkooi-fresh
wants to merge
1
commit into
gruntwork-io:main
Choose a base branch
from
boekkooi-fresh:output-plan-errors
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change looks reasonable to me, but a quick sanity check: @yorinasub17 were we suppressing
run-all plan
output intentionally by any chance to keep the logs cleaner? Or was that unintentional?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My guess is that it was done to keep the output cleaner because now there are duplicate error in the stdErr because the logger is also writing to it once the
run-all plan
is complete.I'm not sure here so what the expectations are regards to logging, terraform & hook output (stdOut & stdErr) is because right now it seems a little bit of a omelet 🙂
Would adding an extra option to terraform to specify where terraform & hook output should be written be a better option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was unintentional. I believe we merged the
run-all
changes before the logger updates, and something must have gone wrong in the merge of the two features.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, so the errors are in the logs?
I'd like to avoid extra flags/options if we can. Too many of those already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Roger
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes (see
terragrunt/configstack/stack.go
Line 91 in 37f7ae3
Makes sense.
So what is the plan forward? can we merge this or should I try some other fix? or would y'all prefer to do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what does the log output look like? And what do you expect it to look like?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well I expected the output to be the same as running multiple
terragrunt plan
outputs (which this PR makes happen).The summary of all errors was a bit of a surprise to me but it makes sense from a UX point of view then again because of this, this PR will now cause duplicate errors in the stdErr because the logger is using the same ErrWriter.
The more I'm thinking about this the more I see 2/3 flows of information.
Stack at:
and a list of modules and maybe something like Executing Module etc.Now for a single
terragrunt plan
everything looks great but therun-all plan
is streaming output from terraform directly to stdOut and a buffer for stdErr which causes some confusion for people usingrun-al plan
because some log entries are not directly written and terraform errors are not printed with the terraform output.I think a first option would be to start using a single Logger for all run-all calls this would at least avoid the issue of logs like
Executing hook:
being shown as part of the plan summary (proposed in #1612).The second thing would be to decide how to show third party (terraform/hook) output. Should it maybe be buffered so that it's written once Terraform is done running? Should the output only be written to stdOut?
The final question is what to do with the plan summary? Make it optional?
I'm honestly not sure what options are the best also because I don't have the backstory of why things where done they way they where.