fix(LaunchDarkly): resolve served variation for boolean flag import - #8135
fix(LaunchDarkly): resolve served variation for boolean flag import#8135bardock-2393 wants to merge 1 commit into
Conversation
… of served variation LD separates "is the flag on" from "what does it serve" (fallthrough/offVariation), but the importer mapped `on` directly to Flagsmith's `enabled`, which silently inverted any boolean flag using the "on, defaulting to false, enable via targeting" pattern.
|
@bardock-2393 is attempting to deploy a commit to the Flagsmith Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe LaunchDarkly boolean feature import now resolves Estimated code review effort: 2 (Simple) | ~10 minutes Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Boolean flags imported from LaunchDarkly can evaluate to the opposite of what they do in LD. LD separates "is the flag on" from "what does it serve" (the fallthrough variation when on, or the off variation when off), but the importer mapped the raw
ontoggle straight to Flagsmith'senabledstate. Any project using the common "flag on, default off, enable via targeting/segments" pattern imports with an inverted default, silently, since nothing is written toerror_messagesand the import still reports success.Changes
_summary, matching how the existing string/multivariate import paths already resolve their served value, instead of taking theontoggle at face value.Contributes to #8047
How did you test this code?
test_process_import_request__success__expected_statuscoverage: theflag1fixture now has a boolean flag that isonin one environment but resolves to thefalsevariation, andoffin another environment but resolves totrue. Confirmed the test fails on the old code and passes with the fix.tests/unit/integrations/launch_darklysuite (47 passed).make lint(pre-commit) andmypypass on the changed files.Review effort: 2/5