Skip to content

fix(cloud): cloud backend rendering query warning diags#38040

Merged
mjyocca merged 6 commits intomainfrom
tfsearch/TF-32031-fix-query-diags
Jan 13, 2026
Merged

fix(cloud): cloud backend rendering query warning diags#38040
mjyocca merged 6 commits intomainfrom
tfsearch/TF-32031-fix-query-diags

Conversation

@mjyocca
Copy link
Collaborator

@mjyocca mjyocca commented Jan 5, 2026

Fixes an issue where any warning diagnostics generated during terraform query execution failed to render in the cloud backend session. Adds a default json log case statement to catch possible diagnostics to surface to the user.

Target Release

1.14.x

Rollback Plan

  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

CHANGELOG entry

  • This change is user-facing and I added a changelog entry.
  • This change is not user-facing.

@mjyocca mjyocca added the 1.14-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged label Jan 8, 2026
@mjyocca mjyocca marked this pull request as ready for review January 8, 2026 19:48
@mjyocca mjyocca requested review from a team as code owners January 8, 2026 19:48
@dbanck dbanck self-assigned this Jan 9, 2026
Copy link
Member

@dbanck dbanck left a comment

Choose a reason for hiding this comment

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

Nice catch and thanks for raising the PR!

The JSON has a small typo which trips up the parser and the render logic afterwards. Here is where the parsing fails and the message gets emitted as regular raw CLI output:

log := &jsonformat.JSONLog{}
if err := json.Unmarshal(line, log); err != nil {
// If we can not parse the line as JSON, we will simply
// print the line. This maintains backwards compatibility for
// users who do not wish to enable structured output in their
// workspace.
b.CLI.Output(string(line))
continue
}

This prints out the whole JSON line to stdout and allows your test case to pass. Without the typo, the renderer will print a nicely formatting diagnostic message, but the test case will need an update to capture this. I left some comments inline for this.

Thanks again!

@mjyocca mjyocca requested review from dbanck and sebasslash January 12, 2026 21:48
Copy link
Member

@dbanck dbanck left a comment

Choose a reason for hiding this comment

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

Thanks 🌟

Copy link
Contributor

@sebasslash sebasslash left a comment

Choose a reason for hiding this comment

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

🚀 Legendary

@mjyocca mjyocca merged commit 810f497 into main Jan 13, 2026
9 checks passed
@mjyocca mjyocca deleted the tfsearch/TF-32031-fix-query-diags branch January 13, 2026 16:48
@github-actions
Copy link
Contributor

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

1.14-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments