fix(coderd/templatebuilder): include Terraform diagnostics in import errors - #26677
#26677Merged
jeremyruppel merged 4 commits intoJun 30, 2026
maincoder/coder:mainfrom
jeremy/devex-521-template-import-errorscoder/coder:jeremy/devex-521-template-import-errorsCopy head branch name to clipboard
Merged
fix(coderd/templatebuilder): include Terraform diagnostics in import errors#26677jeremyruppel merged 4 commits intomaincoder/coder:mainfrom jeremy/devex-521-template-import-errorscoder/coder:jeremy/devex-521-template-import-errorsCopy head branch name to clipboard
jeremyruppel merged 4 commits into
maincoder/coder:mainfrom
jeremy/devex-521-template-import-errorscoder/coder:jeremy/devex-521-template-import-errorsCopy head branch name to clipboard
Conversation
Docs preview📖 View docs preview for |
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
jeremyruppel
force-pushed
the
jeremy/devex-521-template-import-errors
branch
from
June 24, 2026 19:23
882c19d to
bbc290a
Compare
jeremyruppel
force-pushed
the
jeremy/devex-515-base-templates
branch
from
June 24, 2026 19:23
6e0d67e to
38795e9
Compare
jeremyruppel
marked this pull request as ready for review
June 24, 2026 20:02
jeremyruppel
force-pushed
the
jeremy/devex-515-base-templates
branch
from
June 30, 2026 19:29
38795e9 to
5ca0705
Compare
jeremyruppel
force-pushed
the
jeremy/devex-521-template-import-errors
branch
from
June 30, 2026 19:29
bbc290a to
3b2b878
Compare
jeremyruppel
force-pushed
the
jeremy/devex-515-base-templates
branch
from
June 30, 2026 21:53
5ca0705 to
a8c63d6
Compare
jeremyruppel
force-pushed
the
jeremy/devex-521-template-import-errors
branch
2 times, most recently
from
June 30, 2026 22:01
2ecbb7b to
8a1ba0d
Compare
jeremyruppel
force-pushed
the
jeremy/devex-515-base-templates
branch
from
June 30, 2026 22:09
516a437 to
825db41
Compare
jeremyruppel
force-pushed
the
jeremy/devex-521-template-import-errors
branch
from
June 30, 2026 22:10
8a1ba0d to
1b9b138
Compare
code-asher
approved these changes
Jun 30, 2026
code-asher
left a comment
Member
There was a problem hiding this comment.
Nice! Too bad we have to sniff strings but it is what it is.
…providers Add 7 new base templates to the template builder: - scratch: minimal starter template (coder_agent only) - aws-windows: AWS EC2 Windows instances - azure-linux: Azure VMs with cloud-init and managed disk - azure-windows: Azure Windows VMs with RDP support - gcp-linux: Google Compute Engine Linux instances - gcp-windows: Google Compute Engine Windows instances - digitalocean-linux: DigitalOcean Linux droplets Each base includes a manifest (base.json), Go template (main.tf.tmpl), README with prerequisite markers, and any static files (cloud-init configs, PowerShell scripts). Tests verify all bases load, render, and produce valid coder_agent declarations.
…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.
jeremyruppel
force-pushed
the
jeremy/devex-521-template-import-errors
branch
from
June 30, 2026 22:27
1b9b138 to
1f3b8f1
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.