kos / flippy Goto Github PK
View Code? Open in Web Editor NEWFeature flipper app for Django
License: ISC License
Feature flipper app for Django
License: ISC License
Current implementation might cause HTTP 500 in case of buggy implementation of a subject. It'd be good to have a safe which will catch all exceptions, log them, and return default value (False
would be sensible value in case problem occurs)
Currently each rollout can be configured to target either a subject, or a percentage-based slice of a subject.
There should be a way to further narrow down a subject by something meaningful. Assuming you have a subject "Users", you could derive filtered subjects along the lines of:
A possible implementation is to have a distinction between:
where a filterable Subject can be parametrised with a string and the meaning of the string is specific to the particular Subject. This means that "Users with email..." and "Users with id..." would be separate subject classes that only differ by how they interpret the filter string. It would be difficult (UX wise) to provide a good way to do a single rollout for "Users with email ... or id ..."), unless you write a very specific Subject for this case & figure out a language that allows to encode the parameters in a single string.
Since all Subjects already have a way to slice by percentage (built-in), we need to define how this would interact with filter strings.
A trivial implementation of implementing "roll out to 50% users with email ending with gmail.com" would be to test if the user's flag score is <= 50% and if the email ends with gmail.com. This should be in line with what the user expects as long as the flag score doesn't obviously correlate with the e-mail.
Currently, the Flag has a get_state_for_request
which accepts HTTP request. This is perfect for usage in views or very close to the API layer, but get's troublesome when the feature flag affects some logic deeper in the code.
I'd like to suggest implementing a similar method to one mentioned above, but accepting User instance instead of request. For example: get_state_for_user
.
Repro:
Django admin now crashes on rollout list. Handle this gracefully.
As a developer working on a Django app, I'd very much enjoy a possibility to quickly preview how a given page works with flag X enabled or disabled.
Say we have page "Recipes" and two different flags that control how this page look like, enable_foo
and enable_bar
. Without any special assistance from Flippy, in order to preview my page in all 4 combinations, I'd have to:
enable_foo
, log back in as the original userenable_bar
, log back inenable_foo
, log back inThis is an unacceptably long feedback loop for manual testing. (It's very suitable for automated unit testing, though - you'd just write 4 test cases with different set-up, or write one parametrized Pytest fixture for each feature flag)
Implementation idea: allow to temporarily set a flag for the duration of one request using special query string parameters, such as ?flippy_enable_foo=1
. This would only take effect if debug mode is enabled in settings (DEBUG=True
? FLIPPY_DEBUG_QUERY_PARAMS=True
?).
Main trouble with this: ensure this works somehow for TypedFlags which aren't queried with a Request object, if at all possible.
Issue #6 talked about possibilities of easily toggling flags during development, this issue talks about viewing the current state of flags.
During development, a reasonable question to ask is "what flags are currently enabled for me?". This should be easy.
Idea: there's already a place for showing diagnostics like this, it's called Django Debug Toolbar - maybe one could just add a panel there?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.