LaunchDarkly importer links segment overrides to another environment's segment
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 25/100
Línea de trabajo
Start with _create_segments_from_ld in api/integrations/launch_darkly/services.py and trace how imported segments are associated with environment-specific flag overrides. Review the existing LaunchDarkly tests, especially the TEST_SEGMENT_TARGET case, and add regression coverage showing that each environment’s override uses its own imported segment. The issue reports that a fix and regression tests already exist on the reporter’s branch, so coordinate before starting.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
The importer creates one segment per LaunchDarkly segment and environment, e.g. Beta testers (Override for test) and Beta testers (Override for production). However, _create_segments_from_ld stores them keyed by segment key only (services.py#L1112), so each environment overwrites the previous one. Flag rules using segmentMatch then link every environment's override to the last environment's segment.
As a result, if a segment has different members per environment, users in one environment are targeted using another environment's members, and editing the Test segment has no effect on Test.
Steps To Reproduce
- Import a LaunchDarkly project with two environments, a segment whose members differ per environment, and a flag with a
segmentMatchrule on that segment. - Open the flag's segment overrides in the Test environment.
- The override uses
… (Override for production).
This also reproduces with the existing test data: for TEST_SEGMENT_TARGET, the Test environment's overrides are User List, Dynamic List and Dynamic List 2 (Override for production).
Expected behavior
Each environment's override uses the segment imported for that environment.
Related: #7332 would avoid this by design. This is a smaller fix for the current structure.
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.
- Lenguaje dominante
- Python
- Estrellas
- 9.9k
- Forks
- 658
- Merge medio
- 1 d 15 h
- PR fusionados (30 d)
- 168
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Flagsmith/flagsmith
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Flagsmith/flagsmith#9119 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Fix Button Alignment in SDK Installation SectionPosiblemente ocupada @manueldezman la tomó hace 3 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Flagsmith/flagsmith#9056 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Cloud Python warehouse snippet omits the import needed by its short-lived-job guidancePosiblemente ocupada @jcd1991 la tomó hace 4 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
Flagsmith/flagsmith#9045 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Expose whether an organisation is blocked for API usagePosiblemente ocupada @PiUnknown la tomó hace 38 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Flagsmith/flagsmith#8773 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
influx_query_manager doesn't catch ApiException, so Influx error responses 500Posiblemente ocupada @SAY-5 la tomó hace 13 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Flagsmith/flagsmith#8510 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de Flagsmith/flagsmith
Issues similares
-
triage
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
kornia/kornia-rs#1416 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
ui
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
PolicyEngine/ai-inequality#64 ·
Los mantenedores suelen responder en 1 día
-
LinearGaussianStateSpace.dist splits states and observations wrongly when the transition varies over timePosiblemente ocupada @PabloRoque la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
pymc-devs/pymc-extras#839 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día