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

chore(DataPlanePublicAPI): Error message handling #4678

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

kkotowiczz
Copy link

What this PR changes/adds

Changed error handling method to be returned directly as list, instead of being concatenated first and then wrapped to the list

Why it does that

In order to make an error response being more readable

Further notes

N/A

Linked Issue(s)

Closes #4670

Changed error handling method to be returned directly as list, instead of being concatenated first and then wrapped to the list
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

We are always happy to welcome new contributors ❤️ To make things easier for everyone, please make sure to follow our contributors manual, check if you have already signed the ECA, and relate this pull request to an existing issue or discussion.

Copy link
Contributor

@jimmarino jimmarino left a comment

Choose a reason for hiding this comment

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

Please provide unit tests

Minor adjustment in returned value of should_returnInternalServerError_if_transferFails test, adding test case for should_returnListOfErrorsAsAResponse_if_anythingFails
@kkotowiczz kkotowiczz requested a review from jimmarino December 16, 2024 13:36
Copy link
Contributor

@jimmarino jimmarino left a comment

Choose a reason for hiding this comment

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

This PR does not properly test the changes. Please fix this.

.then()
.statusCode(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode())
.contentType(JSON)
.body("errors", is(List.class));
Copy link
Contributor

Choose a reason for hiding this comment

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

This test does not properly verify the change. Compare it to how the original test verifies the error messages.

@kkotowiczz kkotowiczz requested a review from jimmarino December 16, 2024 14:16
.then()
.statusCode(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode())
.contentType(JSON)
.body("errors", isA(List.class));
Copy link
Contributor

Choose a reason for hiding this comment

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

This still does not verify multiple messages are included. The test is only verifying a list type, which has not changed.

 Added detailed assertions to an unit test should_returnListOfErrorsAsAResponse_if_anythingFails

baseRequest()
var jsonPath = baseRequest()
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this called jsonPath?

@jimmarino
Copy link
Contributor

In the future, please:

  1. Open an issue
  2. After your issue has been approved, please create a DRAFT PR to avoid repetitive reviews.

Thx

@jimmarino jimmarino added the enhancement New feature or request label Dec 16, 2024
@kkotowiczz kkotowiczz requested a review from jimmarino December 17, 2024 07:19
Copy link

This pull request is stale because it has been open for 7 days with no activity.

@github-actions github-actions bot added the stale Open for x days with no activity label Dec 25, 2024
Copy link

github-actions bot commented Jan 1, 2025

This pull request was closed because it has been inactive for 7 days since being marked as stale.

@github-actions github-actions bot closed this Jan 1, 2025
…sponse_refactor' into DataplaneControllerAPIV2_errorResponse_refactor
…sponse_refactor' into DataplaneControllerAPIV2_errorResponse_refactor
…sponse_refactor' into DataplaneControllerAPIV2_errorResponse_refactor
@ndr-brt ndr-brt removed the stale Open for x days with no activity label Jan 7, 2025
@ndr-brt ndr-brt reopened this Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DataplanePublicApiControler completable future failure messages are returned as contatenated string
3 participants