Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(python): Add flags & namespaces api #127

Merged
merged 1 commit into from
Mar 8, 2024

Conversation

jarviliam
Copy link
Contributor

@jarviliam jarviliam commented Mar 5, 2024

Summary

Adds the apis for Flag and Namespace operations.
Test sessions will run under a uuid4 generated namespace so that theres no conflict between mutiple test runs

My company uses these flag/namespace operations so having them in the official server-sdk would make it easier to adopt. I just assumed that they are missing here but if there are actually no plans to implement them just let me know and I'll close this PR 👍

@jarviliam jarviliam marked this pull request as ready for review March 5, 2024 11:07
@jarviliam jarviliam requested a review from a team as a code owner March 5, 2024 11:07
@markphelps
Copy link
Contributor

Hey @jarviliam

Thanks for the contribution and sorry for the slow reply!
We're not currently planning to support these resource management endpoints in these SDKs at this time.

Previously we were using a tool to handle auto-generating clients in multiple languages.
While this enabled us to scale the number of languages we support, it lacked in terms of flexibility and maintainability when it came to keeping dependencies up to date and so on. So we decided to ultimately move away, and instead hand-craft clients for this smaller API surface area.

That said though, we do intend to maintain these management APIs in Flipt and ensure backward compatibility for them. However, we intend to keep these particular SDK clients isolated to evaluation only for now.

We would love to understand what you're use case is here for these APIs.
It would help us to decide whether we need to bring back support or build additional clients for them.

I could see how adding support for ListNamespaces and ListFlags could make sense though ,as its often required to dynamically query which flags/namespaces can be evaluated before actually evaluating.

@jarviliam
Copy link
Contributor Author

@markphelps Understandable! Feel free to close out this PR then 👌

We would love to understand what you're use case is here for these APIs.

The main use-case missing from these sdks is really ListFlags in my opinion. We have a situation where the Frontend would like a list of enabled UI features for a user. We currently have our front-end call a backend api that calls flipt. Like you mentioned, the flags are dynamic so we have to fetch a list of flags and batch evaluate each flag. Having this in the SDK would basically fit all our use-cases for flipt at the moment. (No pressure though, we can still get by with our own internal http client calling the endpoints)

Thanks for all the work on Flipt!

@markphelps
Copy link
Contributor

@jarviliam I think list flags 💯 percent makes sense to add to all our revamped sdks.

Would you mind pairing this PR down to adding list flags for python and I will make sure we implement it for other languages as well? We just did the same for our client side evaluation sdks

@jarviliam jarviliam force-pushed the feat-python-flags-api branch 2 times, most recently from 810331b to 9acf025 Compare March 8, 2024 01:20
@jarviliam
Copy link
Contributor Author

@markphelps Ran the linter and rebased on latest 🙇

Copy link
Contributor

@markphelps markphelps left a comment

Choose a reason for hiding this comment

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

cheers! thanks @jarviliam !!

@markphelps markphelps merged commit e862964 into flipt-io:main Mar 8, 2024
6 checks passed
@flipt-release-bot flipt-release-bot bot mentioned this pull request Mar 8, 2024
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.

None yet

2 participants