Skip to content

chore: sync with SDK generator#289

Open
SoulPancake wants to merge 5 commits into
mainfrom
chore/sync-with-generator
Open

chore: sync with SDK generator#289
SoulPancake wants to merge 5 commits into
mainfrom
chore/sync-with-generator

Conversation

@SoulPancake
Copy link
Copy Markdown
Member

@SoulPancake SoulPancake commented May 12, 2026

Description

Sync with generator changes
whitespace formatting in open_fga_api.py, adds body validation for create_store to match other methods, and removes constants.py from generated files as the version is now managed by release-please.

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

    • SDK version updated to 0.10.3.
    • Refactored internal version management structure.
    • Updated code generation configuration files.
  • Documentation

    • Minor formatting adjustment in README documentation.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 12, 2026

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.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4ccf8efe-9d5b-4f42-9554-1472a3027499

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

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

This PR extracts SDK version management into a dedicated module, refactors constants to import from it, updates release and generator configurations accordingly, applies consistent multi-line parameter list formatting across API endpoint methods, and adjusts documentation spacing.

Changes

Version Management Extraction and SDK Code Formatting

Layer / File(s) Summary
Version module creation and constant relocation
openfga_sdk/_version.py, openfga_sdk/constants.py, release-please-config.json, .openapi-generator-ignore, .openapi-generator/FILES
New _version.py module defines SDK_VERSION and USER_AGENT as Final[str] constants with version 0.10.3. Constants module imports these values instead of defining them locally. Release-please and generator configurations are updated to reference the new version file.
API method parameter list formatting
openfga_sdk/api/open_fga_api.py
Sixteen endpoint wrapper methods (batch_check_with_http_info, check_with_http_info, create_store_with_http_info, expand_with_http_info, list_objects_with_http_info, list_stores_with_http_info, list_users_with_http_info, read_with_http_info, read_assertions_with_http_info, read_authorization_model_with_http_info, read_authorization_models_with_http_info, read_changes_with_http_info, streamed_list_objects_with_http_info, write_with_http_info, write_assertions_with_http_info, write_authorization_model_with_http_info) are reformatted with multi-line parameter lists and added validation comment blocks. No logic changes.
Documentation spacing adjustment
README.md
Blank line added after the "Using Path Parameters" example code block and before the "Retries" section heading.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • rhamzeh
  • evansims
  • ttrzeng
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title "chore: sync with SDK generator" accurately reflects the main objective of this pull request, which is to synchronize the repository with changes from the SDK generator, including formatting updates, version management refactoring, and configuration changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/sync-with-generator

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.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 12, 2026

Codecov Report

❌ Patch coverage is 92.59259% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.93%. Comparing base (c5fb095) to head (3f6231d).

Files with missing lines Patch % Lines
openfga_sdk/api/open_fga_api.py 88.88% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #289   +/-   ##
=======================================
  Coverage   69.92%   69.93%           
=======================================
  Files         141      142    +1     
  Lines       10768    10774    +6     
=======================================
+ Hits         7530     7535    +5     
- Misses       3238     3239    +1     

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

@SoulPancake SoulPancake changed the title chore: sync with generator chore: sync with SDK generator May 12, 2026
@SoulPancake SoulPancake marked this pull request as ready for review May 12, 2026 18:20
@SoulPancake SoulPancake requested a review from a team as a code owner May 12, 2026 18:20
Copilot AI review requested due to automatic review settings May 12, 2026 18:20
@SoulPancake SoulPancake requested review from a team as code owners May 12, 2026 18:20
@SoulPancake SoulPancake force-pushed the chore/sync-with-generator branch from 74c82c7 to 5142b9f Compare May 12, 2026 18:26
Copy link
Copy Markdown
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@SoulPancake SoulPancake linked an issue May 14, 2026 that may be closed by this pull request
Copy link
Copy Markdown
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

🧹 Nitpick comments (1)
openfga_sdk/api/open_fga_api.py (1)

657-663: ⚡ Quick win

Add a regression test for the new create_store body guard.

Line 657 introduces new client-side validation behavior; please add a unit test that asserts ApiValueError when body=None and client_side_validation=True to cover this branch.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@openfga_sdk/api/open_fga_api.py` around lines 657 - 663, Add a regression
unit test for the create_store client-side validation: call
OpenFGAApi.create_store (or the containing API class used in tests) with
body=None while forcing api_client.client_side_validation=True and assert that
ApiValueError is raised; ensure the test sets up an API client instance (or
mock) with client_side_validation enabled and targets the create_store method to
cover the branch introduced around the ApiValueError check.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@openfga_sdk/_version.py`:
- Line 18: Replace the hardcoded USER_AGENT string with one constructed from the
single source of truth SDK_VERSION to avoid duplication: reference SDK_VERSION
when building USER_AGENT (e.g., set USER_AGENT to "openfga-sdk
python/{SDK_VERSION}"), keep the x-release-please-version marker on SDK_VERSION
(not on USER_AGENT), and ensure the Final[str] typing for USER_AGENT and
SDK_VERSION remains intact so the runtime value is derived from SDK_VERSION
rather than duplicated.

---

Nitpick comments:
In `@openfga_sdk/api/open_fga_api.py`:
- Around line 657-663: Add a regression unit test for the create_store
client-side validation: call OpenFGAApi.create_store (or the containing API
class used in tests) with body=None while forcing
api_client.client_side_validation=True and assert that ApiValueError is raised;
ensure the test sets up an API client instance (or mock) with
client_side_validation enabled and targets the create_store method to cover the
branch introduced around the ApiValueError check.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 90a0b58f-9cb1-4b6a-9b5b-11f0003eebca

📥 Commits

Reviewing files that changed from the base of the PR and between 27a0d27 and 1cdd9dc.

📒 Files selected for processing (7)
  • .openapi-generator-ignore
  • .openapi-generator/FILES
  • README.md
  • openfga_sdk/_version.py
  • openfga_sdk/api/open_fga_api.py
  • openfga_sdk/constants.py
  • release-please-config.json
💤 Files with no reviewable changes (1)
  • .openapi-generator/FILES

Comment thread openfga_sdk/_version.py Outdated
SDK_VERSION: Final[str] = "0.10.3" # x-release-please-version

# User agent used in HTTP requests.
USER_AGENT: Final[str] = "openfga-sdk python/0.10.3" # x-release-please-version
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Avoid hardcoding the version string in USER_AGENT.

The version 0.10.3 is duplicated in both SDK_VERSION and USER_AGENT. While the x-release-please-version markers should keep them synchronized, constructing USER_AGENT from SDK_VERSION would eliminate duplication and reduce the risk of inconsistency if the release automation fails or is bypassed.

♻️ Proposed refactor
 # User agent used in HTTP requests.
-USER_AGENT: Final[str] = "openfga-sdk python/0.10.3"  # x-release-please-version
+USER_AGENT: Final[str] = f"openfga-sdk python/{SDK_VERSION}"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
USER_AGENT: Final[str] = "openfga-sdk python/0.10.3" # x-release-please-version
USER_AGENT: Final[str] = f"openfga-sdk python/{SDK_VERSION}"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@openfga_sdk/_version.py` at line 18, Replace the hardcoded USER_AGENT string
with one constructed from the single source of truth SDK_VERSION to avoid
duplication: reference SDK_VERSION when building USER_AGENT (e.g., set
USER_AGENT to "openfga-sdk python/{SDK_VERSION}"), keep the
x-release-please-version marker on SDK_VERSION (not on USER_AGENT), and ensure
the Final[str] typing for USER_AGENT and SDK_VERSION remains intact so the
runtime value is derived from SDK_VERSION rather than duplicated.

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.

chore: sync/reverse-sync API layer changes back to the generator

3 participants