Skip to content

fix(terraform): improve error message for terraform plan failure#1549

Merged
ramya18101 merged 2 commits into
mainfrom
fix/terraform-surface-hc-install-error
Jun 15, 2026
Merged

fix(terraform): improve error message for terraform plan failure#1549
ramya18101 merged 2 commits into
mainfrom
fix/terraform-surface-hc-install-error

Conversation

@ramya18101

@ramya18101 ramya18101 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Problem

When hc-install fails to install Terraform (e.g. due to an expired OpenPGP key: unable to verify checksums signature: openpgp: invalid message: openpgp: key expired), the error was silently discarded. The user saw only a generic message:

"Terraform resource config generated successfully but there was an error with terraform plan."

This was misleading on two counts:

  1. The error came from the install step, not from terraform plan.
  2. The actual error message was never shown, leaving users with no actionable information.

🔧 Changes

Include the real error in the warning output so users can diagnose what went wrong — whether it's an OpenPGP verification failure, a network error, a version resolution issue, or anything else from hc-install or tfexec.

📚 References

#1499 (comment)

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

@ramya18101 ramya18101 marked this pull request as ready for review June 15, 2026 04:37
@ramya18101 ramya18101 requested a review from a team as a code owner June 15, 2026 04:37
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.32%. Comparing base (ff0b1b9) to head (24ae536).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
internal/cli/terraform.go 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1549      +/-   ##
==========================================
- Coverage   59.33%   59.32%   -0.01%     
==========================================
  Files         121      121              
  Lines       23237    23240       +3     
==========================================
  Hits        13787    13787              
- Misses       8576     8579       +3     
  Partials      874      874              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ramya18101 ramya18101 merged commit b349399 into main Jun 15, 2026
6 checks passed
@ramya18101 ramya18101 deleted the fix/terraform-surface-hc-install-error branch June 15, 2026 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants