Skip to content

Update comments for AWS SDK logging and retryer#1303

Open
radoslawszulgo wants to merge 2 commits intomainfrom
radoslawszulgo-update-aws-sdk-v2-doc-refs
Open

Update comments for AWS SDK logging and retryer#1303
radoslawszulgo wants to merge 2 commits intomainfrom
radoslawszulgo-update-aws-sdk-v2-doc-refs

Conversation

@radoslawszulgo
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates inline documentation in the S3 storage configuration to reflect AWS SDK for Go v2 logging (aws.ClientLogMode) and retryer (aws.Retryer) behavior.

Changes:

  • Refreshes Config.DebugLogLevels comment to describe supported AWS SDK v2 log mode flags and deprecated v1 aliases.
  • Refreshes Config.Retryer / Retryer field comments to describe v2 retry semantics and backoff controls.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pbm/storage/s3/s3.go
// Any sub levels will enable LogDebug level accordingly to AWS SDK Go module behavior
// https://pkg.go.dev/github.com/aws/aws-sdk-go@v1.40.7/aws#LogLevelType
// DebugLogLevels enables AWS SDK logging levels. Available options:
// Signing, Retries, Request, RequestWithBody, Response, ResponseWithBody, DeprecatedUsage, RequestEventMessage
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The DebugLogLevels comment lists supported values, but it omits ResponseEventMessage, which is accepted by toClientLogMode (and defined in SDKDebugLogLevel). Please update the comment to include ResponseEventMessage so configuration docs match actual behavior.

Suggested change
// Signing, Retries, Request, RequestWithBody, Response, ResponseWithBody, DeprecatedUsage, RequestEventMessage
// Signing, Retries, Request, RequestWithBody, Response, ResponseWithBody, DeprecatedUsage, RequestEventMessage, ResponseEventMessage

Copilot uses AI. Check for mistakes.
Comment thread pbm/storage/s3/s3.go
// DebugLogLevels enables AWS SDK logging levels. Available options:
// Signing, Retries, Request, RequestWithBody, Response, ResponseWithBody, DeprecatedUsage, RequestEventMessage
// and deprecated: LogDebug, HTTPBody, RequestRetries, RequestErrors, EventStreamBody
// Above values are translated to match the AWS SDK V2:
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The comment says the listed DebugLogLevels values are "translated to match the AWS SDK V2", but the primary values listed (Signing, Retries, Request, etc.) are already the AWS SDK v2 aws.ClientLogMode flag names; only the deprecated v1 values are mapped for backward compatibility. Consider rewording to clarify that this field is parsed into aws.ClientLogMode and that deprecated v1 names are mapped to the corresponding v2 flags.

Suggested change
// Above values are translated to match the AWS SDK V2:
// Values are parsed into AWS SDK v2 ClientLogMode; deprecated names are mapped
// to the corresponding v2 flags for backward compatibility:

Copilot uses AI. Check for mistakes.
Comment thread pbm/storage/s3/s3.go
Comment on lines +71 to +74
// Retryer is a configuration for aws.Retryer
// https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws#Retryer
// it's implemented with standard retryable, and delay behavior
// see also: https://github.com/aws/aws-sdk-go-v2/blob/v1.41.5/aws/retry/standard.go
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The Retryer field comment states "it's implemented with standard retryable, and delay behavior" and links to a specific aws-sdk-go-v2 GitHub tag. In this codebase the implementation is NewCustomRetryer (wrapping retry.NewStandard and enforcing a minimum backoff) and the pinned SDK version may differ over time, so the hardcoded GitHub URL/tag can become stale. Please reword to describe the local implementation (and/or link to aws/retry docs) without tying the comment to a specific upstream tag.

Suggested change
// Retryer is a configuration for aws.Retryer
// https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws#Retryer
// it's implemented with standard retryable, and delay behavior
// see also: https://github.com/aws/aws-sdk-go-v2/blob/v1.41.5/aws/retry/standard.go
// Retryer configures the aws.Retryer used by the local custom retryer implementation.
// https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws#Retryer
// The implementation wraps the AWS SDK standard retryer behavior and applies the
// configured retry delay settings, including enforcing a minimum retry delay.

Copilot uses AI. Check for mistakes.
Comment thread pbm/storage/s3/s3.go
type Retryer struct {
// Num max Retries is the number of max retries that will be performed.
// https://pkg.go.dev/github.com/aws/aws-sdk-go/aws/client#DefaultRetryer.NumMaxRetries
// NumMaxRetries is the number of **additional** max attempts that should be made
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

NumMaxRetries comment uses Markdown formatting ("additional") and has an extra space after the field name. Go doc comments are rendered as plain text; please drop Markdown emphasis and keep formatting consistent (e.g., "NumMaxRetries is the number of additional retry attempts"), matching the NewCustomRetryer behavior of MaxAttempts = numMaxRetries + 1.

Suggested change
// NumMaxRetries is the number of **additional** max attempts that should be made
// NumMaxRetries is the number of additional retry attempts that should be made

Copilot uses AI. Check for mistakes.
Comment thread pbm/storage/s3/s3.go

// MaxRetryDelay is the maximum retry delay before which retry must be performed.
// https://pkg.go.dev/github.com/aws/aws-sdk-go/aws/client#DefaultRetryer.MaxRetryDelay
// MaxRetryDelay is the duration between retried attempts (using ExponentialJitterBackoff)
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The MaxRetryDelay comment is misleading: it currently reads as if this value is "the duration between retried attempts", but the implementation passes it as retry.StandardOptions.MaxBackoff (a maximum cap on the computed exponential-jitter backoff). Please update the comment to reflect that it is a maximum backoff / maximum retry delay cap, not a fixed delay between attempts.

Suggested change
// MaxRetryDelay is the duration between retried attempts (using ExponentialJitterBackoff)
// MaxRetryDelay is the maximum backoff / retry delay cap for retried attempts (using ExponentialJitterBackoff)

Copilot uses AI. Check for mistakes.
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