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

fix(flags): use feature_enabled field of unleash variants #3914

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

aliu39
Copy link
Member

@aliu39 aliu39 commented Jan 10, 2025

Fixes a logic error in #3888

After rereading https://docs.getunleash.io/reference/strategy-variants and testing w/ a local Unleash instance, I found we need to use a different variant field, feature_enabled. enabled refers to whether the variant itself is enabled, but a feature/"toggle" can be enabled with no variants. In this case, a disabled variant is returned (see no_variant_payload in tests).

Copy link

codecov bot commented Jan 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.20%. Comparing base (fa241c3) to head (adb3bb1).

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3914   +/-   ##
=======================================
  Coverage   80.20%   80.20%           
=======================================
  Files         140      140           
  Lines       15412    15412           
  Branches     2593     2593           
=======================================
  Hits        12361    12361           
- Misses       2206     2207    +1     
+ Partials      845      844    -1     
Files with missing lines Coverage Δ
sentry_sdk/integrations/unleash.py 93.75% <100.00%> (ø)

... and 1 file with indirect coverage changes

@cmanallen
Copy link
Member

@aliu39 How are people using get_variant in practice? Does it make sense to send a true, false value to Sentry if what the user is actually working with strings a, b, or c?

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.

2 participants