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: Allow access to failed batch request #347

Merged
merged 30 commits into from
Mar 15, 2024

Conversation

CharlesDuboisSAP
Copy link
Contributor

@CharlesDuboisSAP CharlesDuboisSAP commented Mar 6, 2024

Summary

This PR addresses the issue raised in the backlog item #426. It introduces changes to allow users to access responses of failed "sub-requests" in a batch request. This is achieved by mapping the batch request content to the response via the Content-ID.

Changes

The changes in this PR are as follows:

  1. The requireHealthyResponse method in the ODataHealthyResponseValidator class is modified. It now tries to extract the Content-ID from the HTTP response and uses it to create an ODataResponseException.

  2. The field request of ODataException now stores the specific failed OData batch changeset.

  3. testBatchWithErrorInChangeset() checks that exception.getRequest() now always return the failed changeset.

Instructions for Reviewers

Please review the changes in the context of the batch request handling. Pay special attention to the error handling and the new test case. Please also verify if the Content-ID is correctly extracted from the HTTP response and if the request field is correctly set in the ODataException.

@CharlesDuboisSAP CharlesDuboisSAP self-assigned this Mar 6, 2024
@CharlesDuboisSAP CharlesDuboisSAP changed the title feat: Allow access to responses of failed "sub-requests" in batch request feat: Allow access to failed batch request number Mar 6, 2024
@CharlesDuboisSAP CharlesDuboisSAP added the please review Request to review a pull request label Mar 6, 2024
Base automatically changed from fix-closeresource-pmd-warning to main March 8, 2024 09:09
@CharlesDuboisSAP CharlesDuboisSAP added please merge Request to merge a pull request and removed please merge Request to merge a pull request labels Mar 8, 2024
@CharlesDuboisSAP CharlesDuboisSAP changed the title feat: Allow access to failed batch request number feat: Allow access to failed batch request Mar 8, 2024
@CharlesDuboisSAP CharlesDuboisSAP added the please merge Request to merge a pull request label Mar 8, 2024
newtork and others added 9 commits March 8, 2024 16:23
…tent-id

# Conflicts:
#	datamodel/odata-client/src/main/java/com/sap/cloud/sdk/datamodel/odata/client/request/MultipartParser.java
…el/odata/client/request/ODataRequestResultMultipartGeneric.java
…to 426-failedBatchRequestNumber

# Conflicts:
#	datamodel/odata-client/src/main/java/com/sap/cloud/sdk/datamodel/odata/client/exception/ODataResponseException.java
#	datamodel/odata-client/src/main/java/com/sap/cloud/sdk/datamodel/odata/client/request/ODataHealthyResponseValidator.java
Copy link
Contributor

@Johannes-Schneider Johannes-Schneider left a comment

Choose a reason for hiding this comment

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

LGTM

@Johannes-Schneider Johannes-Schneider merged commit 1eb4153 into main Mar 15, 2024
16 checks passed
@Johannes-Schneider Johannes-Schneider deleted the 426-failedBatchRequestNumber branch March 15, 2024 08:38
Johannes-Schneider pushed a commit that referenced this pull request Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
please merge Request to merge a pull request please review Request to review a pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants