Skip to content

Conversation

@rhamzeh
Copy link
Member

@rhamzeh rhamzeh commented Oct 31, 2025

Description

Screen.Recording.2025-11-04.at.10.53.32.AM.mov

What problem is being solved?

How is it being solved?

What changes are made to solve it?

References

Review Checklist

  • I have clicked on "allow edits by maintainers".
  • I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • The correct base branch is being used, if not main
  • I have added tests to validate that the change in functionality is working as expected

Summary by CodeRabbit

  • Documentation

    • Updated getting-started guide with improved conflict handling options and expanded language SDK examples.
  • New Features

    • Unified conflict options for write and delete operations with clearer naming conventions.

Copilot AI review requested due to automatic review settings October 31, 2025 21:21
@rhamzeh rhamzeh requested review from a team as code owners October 31, 2025 21:21
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 31, 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.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

The changes consolidate write and delete conflict handling by replacing separate writeOptions and deleteOptions properties with a unified conflictOptions structure. Field names are updated from on_duplicate/on_missing to onDuplicateWrites/onMissingDeletes, and supported languages are adjusted in documentation and code components.

Changes

Cohort / File(s) Summary
Documentation Updates
docs/content/getting-started/update-tuples.mdx
Replaced writeOptions with conflictOptions in write examples and deleteOptions with conflictOptions in delete examples; updated field naming to onDuplicateWrites and onMissingDeletes; adjusted supported language declarations across code blocks
Component Refactoring
src/components/Docs/SnippetViewer/WriteRequestViewer.tsx
Consolidated conflict options: removed separate writeOptions and deleteOptions properties, introduced unified conflictOptions with onDuplicateWrites and onMissingDeletes fields; updated request body construction across all language SDKs (CLI, CURL, JS, GO, DOTNET, PYTHON, JAVA, RPC) to map new structure; conditionally includes Conflict sub-objects and AuthorizationModelId in request bodies

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

  • Verify mapping correctness between onDuplicateWrites/onMissingDeletes and language-specific enum/constant values across all seven supported SDK languages
  • Confirm conditional logic for including Conflict options container is applied consistently in all request body construction paths
  • Check that AuthorizationModelId conditional inclusion does not break existing behavior

Possibly related issues

Possibly related PRs

  • Add Duplicate Writes documentation #1105 — Previously introduced writeOptions and deleteOptions for duplicate/missing-tuple handling; this PR consolidates those into the new conflictOptions shape, refactoring the same code paths and request body construction logic.

Suggested reviewers

  • aaguiarz

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title "feat: support write conflict options for SDKs" is clearly and directly related to the changeset. The PR refactors how write conflict options are structured and exposed across multiple SDK implementations by consolidating writeOptions/deleteOptions into a unified conflictOptions property with renamed fields (onDuplicateWrites, onMissingDeletes). This refactoring enables consistent conflict option handling across SDKs (CLI, CURL, JS, GO, .NET, Python, Java). The title is concise, specific, and uses standard conventional commit formatting without noise, allowing a developer scanning the history to quickly understand the primary change involves conflict option handling for multiple SDKs.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
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 refactors the conflict handling options for write and delete operations by consolidating separate writeOptions and deleteOptions into a unified conflictOptions structure. The property names are also updated from snake_case to camelCase for consistency.

  • Renamed writeOptions.on_duplicate and deleteOptions.on_missing to conflictOptions.onDuplicateWrites and conflictOptions.onMissingDeletes
  • Updated code generation for Go, .NET, Python, and Java SDKs to support the new conflict options
  • Reordered imports to follow alphabetical ordering

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/components/Docs/SnippetViewer/WriteRequestViewer.tsx Refactored conflict options interface and updated code generation for all SDK languages
docs/content/getting-started/update-tuples.mdx Updated documentation examples to use new conflictOptions API

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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 31, 2025

PR Preview Action v1.6.2
Preview removed because the pull request was closed.
2025-11-20 16:10 UTC

tylernix
tylernix previously approved these changes Oct 31, 2025
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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
src/components/Docs/SnippetViewer/WriteRequestViewer.tsx (2)

378-418: RPC implementation silently ignores conflictOptions.

Similar to JS_SDK and CLI, the RPC case doesn't process conflict options. This is consistent with other unsupported languages but should be validated (see comment on JS_SDK implementation).


118-147: Add validation to warn when conflictOptions are used with unsupported languages (JS_SDK, CLI, RPC).

The analysis confirms that conflictOptions are silently ignored for three languages: JS_SDK, CLI, and RPC. While CURL, GO_SDK, DOTNET_SDK, PYTHON_SDK, and JAVA_SDK properly handle conflictOptions, the component has no validation to alert developers when they attempt to use this feature with unsupported languages. The suggested validation should be added at the component entry point to prevent confusion.

docs/content/getting-started/update-tuples.mdx (1)

275-277: Clarify SDK support statement.

The note says "this feature is only available on the API (v1.10.0). Supported SDKs will follow shortly after," but the examples immediately above and below show GO, .NET, Python, and Java SDKs as actively supported. This creates confusion about which SDKs actually support conflict options.

Consider updating the note to be more specific:

 :::caution
-At the moment, this feature is only available on the API (v1.10.0). Supported SDKs will follow shortly after.
+This feature is available on the API (v1.10.0+) and supported in the Go, .NET, Python, and Java SDKs. JavaScript SDK and CLI support will be added in future releases.
 :::
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b4710a2 and 3181a3f.

📒 Files selected for processing (2)
  • docs/content/getting-started/update-tuples.mdx (2 hunks)
  • src/components/Docs/SnippetViewer/WriteRequestViewer.tsx (8 hunks)
⏰ 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). (5)
  • GitHub Check: Cleanup artifacts
  • GitHub Check: Test deployment
  • GitHub Check: deploy-preview
  • GitHub Check: Run Checks
  • GitHub Check: markdown-link-check-md
🔇 Additional comments (8)
src/components/Docs/SnippetViewer/WriteRequestViewer.tsx (6)

28-31: LGTM! Clean consolidation of conflict handling options.

The unified conflictOptions structure with onDuplicateWrites and onMissingDeletes improves the API design by grouping related configuration together.


89-91: LGTM! Correct mapping to REST API fields.

The conflict options are properly mapped to the REST API's on_duplicate and on_missing fields with appropriate optional chaining.

Also applies to: 102-104


210-222: LGTM! Proper Go SDK enum mapping.

The conflict options are correctly mapped to Go SDK enum constants with appropriate uppercase transformation.


285-301: LGTM! Proper .NET SDK PascalCase conversion.

The conflict options are correctly mapped to .NET SDK enums with appropriate PascalCase transformation.


356-367: LGTM! Correct Python SDK enum mappings.

The conflict options are properly mapped to Python SDK enum constants with appropriate uppercase transformation (once the syntax error on line 353 is fixed).


463-478: LGTM! Proper Java SDK enum mapping.

The conflict options are correctly mapped to Java SDK enum constants with appropriate uppercase transformation.

docs/content/getting-started/update-tuples.mdx (2)

260-262: LGTM! Correct conflictOptions structure.

The documentation examples properly demonstrate the new conflictOptions structure with onDuplicateWrites and onMissingDeletes.

Also applies to: 290-292


265-272: LGTM! Correct language filtering for conflict options.

The documentation appropriately excludes JS_SDK and CLI from examples using conflict options, correctly reflecting their lack of support in the component implementation.

Also applies to: 297-304

@rhamzeh rhamzeh force-pushed the chore/write-opts-fixes branch 2 times, most recently from 007744f to f716a6f Compare October 31, 2025 22:13
ttrzeng
ttrzeng previously approved these changes Nov 4, 2025
@rhamzeh rhamzeh disabled auto-merge November 20, 2025 16:08
@rhamzeh rhamzeh merged commit c9bb6d9 into main Nov 20, 2025
14 checks passed
@rhamzeh rhamzeh deleted the chore/write-opts-fixes branch November 20, 2025 16:08
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.

4 participants