-
Notifications
You must be signed in to change notification settings - Fork 28
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: add feature flag endpoint #531
Conversation
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #531 +/- ##
=======================================
- Coverage 95.80 95.79 -0.01
=======================================
Files 774 777 +3
Lines 17124 17208 +84
=======================================
+ Hits 16404 16484 +80
- Misses 720 724 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather than storing the FeatureFlag
in a redis cache, could you go a layer higher and store the list of flag results in the cache based on the input ID info? or we could skip redis for now - i'm not sure whether going to redis on every request will be significantly faster than going to the db on every request
in any case, i think we should try to avoid the duplicated implementation of the feature bucketing logic if we can. is there a reason why we can't create a Feature()
and call .check_value()
? its caching may not be useful, but i don't think it would be harmful
I feel like if we cache based on the user info, we would basically never get a cache hit since gazebo should only hit the endpoint at some interval of like 5 min |
I can make it work, just need to do a minor rework of the class |
3c82c5c
to
35e6c87
Compare
use Feature util instead cleanup don't use django redis cache abstraction
8953cac
to
d7935ae
Compare
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #531 +/- ##
==========================================
+ Coverage 91.49% 91.51% +0.01%
==========================================
Files 599 602 +3
Lines 16268 16352 +84
==========================================
+ Hits 14885 14965 +80
- Misses 1383 1387 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found @@ Coverage Diff @@
## main #531 +/- ##
==========================================
+ Coverage 91.49% 91.51% +0.01%
==========================================
Files 599 602 +3
Lines 16268 16352 +84
==========================================
+ Hits 14885 14965 +80
- Misses 1383 1387 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Purpose/Motivation
What is the feature? Why is this being done?
Dependent on codecov/shared#205.
Adds an endpoint at
/internal/features
which will accept a request body ofand spit out a response with all the flag evaluations for that given user based on their
identifier_data
:Mostly copies over the core logic for https://github.com/codecov/shared/blob/f7768f29cb0084947d4eb0c42db6c747ad3ee3f0/shared/rollouts/__init__.py#L27 except with its own caching strategy using Redis. The caching strategy here:
Also adds tests for the endpoint
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.