Identity overrides don't work in offline local evaluation mode
まだ誰も着手していません。
評価
調査の方向性
flagsmith/flagsmith.py の 117 行付近にあるオフラインハンドラーの読み込みパスと、273 行付近にある API 更新パスから開始し、ローカルファイル内で identity_overrides がどのように表現されているかを追跡します。オフラインのローカル評価で識別子 146433 に対する override が適用され、通常の feature-state の動作が維持されることを確認し、このケースのリグレッションテストカバレッジを追加または実行します。
索引モデルが issue の本文から書いたものです。
説明
I'm using version 3.8.0 and have identity overrides enabled for my environment.
I'm using a copy of a config for local development and initialize Flagsmith as follows:
local_file_handler = LocalFileHandler(
environment_document_path=f"./feature_flags_configuration.local.json"
)
flagsmith = Flagsmith(
environment_key=settings.FLAGSMITH_API_KEY,
enable_local_evaluation=True,
offline_handler=local_file_handler,
offline_mode=True,
)
I have following settings on my config:
"feature_states": [
{
"feature": {
"id": 103972,
"name": "ipqs_geo_ip",
"type": "STANDARD"
},
"enabled": true,
"django_id": 576867,
"feature_segment": null,
"featurestate_uuid": "04dcc7d5-b387-4668-8264-d30a2da2e111",
"feature_state_value": null,
"multivariate_feature_state_values": []
}
],
"identity_overrides": [
{
"identifier": "146433",
"environment_api_key": ...,
"created_date": "2024-08-26T17:45:31.959128Z",
"identity_features": [
{
"feature": {
"id": 103972,
"name": "ipqs_geo_ip",
"type": "STANDARD"
},
"enabled": false,
"django_id": null,
"feature_segment": null,
"featurestate_uuid": "964dd1e9-b34a-4bf7-9984-937abbba3f0e",
"feature_state_value": null,
"multivariate_feature_state_values": []
}
],
"identity_traits": [],
"identity_uuid": "8fd6de03-b834-41d2-b5ec-7076d00e6cd3",
"django_id": null,
"composite_key": "cfWNJQwEQkcAiKxSPFL2rv_146433"
}
],
However, identity overrides are ignored unless I disable offline mode.
The root cause must be that it is updated only here when API request is made and are not loaded from offline handler here.
In production, I'm also using the local file as a fallback for the case when Flagsmith is unavailable during app start, so it might become a problem in production in rare cases.
- 主要言語
- Python
- スター
- 24
- フォーク
- 12
- 平均マージ
- 15時間 43分
- マージ済み PR(30日)
- 4
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Flagsmith/flagsmith-python-client のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
-
Dependency Dashboard オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
-
Flagsmith/flagsmith-python-client#198 · コメント 1 件 · 担当者 2 名 ·
Flagsmith/flagsmith-python-client の issue をすべて見る
似ている issue
-
documentation help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
simonw/sqlite-utils#872 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100