Creating a feature with multivariate_options drops each option's key (variations end up unlabelled for Experimentation)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
調査の方向性
Start at the feature creation endpoint, POST /api/v1/projects/{project_pk}/features/, and trace how its request handles multivariate_options; compare that with the PUT /api/v1/projects/{project_pk}/features/{feature_pk}/mv-options/{id}/ behavior described here. Confirm the change by creating a feature with an option key and checking that the response and a later GET preserve it, or reject the request with a validation error.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
When a feature is created with multivariate_options in the body of POST /api/v1/projects/{project_pk}/features/, the key of each option is silently dropped: the response and later GETs return "key": null. No error or warning is returned.
This matters for Experimentation: the docs say exposures are attributed by variation label, and "a variation without a label, for example one created through the API without a key, is not counted" (Run an experiment → Troubleshooting). So a client that creates its variations in one call, passing keys, ends up with unlabelled variations and silently loses exposures.
Steps to reproduce
Self-hosted open source, image flagsmith/flagsmith:2.295.2 (/version/ → "image_tag": "2.295.2", "is_enterprise": false), Admin API key auth.
curl -s -X POST "$API/projects/$PROJECT/features/" \
-H "Authorization: Api-Key $KEY" -H "Content-Type: application/json" \
-d '{
"name": "mv_key_probe",
"type": "MULTIVARIATE",
"initial_value": "control-value",
"multivariate_options": [
{"type": "unicode", "string_value": "variant-a-value",
"default_percentage_allocation": 0, "key": "variant_a"}
]
}'
Expected behaviour
The option is created with "key": "variant_a", or the request is rejected with a validation error if keys can't be set at creation time.
Actual behaviour
"multivariate_options": [
{"id": 5, "type": "unicode", "string_value": "variant-a-value",
"default_percentage_allocation": 0.0, "key": null}
]
GET /api/v1/projects/$PROJECT/features/{id}/ also returns "key": null.
Workaround
Set the key afterwards with PUT /api/v1/projects/{project_pk}/features/{feature_pk}/mv-options/{id}/ and the full body (type, feature, string_value, default_percentage_allocation, key). (PATCH on that endpoint currently returns 500, already tracked in #9119.)
Possibly related
- #6615 (validation on the mv-options endpoint)
- #9119 (PATCH on a multivariate option returns 500)
- 主要言語
- Python
- スター
- 9.9k
- フォーク
- 658
- 平均マージ
- 1日 15時間
- マージ済み PR(30日)
- 171
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Flagsmith/flagsmith のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Flagsmith/flagsmith#9119 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Fix Button Alignment in SDK Installation Section対応中かも @manueldezman が 4 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
Flagsmith/flagsmith#9056 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Cloud Python warehouse snippet omits the import needed by its short-lived-job guidance対応中かも @jcd1991 が 5 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
Flagsmith/flagsmith#9045 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Expose whether an organisation is blocked for API usage対応中かも @PiUnknown が 39 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
Flagsmith/flagsmith#8773 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
Flagsmith/flagsmith の issue をすべて見る
似ている issue
-
documentation good first issue help wanted
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
documentation good first issue help wanted
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
-
documentation good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
collabnix/awesome-mcp-lists#490 ·
メンテナーはふだん 2 日以内に返信