-
Notifications
You must be signed in to change notification settings - Fork 20
release: v0.9.0 #207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
release: v0.9.0 #207
Conversation
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughRelease 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
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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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 typosIssues: 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 typesThe 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 +- LeiningenAlso 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 driftMinor 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 consistencyMinor 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” entrySlight copy edit.
- - Enhanced retry strategy with delay calculation + - Enhanced retry strategy with improved delay calculation
19-22
: Migration guide phrasing/formatting improvementsClarify 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 styleUse 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.
📒 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 correctDependency reference updated as expected for the example app.
README.md (1)
82-82
: All installation snippets updated to 0.9.0 — LGTMGradle (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 — OKMatches README and publish.gradle. No additional build logic changes detected.
publish.gradle (1)
9-9
: POM version updated to 0.9.0 — OKPublication 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.0The updated DEFAULT_USER_AGENT string aligns with the release version. LGTM.
CHANGELOG.md (2)
3-7
: Release scaffold looks correctUnreleased 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.
v0.9.0
0.9.0 (2025-08-15)
Added
Retry-After
header support with exponential backoff and jitterRetry-After
header value exposed in error objects for better observabilityFgaError
now exposesRetry-After
header value viagetRetryAfterHeader()
methodChanged
Migration Guide:
Fixed
Feature
Summary by CodeRabbit