Skip to content

feat: add max-attempts and retry-mode input parameters#203

Open
AdunSG wants to merge 2 commits into
aws-actions:masterfrom
AdunSG:feature/expose-retry-configuration
Open

feat: add max-attempts and retry-mode input parameters#203
AdunSG wants to merge 2 commits into
aws-actions:masterfrom
AdunSG:feature/expose-retry-configuration

Conversation

@AdunSG
Copy link
Copy Markdown

@AdunSG AdunSG commented May 26, 2026

Summary

  • Adds max-attempts and retry-mode as action input parameters to configure AWS SDK retry behavior
  • Passes these values to the CloudFormationClient (and S3Client) constructor config
  • Allows users to control retry behavior without relying on AWS_MAX_ATTEMPTS and AWS_RETRY_MODE environment variables, which are global and can bleed into other workflow steps

Motivation

There was no way to configure the SDK-level retry behavior from the action inputs. Users had to set environment variables outside the action context, which is not discoverable and affects the entire job.

Changes

  • action.yml: Added max-attempts and retry-mode input definitions
  • src/utils.ts: Added parseRetryMode() validator (accepts 'standard' or 'adaptive')
  • src/validation.ts: Added both fields to the base schema (applies to all modes)
  • src/main.ts: Reads inputs and sets maxAttempts/retryMode on the shared client configuration

Test plan

  • All existing tests pass (212 tests, 6 suites)
  • TypeScript compiles without errors
  • dist/index.js rebuilt successfully
  • Verify with a workflow using max-attempts: 10 and retry-mode: adaptive

🤖 Generated with Claude Code


Please notice that although i created this PR using Claude Code i did review the changes myself and the need for this feature is real. Highly parallelized stack deployment can cause issues with Rate Excceeded errors.

Expose AWS SDK retry configuration as action inputs, allowing users to
control retry behavior without relying on environment variables that
bleed into other workflow steps.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@kddejong kddejong left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution — the feature makes sense and the implementation is clean. A few things needed before we can merge:

Missing tests: parseRetryMode in src/utils.ts needs unit tests covering:

  • Valid inputs ('standard', 'adaptive') return the expected value
  • Invalid input (e.g. 'exponential') throws with the expected error message
  • Empty string / undefined returns undefined

The validation schema changes should also have test coverage confirming max-attempts and retry-mode are parsed correctly through validateAndParseInputs.

Address PR review feedback requesting test coverage for the new
retry configuration inputs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@AdunSG
Copy link
Copy Markdown
Author

AdunSG commented May 27, 2026

There was no existing test for validateAndParseInputs() i had to add a new file for that. It now only covers the new retryMode and maxAttempts value validation.
Tests for parseRetryMode() have been added to utils.test.ts

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