`feature variant update` fails with a 500: the API needs `feature` and `default_percentage_allocation` in the PATCH
I maintainer di solito rispondono entro 2 giorni
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 45/100
Direzione di ricerca
Start with internal/api/client.go and trace the feature variant update command to the UpdateMVOption request. The API requires feature, default_percentage_allocation, and the value fields in the PATCH body; read the option first and include those fields when sending the update. Reproduce with the documented flagsmith feature variant update command and verify that the request no longer returns a 500.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
flagsmith feature variant update sends a PATCH with only the changed fields (UpdateMVOption in internal/api/client.go). Flagsmith's API doesn't support partial updates of multivariate options: MultivariateFeatureOptionSerializer.validate() reads attrs["feature"]. That was reported in Flagsmith/flagsmith#8073, which was closed with "I don't think we properly support partial PATCH requests anywhere in our API". So the command fails with a 500 every time.
Tested with CLI v2.0.0 against self-hosted Flagsmith 2.295.2.
Steps to reproduce
flagsmith feature create button-colour --value blue --enabled
flagsmith feature variant add button-colour --value red --weight 50 --yes
flagsmith feature variant update button-colour <variant-id> --key red --yes
# Error: PATCH …/features/<id>/mv-options/<variant-id>/ returned 500 Internal Server Error
What the API accepts (checked against 2.295.2):
| PATCH body | Result |
|---|---|
{"key": "red"} |
500 |
{"feature": 46, "key": "red"} |
500 |
{"feature": 46, "key": "red", "default_percentage_allocation": 50} |
200 |
Suggested fix: read the option first, then send feature and default_percentage_allocation (and the value fields) along with the change.
Found while building flagsmith-toolbar, whose demo is set up with the CLI.
- Lingua principale
- Go
- Stelle
- 14
- Fork
- 4
- Merge medio
- 3g 7h
- PR unite (30g)
- 4
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Flagsmith/flagsmith-cli
-
`flagsmith login` fails on a self-hosted instance that isn't served at `http://localhost:8000`Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Flagsmith/flagsmith-cli#128 ·
I maintainer di solito rispondono entro 2 giorni
-
`feature create --variants` ignores each variant's `key`Forse già presa @Anuragkumar-687 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
Flagsmith/flagsmith-cli#126 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
Flagsmith/flagsmith-cli#107 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
Flagsmith/flagsmith-cli#93 ·
I maintainer di solito rispondono entro 2 giorni
-
Dependency DashboardAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 25/100
Flagsmith/flagsmith-cli#90 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di Flagsmith/flagsmith-cli
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
expr-lang/expr#1037 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
provider-key submission
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
opentofu/registry#6740 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
nightgauge/nightgauge#3713 ·
I maintainer di solito rispondono entro 1 giorno
-
fix: restore GitHub issue templates and check their license headersForse già presa @slievrly l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni