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

Add -no-color argument to terraform validation #5843

Conversation

kristianheljas
Copy link
Contributor

SUMMARY

When terraform validation step failed, ansible produced output with ANSI escape codes due to missing -no-color argument

Fixes #5816

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

terraform

ADDITIONAL INFORMATION

Before:

{..., "msg": "\u001b[31m╷\u001b[0m\u001b[0m\n\u001b[31m│\u001b[0m \u001b[0m\u001b[1m\u001b[31mError: ...

After:

{..., "msg": "\nError: ...

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added WIP Work in progress bug This issue/PR relates to a bug cloud module module new_contributor Help guide this first time contributor plugins plugin (any type) small_patch Hopefully easy to review labels Jan 15, 2023
@kristianheljas kristianheljas force-pushed the terraform-validate-no-color branch from 1e87fe7 to 9609ea8 Compare January 15, 2023 10:57
@kristianheljas kristianheljas marked this pull request as ready for review January 15, 2023 10:59
@ansibullbot ansibullbot removed WIP Work in progress small_patch Hopefully easy to review labels Jan 15, 2023
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-5 labels Jan 15, 2023
@felixfontein
Copy link
Collaborator

Looks sensible to me. Do you happen to know if -no-color has been supported forever, or does this require a minimum version of terraform?

@kristianheljas
Copy link
Contributor Author

kristianheljas commented Jan 15, 2023

@felixfontein According to the very first release tag 0.1.0, yes, way before validate command was added in 0.6.12 (February 24, 2016).

I could a more meaningul error message in case of < 0.6.12 if you deem this appropriate.

I thought about specifying the minimum version in the module docstring as well, but that would be quite a task on its own - validating each subcommand and argument this module uses.

Copy link
Collaborator

@russoz russoz left a comment

Choose a reason for hiding this comment

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

Also looks good to me.

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Jan 16, 2023
@felixfontein felixfontein merged commit 44172dd into ansible-collections:main Jan 16, 2023
@patchback
Copy link

patchback bot commented Jan 16, 2023

Backport to stable-5: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-5/44172ddaa6130d2441954da54da0ea70caf41521/pr-5843

Backported as #5846

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@felixfontein
Copy link
Collaborator

@kristianheljas thanks for fixing this!
@russoz thanks for reviewing!

patchback bot pushed a commit that referenced this pull request Jan 16, 2023
@patchback
Copy link

patchback bot commented Jan 16, 2023

Backport to stable-6: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-6/44172ddaa6130d2441954da54da0ea70caf41521/pr-5843

Backported as #5847

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Jan 16, 2023
felixfontein pushed a commit that referenced this pull request Jan 16, 2023
…aform validation (#5847)

Add -no-color argument to terraform validation (#5843)

(cherry picked from commit 44172dd)

Co-authored-by: Kristian Heljas <[email protected]>
felixfontein pushed a commit that referenced this pull request Jan 16, 2023
…aform validation (#5846)

Add -no-color argument to terraform validation (#5843)

(cherry picked from commit 44172dd)

Co-authored-by: Kristian Heljas <[email protected]>
@felixfontein felixfontein mentioned this pull request Jan 28, 2023
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug cloud has_issue module module new_contributor Help guide this first time contributor plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Terraform error is unreadable
4 participants