feat: add builder for GenericRetry and deprecate mutable setters by TQJADE · Pull Request #3648 · operator-framework/java-operator-sdk · GitHub
Skip to content

feat: add builder for GenericRetry and deprecate mutable setters - #3648

Open
TQJADE wants to merge 1 commit into
operator-framework:mainfrom
TQJADE:retry
Open

TQJADE wants to merge 1 commit into
operator-framework:mainfrom
TQJADE:retry

Conversation

@TQJADE

@TQJADE TQJADE commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Adds a builder for GenericRetry as a non-breaking first step towards
making it immutable in v6. The mutating methods are deprecated for
removal, so users can migrate now and the setters can be dropped in the
next major version. More: #2935

Summary by CodeRabbit

  • New Features

    • Added a builder for configuring retry attempts, intervals, and retry strategies. Existing retry configurations can also be copied and adjusted.
  • Documentation

    • Updated retry examples to use the builder and explain how to customize configurations. Existing setter-based configuration methods are deprecated and are planned for removal in a future major version.

Copilot AI balanced review requested due to automatic review settings October 14, 2026 18:21
@openshift-ci
openshift-ci Bot requested review from metacosm and xstefank October 14, 2026 18:21
@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

Static review found no blocking issues, with existing retry behavior preserved and focused builder coverage added; tests were not executed.

0 open findings

What changed in this PR

Refactors GenericRetry toward builder-based configuration while preserving existing retry behavior and annotation support.

Changes:

  • Adds a builder, toBuilder(), and diagnostic toString(); deprecates mutable configuration methods.
  • Migrates configuration loading, tests, and documentation to the builder API.
  • Adds tests for builder defaults, configuration copying, and independent instances.
File Description
operator-framework/​src/​test/​java/​io/​javaoperatorsdk/​operator/​baseapi/​triggerallevent/​eventing/​TriggerReconcilerOnAllEventIT.java Migrates event-trigger retry setup.
operator-framework/​src/​test/​java/​io/​javaoperatorsdk/​operator/​baseapi/​retry/​RetryMaxAttemptIT.java Migrates retry-limit setup.
operator-framework/​src/​test/​java/​io/​javaoperatorsdk/​operator/​baseapi/​retry/​RetryIT.java Migrates retry setup.
operator-framework/​src/​test/​java/​io/​javaoperatorsdk/​operator/​baseapi/​retry/​RetryIntervalHonoredOnFrequentEventsIT.java Migrates retry-interval setup.
operator-framework/​src/​test/​java/​io/​javaoperatorsdk/​operator/​baseapi/​errorstatushandler/​ErrorStatusHandlerIT.java Migrates error-handler retry setup.
operator-framework/​src/​main/​java/​io/​javaoperatorsdk/​operator/​config/​loader/​ConfigLoader.java Builds retries from loaded configuration.
operator-framework-core/​src/​test/​java/​io/​javaoperatorsdk/​operator/​processing/​retry/​GenericRetryTest.java Adds builder and factory coverage.
operator-framework-core/​src/​test/​java/​io/​javaoperatorsdk/​operator/​processing/​retry/​GenericRetryExecutionTest.java Migrates retry-execution fixtures.
operator-framework-core/​src/​test/​java/​io/​javaoperatorsdk/​operator/​processing/​event/​ReconciliationDispatcherTest.java Migrates zero-retry configuration.
operator-framework-core/​src/​test/​java/​io/​javaoperatorsdk/​operator/​processing/​event/​EventProcessorTest.java Migrates event-processing retry fixtures.
operator-framework-core/​src/​main/​java/​io/​javaoperatorsdk/​operator/​processing/​retry/​GenericRetry.java Introduces builder API and deprecates mutators.
docs/​content/​en/​docs/​documentation/​testing.md Updates the testing example.
docs/​content/​en/​docs/​documentation/​error-handling-retries.md Documents builder usage and deprecation plans.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@TQJADE TQJADE changed the title GenericRetry refactor feat: add builder for GenericRetry and deprecate mutable setters Oct 14, 2026

This branch has not been deployed

No deployments
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