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

Aberta
#125 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 2 dias

@Anuragkumar-687 já está trabalhando nisso.

Desde 28/11/2026.

  • #127 de @Anuragkumar-687 — aberto

Avaliação

Dificuldade
3/5
Tempo estimado
Meio dia
Facilidade para iniciantes
45/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Estagnada
Stack de tecnologia
go
Domínio
cli

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
Go
Estrelas
14
Forks
4
Merge médio
3d 7h
PRs com merge (30d)
4

Preparar o ambiente

  • Inclui um Dockerfile ou arquivo Docker Compose
  • Sem modelo de pull request
  • Sem guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de Flagsmith/flagsmith-cli

Todas as issues de Flagsmith/flagsmith-cli

Issues semelhantes

Mais issues de Go

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.