`feature variant update` fails with a 500: the API needs `feature` and `default_percentage_allocation` in the PATCH

Abierto
#125 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

@Anuragkumar-687 ya está trabajando en esto.

Desde el 28/11/2026.

  • #127 de @Anuragkumar-687 — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
Medio día
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
go
Área
cli

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Go
Estrellas
14
Forks
4
Merge medio
3 d 7 h
PR fusionados (30 d)
4

Preparar el entorno

  • Incluye un Dockerfile o un archivo de Docker Compose
  • Sin plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Flagsmith/flagsmith-cli

Todos los issues de Flagsmith/flagsmith-cli

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.