Skip to content
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

JSON output fetching fixes #1462

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

denis256
Copy link
Member

@denis256 denis256 commented Nov 5, 2024

Description

Included changes:

  • updated Terragrunt version to latest to detect output parsing errors
  • updated Terragrunt log level flags to redirect output
  • added cleanup and formatting of json output
  • added tests to track output fetching with Terragrunt
  • added test to track unicode characters handling

Fixes #1453.
Fixes #1461.

TODOs

Read the Gruntwork contribution guidelines.

  • Update the docs.
  • Run the relevant tests successfully, including pre-commit checks.
  • Ensure any 3rd party code adheres with our license policy or delete this line if its not applicable.
  • Include release notes. If this PR is backward incompatible, include a migration guide.

Release Notes (draft)

Added / Removed / Updated [X].

Updated output parsing from Terragrunt

Migration Guide

@denis256
Copy link
Member Author

denis256 commented Nov 8, 2024

terraform-aws-ci tests are passing too

image

Copy link

@levkohimins levkohimins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if my suggestions are not relevant, I will approve it.

}
_, tgLogSet := options.EnvVars["TERRAGRUNT_DISABLE_LOG_FORMATTING"]
if !tgLogSet {
options.EnvVars["TERRAGRUNT_DISABLE_LOG_FORMATTING"] = "true"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This env var is deprecated, please use TERRAGRUNT_LOG_FORMAT=key-value

*But only if you use the latest version that supports log format.


var (
ansiLineRegex = regexp.MustCompile(`(?m)^\x1b\[[0-9;]*m.*`)
tgLogLevel = regexp.MustCompile(`.*time=\S+ level=\S+ prefix=\S+ binary=\S+ msg=.*`)
Copy link

@levkohimins levkohimins Nov 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use TERRAGRUNT_LOG_CUSTOM_FORMAT="%msg(color=disable)" to get rid of cleanJson function at all.

*But only if you use the latest version that supports custom log format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants