mirror of
https://github.com/coder/coder.git
synced 2026-09-21 20:51:01 +08:00
`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. Changes: - `extractDiagnostics` parses Terraform diagnostic blocks from log output, capped at 20 lines with a truncation marker - Auth error classification for AWS, GCP, Azure credential failures with a targeted user-facing message - Case-insensitive pattern matching via `strings.ToLower` on the combined text - Auth branch guarded against empty diagnostics (no trailing `\n\n`) > [!NOTE] > This PR was authored by Coder Agents on behalf of @jeremyruppel.