Skip to content

docs: clarify one-based step attempts - #665

Open
zhongkechen wants to merge 3 commits into
mainfrom
docs/one-based-step-attempts
Open

docs: clarify one-based step attempts#665
zhongkechen wants to merge 3 commits into
mainfrom
docs/one-based-step-attempts

Conversation

@zhongkechen

@zhongkechen zhongkechen commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • document StepContext.getAttempt() and TestOperation.getAttempt() as one-based
  • align context implementation Javadocs with the existing runtime and plugin contracts
  • add an integration test proving a retried step observes attempts 1 and 2

Testing

  • mvn spotless:apply
  • mvn -pl sdk-integration-tests -am -Dtest=RetryIntegrationTest -Dsurefire.failIfNoSpecifiedTests=false test

Related shared-docs PR: aws/aws-durable-execution-docs#267

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@zhongkechen
zhongkechen temporarily deployed to ai-pr-review-runtime August 31, 2026 22:11 — with GitHub Actions Inactive
@zhongkechen
zhongkechen temporarily deployed to ai-pr-review-runtime August 31, 2026 22:11 — with GitHub Actions Inactive
@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Claude AI review

This is a documentation-only PR (plus one new integration test) that corrects getAttempt() Javadocs from "0-based" to "1-based" across StepContext, StepContextImpl, DurableContextImpl, and TestOperation.

Verification performed:

  • Confirmed against StepOperation that FIRST_ATTEMPT = 1 and retries use attempt + 1, so attempts genuinely start at 1 — the doc correction is accurate, not a new inaccuracy.
  • Confirmed RetryStrategy.makeRetryDecision and RetryStrategies (fixedDelay, linearBackoff, exponentialBackoff) already document/treat attempt as 1-based, so this aligns previously inconsistent Javadoc with the rest of the codebase.
  • TestOperation.getAttempt() previously said "defaulting to 0" while the code defaulted to 1 — the new comment ("defaulting to 1") now matches actual behavior.
  • The new RetryIntegrationTest.testStepContextAttemptNumbers_ShouldBeOneBased correctly exercises RetryStrategies.fixedDelay(2, Duration.ofSeconds(1)): attempt 1 fails and triggers a retry (1 >= 2 is false), attempt 2 succeeds (matches FIRST_ATTEMPT/retry-increment logic), and assertions (List.of(1, 2)) match the expected attempt sequence. Imports are correctly ordered and used; no Thread.sleep() is introduced (uses the test runner's simulated advanceTime()/runUntilComplete()).
  • No production behavior, public API signatures, or serialization changed — all non-test changes are Javadoc comment edits only.

No correctness, API-compatibility, checkpoint/replay, concurrency, or lifecycle issues were found in this diff. Residual risk is minimal: this PR does not update other doc pages (e.g., docs/core/steps.md) that don't currently mention attempt numbering, but that is out of scope for this diff and does not introduce any inconsistency.

Reviewed commit fabab980a04b48ef00156f6a8946fe8ebd417950. Workflow run

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Codex AI review

No actionable findings. The changes align the Javadocs with existing one-based attempt semantics, and the integration test covers retry attempts 1 and 2. Residual risk: tests were not executed under the review constraints.

Reviewed commit 67d4b934e7467b152c88ae09798947f28e4f0e01. Workflow run

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.

1 participant