Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(errors): flatten sdk problem chains to reduce hash complexity #218

Merged
merged 1 commit into from
May 8, 2024

Conversation

dpopp07
Copy link
Member

@dpopp07 dpopp07 commented May 7, 2024

Previously, any SDKProblem instance could be used as the "caused by" for another SDKProblem instance and its ID would become a part of the hash. This meant that problems created between service SDKs and the Go SDK Core would have a lot of complexity - the error scenarios tracked would be unnecessarily granular and numerous.

This change updates the system to maintain one problem scenario per context (where a context is either HTTP, SDK, or Terraform) rather than per every component within a given context.

It also provides for keeping knowledge of problem scenarios originating in the core for easier debugging and easier attaching of HTTP errors to service SDK problems.

Previously, any SDKProblem instance could be used as the "caused by"
for another SDKProblem instance and its ID would become a part of
the hash. This meant that problems created between service SDKs and
the Go SDK Core would have a lot of complexity - the error scenarios
tracked would be unnecessarily granular and numerous.

This change updates the system to maintain one problem scenario per
*context* (where a context is either HTTP, SDK, or Terraform) rather
than per every component within a given context.

It also provides for keeping knowledge of problem scenarios originating
in the core for easier debugging and easier attaching of HTTP errors to
service SDK problems.

Signed-off-by: Dustin Popp <dpopp07@gmail.com>
@dpopp07 dpopp07 requested review from padamstx and pyrooka May 7, 2024 20:38
Copy link
Member

@pyrooka pyrooka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link
Member

@padamstx padamstx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dpopp07 dpopp07 merged commit 9fc1ebc into main May 8, 2024
4 checks passed
@dpopp07 dpopp07 deleted the dp/flatten-sdk-problem-chains branch May 8, 2024 16:42
ibm-devx-sdk pushed a commit that referenced this pull request May 8, 2024
## [5.17.2](v5.17.1...v5.17.2) (2024-05-08)

### Bug Fixes

* **errors:** flatten sdk problem chains to reduce hash complexity ([#218](#218)) ([9fc1ebc](9fc1ebc))
@ibm-devx-sdk
Copy link

🎉 This PR is included in version 5.17.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants