Flagsmith / Flagsmith/engine-test-data

Spike: Condition value type coercion spec

オープン
#44 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
言語のデータがありません
スター
0
フォーク
0
平均マージ
4日 22時間
マージ済み PR(30日)
1

説明

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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

まず issue #38 とこの issue にある回答の草案を確認し、次に合意が必要な未解決の型強制のケースを特定します。ルールが確定し、それを形式化する包括的なテストケースが作成され、結果としての動作を説明するユーザー向けドキュメントが用意されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

領域
documentation, testing
issue の種類
ドキュメント
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。