LaunchDarkly importer sets 0% for every variation on multivariate rule overrides
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 28/100
Piste de recherche
Read api/integrations/launch_darkly/services.py around the rule variation handling at lines 675 and 749, then inspect the LaunchDarkly tests using TEST_TARGETED_CONTEXT. Confirm that a fixed variation is imported at 100% and the other variations at 0%, and run the LaunchDarkly test suite. The issue says a fix and regression tests already exist on a contributor's branch, so check that work before starting.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
How are you running Flagsmith
Some other way: local development from main (6e0f9da)
Context
We came across this while using the LaunchDarkly importer in a project of ours, while building an end-to-end check for #8721. Since we had already traced the cause, we are reporting it here together with a fix, rather than just flagging the problem.
Describe the bug
For a multivariate flag, a LaunchDarkly rule that serves a fixed variation (e.g. "beta testers get new") is imported as a segment override with 0% for every variation, so matching users get the control value instead of new.
LaunchDarkly gives the rule's variation as an integer ("variation": 0). services.py#L749 passes it unchanged, with a # type: ignore[arg-type] that hides the mismatch, and L675 compares it with string keys (0 == "0"), which is never true. Individual targets already convert it with str() (L575).
Steps To Reproduce
- Import a multivariate LaunchDarkly flag with a rule that serves a fixed variation.
- Open the resulting segment override.
- Every variation shows 0%.
With the existing test data, TEST_TARGETED_CONTEXT's rule overrides (Regular And, Reverted And, Just Not) are all 0% / 0% / 0% / 0%.
Expected behavior
The rule's variation gets 100% and the others 0%, as for individual targets.
Fix
We have already fixed this, with regression tests (all LaunchDarkly tests pass, 100% diff coverage, mypy clean):
- Fix branch: https://github.com/Ayush-e4/flagsmith/tree/fix/ld-importer-env-segments-and-mv-rules
- Sample app, root cause and before/after results: https://github.com/Ayush-e4/flagsmith/tree/sample-apps/sample-apps/launchdarkly-import-bugs
If it helps, please feel free to assign this issue to me and I will open a PR from that branch.
- Langage dominant
- Python
- Étoiles
- 9.9k
- Forks
- 658
- Merge moyen
- 1 j 15 h
- PR mergées (30 j)
- 168
Préparer son environnement
- Fournit un Dockerfile ou un fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de Flagsmith/flagsmith
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Flagsmith/flagsmith#9119 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Fix Button Alignment in SDK Installation SectionPeut-être pris @manueldezman l’a pris il y a 3 jours. Ouvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Flagsmith/flagsmith#9056 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Cloud Python warehouse snippet omits the import needed by its short-lived-job guidancePeut-être pris @jcd1991 l’a pris il y a 4 jours. Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 75/100
Flagsmith/flagsmith#9045 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Expose whether an organisation is blocked for API usagePeut-être pris @PiUnknown l’a pris il y a 38 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Flagsmith/flagsmith#8773 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
influx_query_manager doesn't catch ApiException, so Influx error responses 500Peut-être pris @SAY-5 l’a pris il y a 13 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
Flagsmith/flagsmith#8510 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de Flagsmith/flagsmith
Issues similaires
-
triage
Difficulté 1/5 1-3 heures Accessibilité débutants 88/100
kornia/kornia-rs#1416 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
ui
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
PolicyEngine/ai-inequality#64 ·
Les mainteneurs répondent en général sous 1 jour
-
LinearGaussianStateSpace.dist splits states and observations wrongly when the transition varies over timePeut-être pris @PabloRoque l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
pymc-devs/pymc-extras#839 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Les mainteneurs répondent en général sous 1 jour