aws / aws-sdk-js-codemod

Codemod scripts to update AWS SDK for JavaScript APIs.
MIT No Attribution
66 stars 8 forks source link

[Feature]: Use codemod to convert RetryDelayOptions #610

Open abhirpat opened 8 months ago

abhirpat commented 8 months ago

Self-service

Problem

    AWS.config.update({
        maxRetries: request_params.maxRetries,
        retryDelayOptions: {
            base: request_params.retryDelay,
        },
    })

Solution

Requesting codemod to convert retryDelayOptions as they are deprecated in SDK V3 clients.

Alternatives

I have used ConfiguredRetryStrategy however I noticed some calls are not getting executed. Initially I had throttling error so I added + 1. After that I don't see any error. Thus, it would be helpful to have codemod show correct transalation or update SDK documentation. I am submitting this feature request per our discussion.

request_params.maxRetries = 8 request_params.retryDelay = 600

    const maxRetries = request_params.maxRetries;
    const base = request_params.retryDelay;
    const retryStrategy = new ConfiguredRetryStrategy(maxRetries + 1, base);

Additional context

No response

trivikr commented 8 months ago

As of >0.25.0, we add a comment to assist tranform retryDelayOptions

Example: https://github.com/awslabs/aws-sdk-js-codemod/blob/main/src/transforms/v2-to-v3/__fixtures__/config/retryDelayOptions.output.js

abhirpat commented 8 months ago

As of >0.25.0, we add a comment to assist tranform retryDelayOptions

Example: https://github.com/awslabs/aws-sdk-js-codemod/blob/main/src/transforms/v2-to-v3/__fixtures__/config/retryDelayOptions.output.js

However, this documentation doesn't clarify how to convert retryDelayOptions with example for base