Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: show Terraform error details#6643

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mtojek merged 3 commits intocoder:mainfrommtojek:6453-terraform-error-details
Mar 20, 2023

Conversation

mtojek
Copy link
Member

Resolves:#6453

This PR enables Terraform diagnostics details in the site view and CLI. Unfortunately, the original formatter is in theinternal package, so I had to implement a similar one.

Screenshot 2023-03-17 at 12 43 12

Screenshot 2023-03-17 at 12 42 10

MrPeacockNLB, matifali, and bpmct reacted with heart emoji
@mtojekmtojek self-assigned thisMar 17, 2023
@mtojekmtojek marked this pull request as ready for reviewMarch 17, 2023 12:13
@mtojekmtojek requested review frombpmct andmafredriMarch 17, 2023 12:13
Copy link
Member

@mafredrimafredri left a comment

Choose a reason for hiding this comment

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

Looks good in general, but I couldn't really see how/if the existing internal formatting is used at all any longer, in which case we may lose error detail?

@@ -509,7 +512,7 @@ func convertTerraformLogLevel(logLevel string, sink logSink) proto.LogLevel {
return proto.LogLevel_DEBUG
case "info":
return proto.LogLevel_INFO
case "warn":
case "warn", "warning":
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need both?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I spotted in the original Terraform code that it has references to "warning". Maybe some Terraform versions or plugins use a different label?

mafredri reacted with thumbs up emoji
for _, value := range values {
_, _ = fmt.Fprintf(buf, " │ %s %s\n", value.Traversal, value.Statement)
}
}
Copy link
Member

Choose a reason for hiding this comment

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

It seemed like the original (internal) code is slightly more complex, do we lose any details in error output or are they surfaced some other way? It looked like function calls/args were handled in internal, but not here.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Yes, as these are not exposed byterraform-json. I think that we can live without those until any user requests them.

mafredri reacted with thumbs up emoji
@mtojekmtojekenabled auto-merge (squash)March 20, 2023 13:19
@mtojekmtojek merged commitde83723 intocoder:mainMar 20, 2023
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMar 20, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mafredrimafredrimafredri approved these changes

@bpmctbpmctbpmct approved these changes

Assignees

@mtojekmtojek

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Terraform errors don't give line numbers, making it hard to debug
3 participants
@mtojek@mafredri@bpmct

[8]ページ先頭

©2009-2025 Movatter.jp