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

Handle expected boolean values for waiter error matcher #3073

Merged
merged 15 commits into from
Aug 8, 2024

Conversation

jterapin
Copy link
Contributor

@jterapin jterapin commented Jul 25, 2024

All services currently define waiter error acceptors that have expected string values that represent an AWS Error code like below:

{
  "expected":"ResourceNotFoundFault",
  "matcher":"error",
  "state":"success"
}

A waiter with this acceptor will continue to wait until an error the the code ResourceNotFoundFault is received or the max amount of attempts is reached.

However, it's possible for service teams to define a waiter error acceptor like below which has an expected boolean (true or false) value. The expected behavior is defined below:

true - Match an error code with any value.
false - Match if no errors were encountered

Example:

{
  "matcher" : "error",
  "expected" : false,
  "state" : "success"
}

A waiter with this acceptor will continue to wait until a response with no error is received or the max amount of attempts is reached.

This PR adds the ability for waiters to handle the acceptors described above.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

  1. To make sure we include your contribution in the release notes, please make sure to add description entry for your changes in the "unreleased changes" section of the CHANGELOG.md file (at corresponding gem). For the description entry, please make sure it lives in one line and starts with Feature or Issue in the correct format.

  2. For generated code changes, please checkout below instructions first:
    https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md

Thank you for your contribution!

@jterapin
Copy link
Contributor Author

I plan do some rubocop adjustments once the PR has been approved. Keeping as it is to help out with readability.

@jterapin jterapin requested a review from mullermp July 25, 2024 21:06
@jterapin jterapin marked this pull request as draft July 26, 2024 16:48
@jterapin
Copy link
Contributor Author

Moving to Draft mode since I need to do some audits and add/update existing waiter specs

@jterapin
Copy link
Contributor Author

jterapin commented Aug 6, 2024

Self-reminder: Revert 1a61acd after approvals

@jterapin jterapin marked this pull request as ready for review August 6, 2024 17:46
gems/aws-sdk-core/spec/aws/temp_waiters_spec.rb Outdated Show resolved Hide resolved
Copy link
Contributor

@alextwoods alextwoods left a comment

Choose a reason for hiding this comment

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

Nice - great additional tests.

@jterapin jterapin merged commit 7ffb83b into version-3 Aug 8, 2024
31 checks passed
@jterapin jterapin deleted the fix_waiters branch August 8, 2024 15:24
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