Creating a feature with multivariate_options drops each option's key (variations end up unlabelled for Experimentation)
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 68/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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)
- Langage dominant
- Python
- Étoiles
- 9.9k
- Forks
- 658
- Merge moyen
- 1 j 15 h
- PR mergées (30 j)
- 171
Préparer son environnement
- Fournit un Dockerfile ou un fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de Flagsmith/flagsmith
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Flagsmith/flagsmith#9119 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Fix Button Alignment in SDK Installation SectionPeut-être pris @manueldezman l’a pris il y a 4 jours. Ouvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Flagsmith/flagsmith#9056 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Cloud Python warehouse snippet omits the import needed by its short-lived-job guidancePeut-être pris @jcd1991 l’a pris il y a 5 jours. Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 75/100
Flagsmith/flagsmith#9045 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Expose whether an organisation is blocked for API usagePeut-être pris @PiUnknown l’a pris il y a 39 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Flagsmith/flagsmith#8773 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de Flagsmith/flagsmith
Issues similaires
-
documentation good first issue help wanted
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
-
documentation good first issue help wanted
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
-
documentation good first issue help wanted
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
good first issue help wanted
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
-
[Suggestion]: AgentermOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
collabnix/awesome-mcp-lists#490 ·
Les mainteneurs répondent en général sous 2 jours