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

Return batch statuses even when some timeout #1815

Conversation

ameliabradley
Copy link
Contributor

This change modifies the Splinter /batch_statuses endpoint so that it
will return batch statuses, even if some of them time out. Batch
statuses that time out are returned as "Unknown".

Previously, if a single batch status were to timeout, the endpoint would
return none at all. The endpoint result would be a non-parsable string
error containing the problem batch ids.

This change should give users of this endpoint maximal information.
Users can use the successful ids, and they can determine programatically
which ones timed out.

Also updated several tests to validate the new expected responses.

Signed-off-by: Lee Bradley bradley@bitwise.io

@github-actions github-actions bot added backport-triage It has not yet been determined if this branch should be backported. main labels Feb 10, 2022
@ameliabradley ameliabradley self-assigned this Feb 10, 2022
@ameliabradley ameliabradley marked this pull request as draft February 10, 2022 18:15
@ameliabradley ameliabradley force-pushed the return-batch-statuses-even-when-some-timeout branch from bcfbf5b to 89cbae3 Compare February 10, 2022 18:45
@ameliabradley ameliabradley marked this pull request as ready for review February 11, 2022 17:07
@ameliabradley ameliabradley force-pushed the return-batch-statuses-even-when-some-timeout branch from 08bc9b2 to 6330c00 Compare February 14, 2022 15:18
vaporos
vaporos previously approved these changes Feb 22, 2022
@ameliabradley ameliabradley force-pushed the return-batch-statuses-even-when-some-timeout branch 3 times, most recently from 37571d1 to 6439fc9 Compare March 2, 2022 16:24
peterschwarz
peterschwarz previously approved these changes Mar 2, 2022
Lee Bradley added 2 commits March 3, 2022 11:10
This change modifies the Splinter /batch_statuses endpoint so that it
will return batch statuses, even if some of them time out. Batch
statuses that time out are returned as "Unknown".

Previously, if a single batch status were to timeout, the endpoint would
return none at all. The endpoint result would be a non-parsable string
error containing the problem batch ids.

This change should give users of this endpoint maximal information.
Users can use the successful ids, and they can determine programatically
which ones timed out.

Also updated several tests to validate the new expected responses.

Signed-off-by: Lee Bradley <bradley@bitwise.io>
This change updates the wait_for_batches function in the Reqwest client
so that it will identify Unknown batches and return an error.

Signed-off-by: Lee Bradley <bradley@bitwise.io>
Previously, if a batch status response was "Unknown" or "Pending", the
message field would not be returned (unlike "Invalid", "Valid" and
"Committed"). The OpenAPI spec states that message is not an optional
return value. This change modifies the serde serialization so that both
the "Unknown" and "Pending" enum variants are serialized as empty
sequences, and thus message is never empty.

This change also adds tests to validate the resulting JSON output. To
ensure that the string ouput for tests is deterministic, the
preserve_order feature is enabled in development builds.

Signed-off-by: Lee Bradley <bradley@bitwise.io>
@ameliabradley ameliabradley force-pushed the return-batch-statuses-even-when-some-timeout branch from 11131b5 to 1ebca2a Compare March 3, 2022 21:04
@ameliabradley ameliabradley merged commit 6f8a158 into Cargill:main Apr 29, 2022
@peterschwarz peterschwarz added backport-0-4 This PR should be backported to the 0-4 branch. backport-0-6 This PR should be backported to the 0-6 branch. and removed backport-triage It has not yet been determined if this branch should be backported. labels Apr 29, 2022
@ameliabradley ameliabradley added the backport-complete This PR has been backported to the appropriate branches label May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-0-4 This PR should be backported to the 0-4 branch. backport-0-6 This PR should be backported to the 0-6 branch. backport-complete This PR has been backported to the appropriate branches main
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants