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

[Feat][DEVX-424] Map Error Code to commercetools HTTP Error Code #924

Merged
merged 5 commits into from
Feb 21, 2025

Conversation

ajimae
Copy link
Contributor

@ajimae ajimae commented Feb 5, 2025

Summary

Map error response code field to return commercetools HTTP error response code property

Completed Tasks

  • map code field to http error code
  • remove unused code and comments
  • minor refactor
  • add tests

- map code field to http error code
Copy link

changeset-bot bot commented Feb 5, 2025

🦋 Changeset detected

Latest commit: 5c2cd15

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@commercetools/ts-client Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

- fix types in the ts-sdk-apm package
Copy link

codecov bot commented Feb 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.73%. Comparing base (59c94e1) to head (5c2cd15).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #924   +/-   ##
=======================================
  Coverage   96.72%   96.73%           
=======================================
  Files         112      112           
  Lines        2139     2145    +6     
  Branches      628      633    +5     
=======================================
+ Hits         2069     2075    +6     
  Misses         63       63           
  Partials        7        7           
Flag Coverage Δ
-coverage 96.73% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@ajimae ajimae marked this pull request as ready for review February 9, 2025 15:21
@ajimae ajimae requested a review from a team as a code owner February 9, 2025 15:21
@ajimae ajimae requested review from lojzatran and jenschude and removed request for a team February 10, 2025 11:46
Copy link
Contributor

@lojzatran lojzatran left a comment

Choose a reason for hiding this comment

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

Good job 👍

I'm lacking a context here. Why are we changing the error structure? Was someone complaining? There is no support issue linked to the JIRA task.

Also it's not clear what is the decision for this task in JIRA. Please add the final decision there if it has been made.

},
})
.execute()
expect(productUpdateResponse.statusCode).toBe(200)
Copy link
Contributor

Choose a reason for hiding this comment

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

This expect is not being called at all. Should the test pass or fail if it reaches this point?

@@ -238,8 +240,7 @@ describe('Concurrent Modification Middleware', () => {
})
.execute()
} catch (e) {
console.error(e)
throw e
/** noop */
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you remove this? The test should actually fail if it reaches here.

.execute()

expect(productUpdateResponse.statusCode).toBe(200)
try {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you add try/catch? The test should actually fail if there is an exception.

message: string
code?: number
message?: string
code?: string
Copy link
Contributor

Choose a reason for hiding this comment

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

In the JIRA task this is written: We can’t change the code field to string as it would be a breaking change.

Copy link
Contributor Author

@ajimae ajimae Feb 10, 2025

Choose a reason for hiding this comment

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

That was my suggestion, I even went ahead to suggest we add a new field for it, but you specifically suggested that since it wasn't documented, we can go ahead and make the change. Have you forgotten? 🙃

I believe the outcome of our discussion was not properly represented in the JIRA ticket.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I remember I said sth, but I have forgotten 🙃 Please add the outcome to the ticket so it's clear 👍

@ajimae
Copy link
Contributor Author

ajimae commented Feb 11, 2025

I'm lacking a context here. Why are we changing the error structure? Was someone complaining? There is no support issue linked to the JIRA task.

Not really changing, there are some duplicate fields I was trying to remove and also, it's not fully following the structure of the original response object. Anyways, I guess we will have to do this in a different task.

Also it's not clear what is the decision for this task in JIRA. Please add the final decision there if it has been made.

I will definitely update the JIRA ticket to reflect the correct context.

@ajimae ajimae requested a review from lojzatran February 11, 2025 09:18
@ajimae ajimae merged commit e002f9d into master Feb 21, 2025
6 checks passed
@ajimae ajimae deleted the feat/map-http-error-code-to-ct-error-code branch February 21, 2025 00:51
@ct-changesets ct-changesets bot mentioned this pull request Feb 19, 2025
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