Skip to content

Conversation

jimmyjames
Copy link
Contributor

@jimmyjames jimmyjames commented Aug 15, 2025

v0.9.0

0.9.0 (2025-08-15)

Added

  • RFC 9110 compliant Retry-After header support with exponential backoff and jitter
  • Retry-After header value exposed in error objects for better observability
  • FgaError now exposes Retry-After header value via getRetryAfterHeader() method

Changed

  • Enhanced retry strategy with delay calculation
  • BREAKING: Maximum allowable retry count is now enforced at 15 (default remains 3)
  • BREAKING: Configuration.minimumRetryDelay() now requires non-null values and validates input, throwing IllegalArgumentException for null or negative values

Migration Guide:

  • Update error handling code if using FgaError properties - new getRetryAfterHeader() method available
  • Note: Maximum allowable retries is now enforced at 15 (validation added to prevent exceeding this limit)
  • IMPORTANT: Configuration.minimumRetryDelay() now requires non-null values and validates input - ensure you're not passing null or negative Duration values, as this will now throw IllegalArgumentException. Previously null values were silently accepted and would fall back to default behavior at runtime.

Fixed

Feature

Summary by CodeRabbit

  • New Features
    • Support for Retry-After header with exponential backoff and jitter.
    • Retry-After value exposed in error responses, with an accessor.
  • Changed
    • Improved retry delay calculation.
    • Max retries capped at 15 (default still 3).
    • minimumRetryDelay now requires non-null, non-negative values.
    • Default User-Agent updated to 0.9.0.
  • Bug Fixes
    • Telemetry metrics export.
    • Non-transactional write error handling.
  • Documentation
    • Changelog and migration guide updated for 0.9.0.
    • README dependency examples updated to 0.9.0.
  • Chores
    • Version bumped to 0.9.0.

@jimmyjames jimmyjames requested review from a team as code owners August 15, 2025 19:09
Copy link
Contributor

coderabbitai bot commented Aug 15, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Release bump to v0.9.0 across docs, build, and configuration. CHANGELOG documents new Retry-After handling with exponential backoff/jitter, a 15-retry cap, validation changes, and a new FgaError.getRetryAfterHeader(). Tests and README updated to reflect version and User-Agent changes.

Changes

Cohort / File(s) Summary
Docs and Release Notes
CHANGELOG.md, README.md
Added v0.9.0 section with Retry-After/backoff/jitter, 15-retry cap, config validation, and new getRetryAfterHeader(). Updated dependency snippets from 0.8.3 to 0.9.0.
Build and Publishing Metadata
build.gradle, publish.gradle, example/example1/build.gradle
Bumped artifact/version references from 0.8.3 to 0.9.0; no build logic changes.
Configuration Constants
src/main/java/.../Configuration.java
Updated VERSION to "0.9.0" and default User-Agent to "openfga-sdk java/0.9.0".
Tests
src/test/java/.../ConfigurationTest.java
Updated expected default User-Agent to "openfga-sdk java/0.9.0".

Sequence Diagram(s)

sequenceDiagram
  participant App as Application
  participant SDK as OpenFGA SDK Client
  participant API as OpenFGA Server

  App->>SDK: Issue request
  SDK->>API: HTTP request
  API-->>SDK: 429/503 + Retry-After
  SDK->>SDK: Compute delay (exponential backoff + jitter)<br/>Respect Retry-After, cap retries (max 15)
  SDK-->>App: Propagate error incl. getRetryAfterHeader() (if retries exhausted)
  SDK->>API: Retry until success or cap reached
  API-->>SDK: Success response
  SDK-->>App: Return success
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • fix: retry improvements #198 — Modifies HTTP retry logic and Retry-After handling, overlapping with the retry/backoff changes noted here.
  • release: v0.8.3 #184 — Updates Configuration.VERSION and related version strings, similar to this version bump.
  • release: v0.8.2 #180 — Changes VERSION and DEFAULT_USER_AGENT in Configuration, matching the constants updated here.

Suggested reviewers

  • rhamzeh
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch release/v0.9.0

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov-commenter
Copy link

codecov-commenter commented Aug 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 35.19%. Comparing base (36c22b4) to head (051279b).

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #207   +/-   ##
=========================================
  Coverage     35.19%   35.19%           
  Complexity     1071     1071           
=========================================
  Files           187      187           
  Lines          7087     7087           
  Branches        803      803           
=========================================
  Hits           2494     2494           
  Misses         4483     4483           
  Partials        110      110           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🔭 Outside diff range comments (4)
README.md (4)

997-1005: Fix minimumRetryDelay example to use Duration (per breaking change)

Docs say Configuration.minimumRetryDelay() now requires non-null Duration. The example shows an int. Update the snippet to pass Duration and import it.

Apply this diff:

 import dev.openfga.sdk.api.configuration.ClientConfiguration;
 import java.net.http.HttpClient;
+import java.time.Duration;

 ...
                 .maxRetries(3) // retry up to 3 times on API requests (default: 3, maximum: 15)
-                .minimumRetryDelay(100); // minimum wait time between retries in milliseconds (default: 100ms)
+                .minimumRetryDelay(Duration.ofMillis(100)); // minimum wait time between retries (default: 100ms)

613-658: BatchCheck code sample has multiple compile errors and typos

Issues: misspelled variable (reequst), mixed item types (ClientCheckRequest vs ClientBatchCheckItem), broken correlationId quote, and broken method chaining on options. Suggested fix below.

Apply this diff:

-var reequst = new ClientBatchCheckRequest().checks(
+var request = new ClientBatchCheckRequest().checks(
     List.of(
         new ClientBatchCheckItem()
             .user("user:81684243-9356-4421-8fbf-a4f8d36aa31b")
             .relation("viewer")
             ._object("document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a")
             .correlationId("cor-1") // optional, one will be generated for you if not provided
             .contextualTuples(List.of(
                 new ClientTupleKey()
                     .user("user:81684243-9356-4421-8fbf-a4f8d36aa31b")
                     .relation("editor")
                     ._object("document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a")
             )),
-        new ClientCheckRequest()
+        new ClientBatchCheckItem()
             .user("user:81684243-9356-4421-8fbf-a4f8d36aa31b")
             .relation("admin")
             ._object("document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a"),
             .correlationId("cor-2") // optional, one will be generated for you if not provided
             .contextualTuples(List.of(
                 new ClientTupleKey()
                     .user("user:81684243-9356-4421-8fbf-a4f8d36aa31b")
                     .relation("editor")
                     ._object("document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a")
             )),
-        new ClientCheckRequest()
+        new ClientBatchCheckItem()
             .user("user:81684243-9356-4421-8fbf-a4f8d36aa31b")
             .relation("creator")
             ._object("document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a")
-            .correlationId("cor-3), // optional, one will be generated for you if not provided
-        new ClientCheckRequest()
+            .correlationId("cor-3"), // optional, one will be generated for you if not provided
+        new ClientBatchCheckItem()
             .user("user:81684243-9356-4421-8fbf-a4f8d36aa31b")
             .relation("deleter")
             ._object("document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a")
             .correlationId("cor-4") // optional, one will be generated for you if not provided
         )
 );
 
 var options = new ClientBatchCheckOptions()
     .additionalHeaders(Map.of("Some-Http-Header", "Some value"))
     // You can rely on the model id set in the configuration or override it for this specific request
     .authorizationModelId("01GXSA8YR785C4FYS3C0RTG7B1")
-    .maxParallelRequests(5); // Max number of requests to issue in parallel, defaults to 10 
-    .maxBatchSize(20); // Max number of batches to split the list of checks into, defaults to 50
+    .maxParallelRequests(5) // Max number of requests to issue in parallel, defaults to 10 
+    .maxBatchSize(20); // Max number of batches to split the list of checks into, defaults to 50
 
 var response = fgaClient.batchCheck(request, options).get();

719-757: Legacy clientBatchCheck example mismatches text and types

The snippet that introduces clientBatchCheck uses the batchCheck call, mixes ClientBatchCheckItem and ClientCheckRequest, and references an options type that likely doesn’t exist. Align to clientBatchCheck and consistent types.

Apply this diff:

 var request = List.of(
     new ClientBatchCheckItem()
         .user("user:81684243-9356-4421-8fbf-a4f8d36aa31b")
         .relation("viewer")
         ._object("document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a")
         .contextualTuples(List.of(
             new ClientTupleKey()
                 .user("user:81684243-9356-4421-8fbf-a4f8d36aa31b")
                 .relation("editor")
                 ._object("document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a")
         )),
-    new ClientCheckRequest()
+    new ClientBatchCheckItem()
         .user("user:81684243-9356-4421-8fbf-a4f8d36aa31b")
         .relation("admin")
         ._object("document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a"),
         .contextualTuples(List.of(
             new ClientTupleKey()
                 .user("user:81684243-9356-4421-8fbf-a4f8d36aa31b")
                 .relation("editor")
                 ._object("document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a")
         )),
-    new ClientCheckRequest()
+    new ClientBatchCheckItem()
         .user("user:81684243-9356-4421-8fbf-a4f8d36aa31b")
         .relation("creator")
         ._object("document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a"),
-    new ClientCheckRequest()
+    new ClientBatchCheckItem()
         .user("user:81684243-9356-4421-8fbf-a4f8d36aa31b")
         .relation("deleter")
         ._object("document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a")
 );
-var options = new ClientBatchCheckClientOptions()
+var options = new ClientBatchCheckOptions()
     .additionalHeaders(Map.of("Some-Http-Header", "Some value"))
     // You can rely on the model id set in the configuration or override it for this specific request
     .authorizationModelId("01GXSA8YR785C4FYS3C0RTG7B1")
     .maxParallelRequests(5); // Max number of requests to issue in parallel, defaults to 10
 
-var response = fgaClient.batchCheck(request, options).get();
+var response = fgaClient.clientBatchCheck(request, options).get();

870-876: Fix ListRelations options: invalid zero-arg maxParallelRequests()

As written, .maxParallelRequests() is syntactically invalid. Either specify a value or omit it to use the default (10 as per the comment). Suggest removing the line for brevity.

Apply this diff:

 var options = new ClientListRelationsOptions()
     .additionalHeaders(Map.of("Some-Http-Header", "Some value"))
-    // When unspecified, defaults to 10
-    .maxParallelRequests()
     // You can rely on the model id set in the configuration or override it for this specific request
     .authorizationModelId(DEFAULT_AUTH_MODEL_ID);
🧹 Nitpick comments (6)
README.md (1)

79-116: nit: Use dash list markers to satisfy markdownlint (MD004)

The unordered lists here use * but lint config prefers -. This helps keep docs lint-clean.

Apply this diff:

-* Gradle (Groovy)
+- Gradle (Groovy)
...
-* Gradle (Kotlin)
+- Gradle (Kotlin)
...
-* Apache Maven
+- Apache Maven
...
-* Ivy
+- Ivy
...
-* SBT
+- SBT
...
-* Leiningen
+- Leiningen

Also applies to: 120-121

src/main/java/dev/openfga/sdk/api/configuration/Configuration.java (1)

33-37: Derive DEFAULT_USER_AGENT from VERSION to avoid drift

Minor maintainability tweak: build the default UA string using the VERSION constant so future bumps don’t require touching two literals.

Apply this diff:

-    public static final String VERSION = "0.9.0";
+    public static final String VERSION = "0.9.0";
 ...
-    private static final String DEFAULT_USER_AGENT = "openfga-sdk java/0.9.0";
+    private static final String DEFAULT_USER_AGENT = "openfga-sdk java/" + VERSION;
CHANGELOG.md (4)

10-12: Polish “Added” bullets for clarity and consistency

Minor copy tweaks for readability and consistency; also add a link to RFC 9110’s Retry-After section.

- - RFC 9110 compliant `Retry-After` header support with exponential backoff and jitter
- - `Retry-After` header value exposed in error objects for better observability
- - `FgaError` now exposes `Retry-After` header value via `getRetryAfterHeader()` method
+ - [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110#name-retry-after)-compliant `Retry-After` header support with exponential backoff and jitter
+ - `Retry-After` header value exposed in error objects for improved observability
+ - `FgaError` now exposes the `Retry-After` header value via `getRetryAfterHeader()`

15-15: Tighten wording of the “Changed” entry

Slight copy edit.

- - Enhanced retry strategy with delay calculation
+ - Enhanced retry strategy with improved delay calculation

19-22: Migration guide phrasing/formatting improvements

Clarify instruction and apply consistent code formatting.

- - Update error handling code if using FgaError properties - new getRetryAfterHeader() method available
+ - Update error handling code that reads `FgaError` properties to use the new `getRetryAfterHeader()` method
@@
- - **IMPORTANT**: Configuration.minimumRetryDelay() now requires non-null values and validates input - ensure you're not passing null or negative Duration values, as this will now throw IllegalArgumentException. Previously null values were silently accepted and would fall back to default behavior at runtime.
+ - **IMPORTANT**: `Configuration.minimumRetryDelay()` now requires non-null values and validates input — ensure you're not passing null or negative `Duration` values, as this now throws `IllegalArgumentException`. Previously, null values were silently accepted and fell back to default behavior at runtime.

24-27: Standardize “Fixed” wording and link style

Use concise phrasing and consistent GitHub link style.

- - Fixed issue where telemetry metrics are not being exported correctly [#590](https://github.com/openfga/sdk-generator/pull/590)
- - Fixed issue with non-transactional write error handling [https://github.com/openfga/sdk-generator/pull/573](https://github.com/openfga/sdk-generator/pull/573) 
+ - Fixed telemetry metrics export issue [openfga/sdk-generator#590](https://github.com/openfga/sdk-generator/pull/590)
+ - Fixed non-transactional write error handling [openfga/sdk-generator#573](https://github.com/openfga/sdk-generator/pull/573)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 36c22b4 and bec604e.

📒 Files selected for processing (7)
  • CHANGELOG.md (1 hunks)
  • README.md (2 hunks)
  • build.gradle (1 hunks)
  • example/example1/build.gradle (1 hunks)
  • publish.gradle (1 hunks)
  • src/main/java/dev/openfga/sdk/api/configuration/Configuration.java (1 hunks)
  • src/test/java/dev/openfga/sdk/api/configuration/ConfigurationTest.java (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
README.md

85-85: Unordered list style
Expected: dash; Actual: asterisk

(MD004, ul-style)


101-101: Unordered list style
Expected: dash; Actual: asterisk

(MD004, ul-style)


107-107: Unordered list style
Expected: dash; Actual: asterisk

(MD004, ul-style)


113-113: Unordered list style
Expected: dash; Actual: asterisk

(MD004, ul-style)

🪛 LanguageTool
CHANGELOG.md

[grammar] ~9-~9: There might be a mistake here.
Context: ...v0.8.3...v0.9.0) (2025-08-15) ### Added - RFC 9110 compliant Retry-After header ...

(QB_NEW_EN)


[grammar] ~19-~19: There might be a mistake here.
Context: ...or negative values Migration Guide: - Update error handling code if using FgaE...

(QB_NEW_EN)


[grammar] ~24-~24: There might be a mistake here.
Context: ... default behavior at runtime. ### Fixed - Fixed issue where telemetry metrics are not b...

(QB_NEW_EN)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Test and Build OpenFGA (21)
  • GitHub Check: Test and Build OpenFGA (11)
  • GitHub Check: Test and Build OpenFGA (17)
  • GitHub Check: Analyze (java)
🔇 Additional comments (7)
example/example1/build.gradle (1)

26-26: Version bump to 0.9.0 looks correct

Dependency reference updated as expected for the example app.

README.md (1)

82-82: All installation snippets updated to 0.9.0 — LGTM

Gradle (Groovy/Kotlin), Maven, Ivy, SBT, and Leiningen sections consistently reference 0.9.0.

Also applies to: 88-88, 97-97, 104-104, 110-110, 116-116

build.gradle (1)

22-22: Root project version bumped to 0.9.0 — OK

Matches README and publish.gradle. No additional build logic changes detected.

publish.gradle (1)

9-9: POM version updated to 0.9.0 — OK

Publication metadata aligned with root version.

src/test/java/dev/openfga/sdk/api/configuration/ConfigurationTest.java (1)

25-25: User-Agent version bump matches 0.9.0

The updated DEFAULT_USER_AGENT string aligns with the release version. LGTM.

CHANGELOG.md (2)

3-7: Release scaffold looks correct

Unreleased diff target and 0.9.0 entry headers are aligned with prior sections. LGTM.


10-12: Public API and configuration behavior confirmed per changelog

  • FgaError.getRetryAfterHeader() is implemented as a public method in src/main/java/dev/openfga/sdk/errors/FgaError.java (lines 137–142).
  • Configuration.minimumRetryDelay(Duration) throws
    • “minimumRetryDelay cannot be null” for null (Configuration.java 301–303)
    • “minimumRetryDelay cannot be negative” for negative (Configuration.java 305–307)
    • allows zero and defaults to DEFAULT_MINIMUM_RETRY_DELAY (Duration.ofMillis(100)) (Configuration.java 46).
  • Configuration.maxRetries(int) enforces non-negative (“maxRetries must be non-negative” at line 278) and caps at MAX_ALLOWABLE_RETRIES (15) with message “maxRetries cannot exceed 15 (maximum allowable retries)” (Configuration.java 281–283).

All behaviors described in CHANGELOG.md (lines 10–12, 15–17, 19–22, 24–27) are present and enforced as intended.

@jimmyjames jimmyjames added this pull request to the merge queue Aug 15, 2025
Merged via the queue into main with commit ecef92e Aug 15, 2025
22 of 25 checks passed
@jimmyjames jimmyjames deleted the release/v0.9.0 branch August 15, 2025 19:53
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.

3 participants