fix(coderd/templatebuilder): include Terraform diagnostics in import errors#26677
Open
jeremyruppel wants to merge 1 commit into
Open
fix(coderd/templatebuilder): include Terraform diagnostics in import errors#26677jeremyruppel wants to merge 1 commit into
jeremyruppel wants to merge 1 commit into
Conversation
Docs preview📖 View docs preview for |
Contributor
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
…errors ClassifyProvisionerError previously returned only the raw job error string (e.g. "terraform plan: exit status 1") for unrecognized failures, discarding the provisioner log lines it already had. This made template import errors in the builder unactionable. Now the function extracts Terraform diagnostic blocks (Error:/Warning: lines and their context) from the provisioner logs and appends them to the error detail. This surfaces the actual failure cause (missing credentials, invalid references, unsupported blocks) in the ErrorAlert banner without requiring a separate log viewer. Also adds classification for cloud provider authentication failures (AWS, GCP, Azure credential errors) with a targeted user-facing message.
882c19d to
bbc290a
Compare
6e0d67e to
38795e9
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

ClassifyProvisionerErrorpreviously returned only the raw job error string (e.g. "terraform plan: exit status 1") for unrecognized failures, discarding the provisioner log lines it already had. This made template import errors in the builder unactionable.Now the function extracts Terraform diagnostic blocks (Error:/Warning: lines and their context) from the provisioner logs and appends them to the error detail. This surfaces the actual failure cause (missing credentials, invalid references, unsupported blocks) in the ErrorAlert banner.
Changes:
extractDiagnosticsparses Terraform diagnostic blocks from log output, capped at 20 lines with a truncation markerstrings.ToLoweron the combined text\n\n)Note
This PR was authored by Coder Agents on behalf of @jeremyruppel.