Skip to content

Feature flags: Support non-boolean values #71

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

Closed
ran-isenberg opened this issue Oct 24, 2021 · 7 comments
Closed

Feature flags: Support non-boolean values #71

ran-isenberg opened this issue Oct 24, 2021 · 7 comments
Labels

Comments

@ran-isenberg
Copy link

Today, the utility feature flags support boolean flags.
The utility support only boolean values at the moment, hence the wording "flag".
The utility can support more complex rule match values. I'd like to be able to provide a session context and get back according to the rule engine a more complex object such as Dict, list etc.

@alexsh-ca
Copy link

Great idea.
Perhaps the parameters utility can be integrated with this somehow? The feature flags utility documentation states that "You can use Parameters utility for static flags while this utility can do both static and dynamic feature flags." So perhaps it's a matter of extending the Parameters utility so it can also be dynamic, like feature flags?

@ran-isenberg
Copy link
Author

@alexsh-ca Thanks for the support!
I think the feature flags could use some re-branding if we add this feature.
To me, it's much more than a feature flags utility. It's a full fledged configuration utility- you have smart feature flags and you have the RAW configuration getter.
Another feature would be "smart" configuration, not just True/False. One complete package, something similar to what other solution offers in their SDK (LaunchDarkly come into mind) .

So they way I see it, is we add a new function and a new subsection for the complex engine in the json file and perhaps an updated schema (maybe add a new field for when_match field type etc.).

@ran-isenberg
Copy link
Author

@heitorlessa see aws-powertools/powertools-lambda-python#804 for a working POC

@michaelbrewer
Copy link
Contributor

Note that LaunchDarkly python library is completely un typed

@ran-isenberg
Copy link
Author

@michaelbrewer what do you mean? to my understanding, LaunchDarkly's API returns 'ANY' for an evaluated feature value. I was able to achieve this behavior in this PR.

@michaelbrewer
Copy link
Contributor

Just saying that powertools includes helpful type hinting. Where as LaunchDarkly just has none

@heitorlessa heitorlessa transferred this issue from aws-powertools/powertools-lambda-python Dec 22, 2021
@heitorlessa heitorlessa changed the title Utilities -> Feature flags -> enhance flags to a generic engine with non boolean values support Feature flags: enhance flags to a generic engine with non boolean values support Dec 22, 2021
@heitorlessa heitorlessa changed the title Feature flags: enhance flags to a generic engine with non boolean values support Feature flags: Support non-boolean values Dec 22, 2021
@heitorlessa
Copy link
Contributor

Hey @ran-isenberg thanks again for the initial implementation! This is available on 1.24 ;)

https://awslabs.github.io/aws-lambda-powertools-python/latest/utilities/feature_flags/#beyond-boolean-feature-flags

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants