Flagsmith / Flagsmith/engine-test-data
Spike: Condition value type coercion spec
- Lenguaje dominante
- Sin datos de lenguaje
- Estrellas
- 0
- Forks
- 0
- Merge medio
- 4 d 22 h
- PR fusionados (30 d)
- 1
Descripción
The behaviour of the engine needs to be clarified when comparing context values (traits) to segment condition values.
Different languages handle this in different ways, so we need to agree on a set of rules that are not dependent on any specific language implementation.
The goal is to devise test cases that formalise the in-engine type coercion, and a comprehensive user-facing document that details it.
Some of the questions we should have formal answers to, along with draft answers representing the current behaviour:
Q: How is a null context value treated?
A: Engine evaluates to `false` for all operators except `IS_NOT_SET`.
Q: What is the string representation of a Boolean condition value?
A: `'True', 'true', 'False', 'false'`. Numeric values (`1, 0`) are not expected.
Q: How are numeric values compared?
A: Condition value is coerced to context/trait value type.
Q: How are values compared for the In operator?
A: Condition value is coerced to list of strings. Membership check is performed against a string representation of the context/trait value. Boolean context/trait values are skipped (rule evaluated to `false`).
NOTE: This behaviour is deemed problematic due to contradicting the overall logic of coercing segment condition values to trait values, and lack of uniform decimal/float serialisation across different languages.
Q: How are numbers parsed in regards to system locale?
A: Numbers are always parsed with a period as decimal separator, regardless of region or language settings system or process-wise.
#38 is an attempt to formalise the last answer, which sparked a conversation resulting in this issue.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Comienza revisando el issue #38 y las respuestas preliminares de este issue; después, identifica los casos de coerción no resueltos que requieren acuerdo. Se considera terminado cuando las reglas están establecidas, unos casos de prueba exhaustivos las formalizan y un documento orientado al usuario explica el comportamiento resultante.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Área
- documentation, testing
- Tipo de issue
- Documentación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 25/100