Replies: 7 comments 2 replies
-
|
Hi @piotrooo I agree with everything you've said here. I follow exactly the same process as you are regarding working in the Python SDK then manually transferring my changes to the sdk-generator. I've felt the pain of this including noticing small improvements after copying across and having to repeat the cycle. I'm posting to keep an eye on this thread. But I like your suggestion to have the sdk-generator repository be for epics/larger common changes and have the separate language sdks for better developer experience. |
Beta Was this translation helpful? Give feedback.
-
|
@rhamzeh Piotr's discussion is more open-ended than the typical issue. Should it be moved to the Discussions area, or ok to continue the conversation here? WDYT? |
Beta Was this translation helpful? Give feedback.
-
|
Gently ping on this, any thoughts? Or it is a completely insane idea? 🤔 |
Beta Was this translation helpful? Give feedback.
-
|
Hi @piotrooo, thank you for taking the time to write a post and start this discussion. We appreciate all feedback and engagement from the community on the current state of the OpenFGA SDKs and the developer experience. We have been discussing this topic internally, and we wanted to come back with a thoughtful and detailed response. First, we want to acknowledge that the pain points you've raised are valid. We understand that the current approach, which relies heavily on a generator, has its limitations and that a more hand-crafted approach for each language would provide a better developer experience. The original intent of the SDK generator was to provide broad language support with the ability to easily add support for future languages. Your feedback has highlighted the difficulty of achieving multiple goals: automated code generation, consistency across SDKs, and simplicity within a particular language’s SDK. This view is also shared by the members of the team. We want to have the discussion with the community and take feedback as input for our long-term strategy for the SDKs. We are committed to the long-term health and usability of the SDKs. To consider a possible full-scale overhaul of the SDKs is a very large undertaking. Here is our plan moving forward:
Currently, the team is focused on delivering other critical product priorities. This means that while we can have the discussion, we cannot commit to building the first iteration right away, but would begin in the near future. We want to be transparent about our current constraints while also reassuring everyone that your feedback is being taken seriously. We are very grateful for this community and its passion for OpenFGA. |
Beta Was this translation helpful? Give feedback.
-
|
Hey @dyeam0, Thanks for taking this seriously and for sharing such a detailed perspective on OpenFGA, along with your transparent feedback 🙏 Long-Term StrategyWhen I think about our long-term strategy and desired state, I envision something similar to what projects like OpenTelemetry, Sentry, or even Testcontainers have accomplished. If we look at those, they maintain separate SDKs per language: OpenTelemetry: Sentry: The ideal state for our SDKs should follow a similar language-specific structure. For example, we should have a repository like openfga/java-sdk that contains all Java-related components and frameworks, including the core SDK and integrations. For instance, the spring-boot-starter should live as a separate module within this Java SDK repository. This approach makes it much easier to manage additions like support for new frameworks. It also helps with organizing ownership — making it clearer which SDKs are assigned to which teams — resulting in better maintainability, accountability, and long-term governance. The current state only reinforces the need for this structure. If you look at the sdk-generatorThe The relevant logic should remain isolated under: Ideally, the process should work as follows:
Starting PointStarting with a single SDK makes a lot of sense. But we also need a ubiquitous language that applies across all SDKs. Right now, there are some patterns (e.g. all exceptions end with I suggest the following steps:
If I missed anything, feel free to point it out. I’ll do my best to provide valuable feedback. And if there's any way I — or others from the community — can help, please don’t hesitate to reach out. |
Beta Was this translation helpful? Give feedback.
-
|
Hello @piotrooo and all. I have created a new OpenFGA roadmap item to track long-term SDK strategy efforts: openfga/roadmap#86. @rhamzeh and team have made initial steps towards streamlining contributor workflow and evolve the SDK structure. A POC has been done in openfga/sdk-generator#638. Please see roadmap item for details. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @piotrooo, Thank you for the incredibly thoughtful and detailed feedback! We sincerely appreciate the passion you have for the project and the time you took to write this up. I want to address the points you've raised and be transparent about our thinking, our constraints, and our vision for the future of the OpenFGA SDKs. The Need for ConsistencyFirst, I want to clarify our audience and responsibilities. Our goal is to serve not just contributors, but also end-users and the maintainers who ensure the project's longevity. These SDKs and their maintenance need to outlive all of our individual contributions. We recognize that a workflow tailored to the idioms of a specific language might be preferred by developers familiar with it, but we must avoid solutions or patterns that apply to only one of our many SDKs. The burden of maintaining many different development and release workflows would be unsustainable for the core team. This consistency in interfaces makes everything from documentation to testing easier—not just for the maintainers, but for end-users as well. SDK Lifecycle and MaintainabilityOn the topic of different lifecycles, you are correct that the generator does not strictly enforce a monolithic release process. Separate SDKs can and do have independent versions and release schedules. That was not the initial design, but as the team grew and time dedicated to the SDKs was reduced, this divergence became an unfortunate byproduct. That said, the primary requirement for an SDK to be considered an official OpenFGA SDK is its maintainability. If a contributor develops an SDK that works perfectly for their use case but is difficult for the current and future maintainers to support, it may be best for them to release and maintain it as a community SDK—and we fully support that_ (see https://github.com/openfga/community#community-projects). This ensures that official SDKs always meet a standard of quality, maintainability and consistency that we can stand behind. Current Changes Based on FeedbackTo ease the frustration that you (and other contributors & maintainers) have voiced, we have already moved away from a heavy-handed generation model. We've shifted towards a process more like the one you suggested, where only the foundational parts of the SDK are generated, leaving more of the idiomatic implementation details to be handled manually. You can see this change reflected in this PR to the generator and its companion PR to the Java SDK. The Long-Term Vision: More Consistency, Not LessWith that said, this is not the long-term solution. We have already seen inconsistencies and bugs arise in our current SDKs precisely because critical interfaces are defined on a per-SDK basis. This leads to divergent behavior and a higher maintenance load. Our long-term vision is to have more auto-generation and more cross-SDK consistency, not less. The ideal state is one where the Planning is Still UnderwayWe are moving towards this vision slowly and carefully. It's a significant undertaking, and as a team with limited time, it will take longer than we'd like. We also recognize that our previous workflow, which worked well when we had a smaller group of contributors, doesn't scale to the diverse and growing community we have today. This long-term vision is still being formed, and there is more planning to be done. We are committed to finding a balance that serves our entire community and that includes amazing contributors like yourself, and feedback like yours is very welcome and a critical part of that process. Thank you again for your commitment to OpenFGA! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Important
There is no clear-cut answer to this question. However, I’d like to share my perspective. I understand that the current approach to developing various SDKs is deeply embedded in the workflow, making it difficult to change.
Nevertheless, I see some downsides in the process that hinder a developer-friendly experience.
Of course, I invite discussion and constructive feedback.
Context
How do I currently develop the Java SDK?
I have the
sdk-generatorrepository checked out. Additionally, I have thejava-sdkrepository checked out. To add or refactor anything, I develop directly in thejava-sdkproject. This allows me to take full advantage of IDE features (test running, refactoring tools, code completion, etc.).Once I’m satisfied with my changes, I manually transfer them to
sdk-generator. Not very convenient, huh?Challenges
mustachefilesThe nature of
mustachefiles makes them difficult to edit, format, or refactor in the context of the language in which the SDK is developed.Additionally, a lack of familiarity with OpenAPI Generator may discourage developers from making changes.
Different States Between Specific SDKs and the Generator
A problematic scenario arises when someone modifies, for example, the
java-sdkbut does not transfer these changes tosdk-generator. Other developers working on SDKs then face discrepancies between thejava-sdkandsdk-generator. In such cases, the first step is often to align the state ofsdk-generatorwith the specific SDK. However, aligning someone else's changes could be challenging.Different SDK Lifecycles
Various SDKs have different lifecycles and development paces, which suggests distinct release cycles. This is why they should be maintained in separate repositories, allowing for proper versioning. Otherwise, the development of new SDKs may be slowed down.
For instance, @evansims prepared an excellent PoC for php-sdk. If we had separate repositories, the new SDK could be released as unstable (alpha, beta) without impacting stable SDKs. This would allow for a broader adoption process for new users.
Solutions
Generate Model
One of the most useful features of
sdk-generatoris generating models from OpenAPI specifications and the OpenFgaApi class — although even that is highly customized.Other classes, such as utils, configurations, tests, and API clients, are unrelated to the OpenAPI specification. Since they are
mustachetemplates, maintaining them is inconvenient.Common Files
Many shared files can be managed using GitHub’s built-in mechanisms, such as shared workflows or templates for issues and pull requests.
Project Management
Currently, issues in
sdk-generatorserve as a hub for feature requests and bug reports, and they are added to the SDKs and Tooling project.If SDK repositories were separate, then issues in
sdk-generatorcould still act as a hub for all SDKs. An alternative approach would be to usesdk-generatoras a hub for larger initiatives (epics) that should be applied across all SDKs. Using sub-issues, we could link individual tasks for each SDK. Specific bugs for a given SDK would be reported in their respective repositories and linked to the SDKs and Tooling project.If I missed anything, let me know. I'm very curious to hear the OpenFGA team's opinion on this process. As I mentioned, I'm open to further discussion and eager to address any gaps in the process.
Beta Was this translation helpful? Give feedback.
All reactions