Skip to content

Conversation

@SoulPancake
Copy link
Member

@SoulPancake SoulPancake commented Dec 5, 2025

Description

making the client layer private so this cannot be used by SDK client

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

  • Chores
    • Temporarily disabled streamedListObjects functionality
    • Removed example code and associated tests from active execution
    • Updated access controls to restrict availability

✏️ Tip: You can customize this high-level summary in your review settings.

Copilot AI review requested due to automatic review settings December 5, 2025 10:58
@SoulPancake SoulPancake requested review from a team as code owners December 5, 2025 10:58
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 5, 2025

Walkthrough

The PR temporarily disables the streamedListObjects API by converting its example file and unit tests to comment blocks, making three overloaded streamedListObjects methods in OpenFgaClient private, and commenting out related integration tests. A note in the README documents the temporary disabling.

Changes

Cohort / File(s) Change Summary
Documentation & Example
examples/streamed-list-objects/README.md
Added note that streamedListObjects example is temporarily disabled
examples/streamed-list-objects/src/main/java/dev/openfga/sdk/example/StreamedListObjectsExample.java
API Surface
src/main/java/dev/openfga/sdk/api/client/OpenFgaClient.java
Three overloaded streamedListObjects methods changed from public to private visibility
Test Suite
src/test-integration/java/dev/openfga/sdk/api/client/OpenFgaClientIntegrationTest.java
streamedListObjects test commented out; removed unused CompletableFuture import
src/test/java/dev/openfga/sdk/api/client/StreamedListObjectsTest.java

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Visibility changes to API surface: Three method overloads in OpenFgaClient changing from public to private—verify no documented public API contract is violated and internal calls remain unaffected
  • Commented-out code rationale: Ensure the temporary disabling is intentional and the reason (API not publicly available) is properly documented for future re-enablement

Possibly related PRs

Suggested reviewers

  • curfew-marathon
  • jimmyjames

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: make streamed list objects client layer pvt' accurately describes the main change: making the streamedListObjects client-layer methods private.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/streamed-list-obj-pvt

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.

@dosubot
Copy link

dosubot bot commented Dec 5, 2025

Documentation Updates

1 document(s) were updated by changes in this PR:

OpenFGA's Space

How did I do? Any feedback?  Join Discord

@codecov-commenter
Copy link

codecov-commenter commented Dec 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 36.59%. Comparing base (90c4881) to head (e75586f).

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #266      +/-   ##
============================================
- Coverage     37.06%   36.59%   -0.47%     
+ Complexity     1200     1182      -18     
============================================
  Files           194      194              
  Lines          7504     7504              
  Branches        865      865              
============================================
- Hits           2781     2746      -35     
- Misses         4593     4633      +40     
+ Partials        130      125       -5     

☔ 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.

Copilot finished reviewing on behalf of SoulPancake December 5, 2025 11:00
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 makes the streamedListObjects API private to prevent SDK clients from using it until it's ready for public release. The feature was recently added but needs to remain internal for now.

Key Changes:

  • Changed three overloaded streamedListObjects methods from public to private in OpenFgaClient.java
  • Commented out all tests in StreamedListObjectsTest.java with a note explaining the API is not yet public
  • Commented out the integration test in OpenFgaClientIntegrationTest.java
  • Commented out the example code in StreamedListObjectsExample.java and updated its README with a notice

Reviewed changes

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

Show a summary per file
File Description
src/main/java/dev/openfga/sdk/api/client/OpenFgaClient.java Changed visibility of three streamedListObjects method overloads from public to private
src/test/java/dev/openfga/sdk/api/client/StreamedListObjectsTest.java Commented out entire test class with note about API not being publicly available yet
src/test-integration/java/dev/openfga/sdk/api/client/OpenFgaClientIntegrationTest.java Commented out streamedListObjects integration test and removed unused import
examples/streamed-list-objects/src/main/java/dev/openfga/sdk/example/StreamedListObjectsExample.java Commented out example code with note about temporary unavailability
examples/streamed-list-objects/README.md Added notice at the top indicating the example is temporarily disabled

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

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

Caution

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

⚠️ Outside diff range comments (1)
src/main/java/dev/openfga/sdk/api/client/OpenFgaClient.java (1)

1134-1141: Breaking change: Public OpenFgaClient methods made private will break example code and integration tests.

Making streamedListObjects methods private in OpenFgaClient is a breaking change. The example code at examples/streamed-list-objects/src/main/java/dev/openfga/sdk/example/StreamedListObjectsExample.java:141 and integration tests at src/test-integration/java/dev/openfga/sdk/api/client/OpenFgaClientIntegrationTest.java (lines 425, 441, 458) actively call these methods. This change will cause compilation failures in the repository itself.

The StreamedListObjectsApi class provides public streaming methods, but they require different parameters (storeId and ListObjectsRequest directly), whereas the OpenFgaClient methods accept higher-level ClientListObjectsRequest and ClientStreamedListObjectsOptions types. These are convenience wrappers, not redundant implementations.

Either:

  1. Update the example and integration tests to use the new API shape if that's intentional
  2. Keep these methods public if they represent the intended public API
  3. Provide a clear migration path and deprecation timeline before making them private
♻️ Duplicate comments (2)
src/main/java/dev/openfga/sdk/api/client/OpenFgaClient.java (2)

1174-1183: Breaking change: Second overload also made private.

This overload with options support is subject to the same breaking change concerns as the first overload. See the previous comment on lines 1134-1141 for detailed recommendations.


1214-1266: Breaking change: Third overload also made private.

This final overload with error handling support completes the pattern of making all streamedListObjects variants private. The same breaking change concerns apply as noted in the comment on lines 1134-1141.

Positive observation: The implementation remains intact and functional, which will make it easier to re-expose this API in the future when ready.

🧹 Nitpick comments (1)
src/test/java/dev/openfga/sdk/api/client/StreamedListObjectsTest.java (1)

1-429: Entire test suite appropriately disabled.

With the streamedListObjects API now private, these tests cannot compile. The note clearly explains this is temporary until the API is publicly available.

For production code, commented-out code is typically removed in favor of relying on version control history. However, given the explicit temporary nature and planned re-enablement, the current approach is acceptable.

Optional: Consider whether deleting these tests entirely would be cleaner, since Git preserves the full history. This avoids maintaining large commented blocks.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 90c4881 and c227731.

📒 Files selected for processing (5)
  • examples/streamed-list-objects/README.md (1 hunks)
  • examples/streamed-list-objects/src/main/java/dev/openfga/sdk/example/StreamedListObjectsExample.java (2 hunks)
  • src/main/java/dev/openfga/sdk/api/client/OpenFgaClient.java (3 hunks)
  • src/test-integration/java/dev/openfga/sdk/api/client/OpenFgaClientIntegrationTest.java (2 hunks)
  • src/test/java/dev/openfga/sdk/api/client/StreamedListObjectsTest.java (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-19T19:43:18.975Z
Learnt from: jimmyjames
Repo: openfga/java-sdk PR: 211
File: examples/opentelemetry/src/main/java/dev/openfga/sdk/example/opentelemetry/OpenTelemetryExample.java:8-10
Timestamp: 2025-08-19T19:43:18.975Z
Learning: The examples/opentelemetry/src/main/java/dev/openfga/sdk/example/opentelemetry/OpenTelemetryExample.java file will be generated from mustache templates, so the auto-generation header is correct and should be retained.

Applied to files:

  • examples/streamed-list-objects/src/main/java/dev/openfga/sdk/example/StreamedListObjectsExample.java
🪛 Gitleaks (8.30.0)
src/test/java/dev/openfga/sdk/api/client/StreamedListObjectsTest.java

[high] 35-35: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

⏰ 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). (6)
  • GitHub Check: Agent
  • GitHub Check: CodeQL analysis (java)
  • GitHub Check: Test and Build OpenFGA (17)
  • GitHub Check: Test and Build OpenFGA (21)
  • GitHub Check: Test and Build OpenFGA (11)
  • GitHub Check: Analyze (java)
🔇 Additional comments (4)
examples/streamed-list-objects/README.md (1)

3-5: Clean approach to temporarily disable the example.

The HTML comment wrapper preserves the documentation while clearly indicating the example is disabled. This aligns well with making the API private in the main client class.

src/test-integration/java/dev/openfga/sdk/api/client/OpenFgaClientIntegrationTest.java (1)

375-469: Test appropriately disabled for private API.

Since the streamedListObjects methods are now private, this test would no longer compile. The block comment approach preserves the test for future re-enablement.

Consider whether these tests should be deleted entirely rather than commented out, as version control preserves history. However, given the temporary nature indicated in the notes, the current approach is reasonable.

src/test/java/dev/openfga/sdk/api/client/StreamedListObjectsTest.java (1)

35-35: Static analysis false positive (informational only).

Gitleaks flagged this line as a potential API key, but DEFAULT_STORE_ID is a test fixture constant, not a real credential. Since this entire file is currently commented out, this is not an active concern. When re-enabled, no action is needed.

examples/streamed-list-objects/src/main/java/dev/openfga/sdk/example/StreamedListObjectsExample.java (1)

1-199: Example appropriately disabled with clear documentation.

The note explains the temporary nature, and the block comment preserves the example code for future re-enablement. This aligns with making the streamedListObjects API private.

Based on learnings, if example files are generated from mustache templates, ensure the templates are also updated to reflect this temporary disablement to avoid regenerating active example code.

Copy link
Member

@ewanharris ewanharris left a comment

Choose a reason for hiding this comment

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

I know that the OpenFgaApi class isn't meant to be public, but do we want to make that private too?

@SoulPancake
Copy link
Member Author

SoulPancake commented Dec 5, 2025

I know that the OpenFgaApi class isn't meant to be public, but do we want to make that private too?

@ewanharris In the API layer?
Will we be able to use in the client if we make it private as they are in different packages dev.openfga.sdk.api vs dev.openfga.sdk.api.client. Also i guess that is mostly coming from the generator ( with no manual changes )

@ewanharris
Copy link
Member

Oh yeah good point, it would just lead to more difficulty in the OpenFgaClient code I guess. Given we don't really document/recommend and AFAIK we treat it as unstable anyways I guess we're fine to leave it

@SoulPancake SoulPancake added this pull request to the merge queue Dec 5, 2025
Merged via the queue into main with commit 7e9a960 Dec 5, 2025
25 checks passed
@SoulPancake SoulPancake deleted the chore/streamed-list-obj-pvt branch December 5, 2025 18:19
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.

5 participants