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: Code-generate Acceptors for waiters #483

Merged
merged 54 commits into from
Dec 16, 2022
Merged

Conversation

jbelkins
Copy link
Contributor

@jbelkins jbelkins commented Nov 21, 2022

Issue #

Completes #448
Fixes awslabs/aws-sdk-swift#733

Description of changes

Code generate all acceptors for each waiter. Support for JMESPath is not complete to the JMESPath spec, but is sufficient to handle all current AWS acceptors. (Comparable to the JMESPath support in smithy-kotlin.)

  • For each waiter, a separate, internal-scoped static method is provided that creates a WaiterConfig for that waiter. This config is used by the waitUntil method for that waiter to configure its Waiter object.
  • The WaiterConfig includes minDelay and maxDelay values, plus an array of Acceptors.
  • Code is generated that implement all Acceptor types.
  • For operations that have an errorType acceptor, conformance with the WaiterCodedError Swift protocol is added to that operation's error to facilitate error type matching.
  • Tests for generated Acceptors are in the SDK project, since there is currently no support for testing generated code in this project. See feat: Test code-generated Waiters components awslabs/aws-sdk-swift#732

Changes other than new content:

  • Split the Waiters Swift integration from the code generation.
  • Reorganized existing waiters-related Kotlin files into a waiters subfolder.

Scope

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

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

@jbelkins jbelkins changed the base branch from main to feat/waiters November 21, 2022 06:13
@jbelkins jbelkins changed the title Feat: Code-generate Acceptors for waiters feat: Code-generate Acceptors for waiters Nov 29, 2022
Copy link
Contributor

@epau epau left a comment

Choose a reason for hiding this comment

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

This is looking fantastic! Really great job here! Just a few super small comments

@jbelkins jbelkins merged commit 4dfe803 into feat/waiters Dec 16, 2022
@jbelkins jbelkins deleted the jbe/acceptors branch December 16, 2022 20:15
@jbelkins jbelkins restored the jbe/acceptors branch December 16, 2022 20:35
@jbelkins jbelkins deleted the jbe/acceptors branch December 16, 2022 21:06
jbelkins added a commit that referenced this pull request Dec 19, 2022
* feat: Add waiter client runtime components (#450)
* feat: Waiter extension & methods (#478)
* feat: Add WaiterTypedError type, conform operation errors to it (#491)
* feat: Code-generate Acceptors for waiters (#483)
* fix: Use correct var name in AND expression (#493)
* fix: Correct Swift compile errors for comparison expressions (#494)
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.

2 participants