LaunchDarkly importer sets 0% for every variation on multivariate rule overrides
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 28/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 9.9k
- Fork
- 658
- Merge medio
- 1g 15h
- PR unite (30g)
- 168
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Flagsmith/flagsmith
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Flagsmith/flagsmith#9119 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Fix Button Alignment in SDK Installation SectionForse già presa @manueldezman l’ha presa 3 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
Flagsmith/flagsmith#9056 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Cloud Python warehouse snippet omits the import needed by its short-lived-job guidanceForse già presa @jcd1991 l’ha presa 4 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
Flagsmith/flagsmith#9045 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Expose whether an organisation is blocked for API usageForse già presa @PiUnknown l’ha presa 38 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
Flagsmith/flagsmith#8773 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
influx_query_manager doesn't catch ApiException, so Influx error responses 500Forse già presa @SAY-5 l’ha presa 13 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Flagsmith/flagsmith#8510 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Flagsmith/flagsmith
Issue simili
-
ui
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
ARTPARK-SAHAI-ORG/calibrate-frontend#919 ·
I maintainer di solito rispondono entro 1 giorno
-
CI: MSYS2 jobs fail — mingw python3 package renamed upstream to pythonForse già presa @ronaldtse l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
pydantic/pytest-examples#102 · 1 commento ·