Skip to content

Expose SignalFx 4xx API error details across provider#682

Draft
tnoff wants to merge 2 commits intosplunk-terraform:mainfrom
tnoff:feat/expose-sfx-400-details
Draft

Expose SignalFx 4xx API error details across provider#682
tnoff wants to merge 2 commits intosplunk-terraform:mainfrom
tnoff:feat/expose-sfx-400-details

Conversation

@tnoff
Copy link
Copy Markdown

@tnoff tnoff commented Nov 18, 2025

Issue: When creating/updating chart resources, 400 responses do not show the response text to show the exact error of why something failed

Workaround: Currently if you run the terraform command with TF_LOG=debug in the front to show the full response back from the API the error is shown

Proposal: Expose the 4xx api details for charts

- Centralize diagnostic surfacing in tfext.AsErrorDiagnostics for ResponseError (adds Details to diagnostics)
- Add common.WrapResponseError and use it in *_chart resources with common.HandleError to preserve 404 state clearing
- Update tests and helpers to accept Detail field while keeping Summary stable

Droid-assisted
@tnoff tnoff requested review from a team and dwalasek as code owners November 18, 2025 20:23
@MovieStoreGuy
Copy link
Copy Markdown
Collaborator

Hey @tnoff,

Thank you for your contribution :D

I apologise because my attention is elsewhere for the moment, and I'd like to give this the attention it deserves.
Please give me a week to come back to have a thorough look through this and provide feedback.

For the time being I'll run the pipeline to perform the simple validation.

@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 20, 2025

Codecov Report

❌ Patch coverage is 83.33333% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.29%. Comparing base (530b367) to head (4ae4f0c).
⚠️ Report is 44 commits behind head on main.

Files with missing lines Patch % Lines
internal/common/error.go 54.54% 2 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #682      +/-   ##
==========================================
- Coverage   94.38%   94.29%   -0.09%     
==========================================
  Files          77       77              
  Lines        3813     3842      +29     
==========================================
+ Hits         3599     3623      +24     
- Misses        143      145       +2     
- Partials       71       74       +3     

☔ View full report in Codecov by Sentry.
📢 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.

- Run lint --fix to resolve gci import formatting in internal/common/error.go
- Add tests for tfext AsErrorDiagnostics handling of ResponseError (direct and wrapped)
- Add tests for common.WrapResponseError preserving identity/message

All linters pass; unit tests green with coverage generated.

Droid-assisted
@tnoff
Copy link
Copy Markdown
Author

tnoff commented Nov 20, 2025

@MovieStoreGuy thank you! I just added some updates to hopefully address the issues it found in the original commit

@MovieStoreGuy
Copy link
Copy Markdown
Collaborator

Have not forgotten about this sorry, just thought these errors were already expanded as part of the decorators.

Let me double check why that isn't the case.

@MovieStoreGuy
Copy link
Copy Markdown
Collaborator

Hey @tnoff ,

I had recently added https://github.com/splunk-terraform/terraform-provider-signalfx/blob/main/signalfx/provider_decorator.go#L37:L53 into the provider that should be doing the same thing as you're attempting to do. Is this not working for you?

@tnoff
Copy link
Copy Markdown
Author

tnoff commented Jan 16, 2026

@MovieStoreGuy ah lemme try that, I believe we're on 9.7.2, lemme update to 9.21.0 per d113862

@MovieStoreGuy
Copy link
Copy Markdown
Collaborator

Was there any updates @tnoff ?

@MovieStoreGuy MovieStoreGuy marked this pull request as draft April 2, 2026 00:15
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.

2 participants