Skip to content

Conversation

@rhamzeh
Copy link
Member

@rhamzeh rhamzeh commented Oct 8, 2025

Description

Now that the server and go SDK support ignoring duplicates on Write our CLI should use it to make it easier for folks to import.

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

  • New Features
    • Tuple import now ignores duplicate entries. Single tuple writes remain unchanged. Full behavior requires OpenFGA server v1.10.0+.
  • Documentation
    • Updated changelog to describe duplicate handling during import and server version requirements.
  • Chores
    • Upgraded Go toolchain to 1.25.1.
    • Updated OpenFGA Go SDK dependency to v0.7.3.

@rhamzeh rhamzeh requested a review from a team as a code owner October 8, 2025 21:33
@coderabbitai
Copy link
Contributor

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

Updates CHANGELOG to note import now ignores duplicate tuples (requires OpenFGA v1.10.0+). Upgrades Go toolchain and OpenFGA SDK. Modifies import tuple logic to set conflict handling: ignore duplicate writes and error on missing deletes during import.

Changes

Cohort / File(s) Summary
Documentation
CHANGELOG.md
Adds entry documenting that import ignores duplicate tuples (imports only), requires OpenFGA v1.10.0+; single tuple writes unchanged.
Tooling & Dependencies
go.mod
Bumps Go toolchain to go1.25.1 and github.com/openfga/go-sdk to v0.7.3.
Import Conflict Handling
internal/tuple/import.go
Sets write Conflict options in ImportTuples: OnDuplicateWrites: IGNORE, OnMissingDeletes: ERROR; no signature or structural changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Importer as ImportTuples
  participant FGA as OpenFGA Server

  User->>Importer: Start import (tuples + deletes)
  note right of Importer: Configure write options<br/>Conflict.OnDuplicateWrites=IGNORE<br/>Conflict.OnMissingDeletes=ERROR
  Importer->>FGA: Write tuples with Conflict options
  alt Duplicate tuple encountered
    FGA-->>Importer: Ignore duplicate (no error)
  else Missing delete target
    FGA-->>Importer: Error on missing delete
  end
  Importer-->>User: Import result (success/errors)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly and accurately summarizes the main feature of configuring imports to ignore duplicate writes, matching the changes in the diff.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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.

@socket-security
Copy link

socket-security bot commented Oct 8, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedgithub.com/​openfga/​go-sdk@​v0.7.2 ⏵ v0.7.383 -1100100100100

View full report

@rhamzeh rhamzeh added this pull request to the merge queue Oct 9, 2025
Merged via the queue into main with commit ef26542 Oct 9, 2025
22 checks passed
@rhamzeh rhamzeh deleted the feat/ignore-duplicate-writes-on-import branch October 9, 2025 01:19
@coderabbitai coderabbitai bot mentioned this pull request Oct 9, 2025
4 tasks
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