bug: --filteredOperations fails on comma-separated list
Mantenedores costumam responder em até 3 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 65/100
Direção de pesquisa
Comece em pkg/connectors/microcks_client.go e leia ensureValidOperationsList; em seguida, confira a descrição de --filteredOperations em test.md e os testes unitários relacionados. Confirme que valores separados por vírgula e uma única operação são removidos de espaços extras e convertidos, enquanto a entrada como array JSON continua sendo compatível; o trabalho estará concluído quando esses casos passarem e a CLI enviar a lista de operações esperada.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Describe the bug
While trying to run tests on specific operations using --filteredOperations, I noticed that passing a comma-separated list (or even a single operation) like --filteredOperations "GET /pastries,POST /pastries" fails immediately:
creating test: parsing filteredOperations JSON: invalid character 'G' looking for beginning of value
The docs in test.md mention that --filteredOperations accepts a "Comma-separated list of operations to test", but ensureValidOperationsList in pkg/connectors/microcks_client.go runs a direct json.Unmarshal on the string.
So right now it only works if you pass a raw JSON array string like '["GET /pastries"]', which is pretty unintuitive for a CLI flag and contradicts what the docs say.
Expected behavior
It should accept normal comma-separated strings like --filteredOperations "GET /pastries, POST /pastries" (and single operations like "GET /pastries"), trim whitespace, and turn that into the array payload for the server.
Keeping support for the ["..."] JSON array format would also be good so we don't break anyone already passing JSON.
Actual behavior
$ microcks test "hello:1.0" "http://localhost:8080" HTTP --filteredOperations "GET /hello,POST /hello" --microcksURL http://127.0.0.1:8888
creating test: parsing filteredOperations JSON: invalid character 'G' looking for beginning of value
exit status 2
How to Reproduce?
Run a test passing a comma-separated list to --filteredOperations:
microcks test "MyAPI:1.0" "http://localhost:8080" HTTP --filteredOperations "GET /pastries,POST /pastries" --microcksURL http://127.0.0.1:8888
It fails with the JSON parse error.
Microcks version or git rev
main
Install method (docker-compose, helm chart, operator, docker-desktop extension,...)
cli
Additional information
The fix is pretty straightforward in pkg/connectors/microcks_client.go, if the string doesn't start with [, we can just split on commas, trim spaces, and marshal the slice to JSON.
Tested this locally and happy to open a quick PR with the fix and unit tests if that sounds good!
- Linguagem predominante
- Go
- Estrelas
- 59
- Forks
- 75
- Merge médio
- 7d 12h
- PRs com merge (30d)
- 20
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de microcks/microcks-cli
-
Logging into a locally started instance clears its container reference, causing stop to do nothingAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 79/100
microcks/microcks-cli#620 ·
Mantenedores costumam responder em até 3 dias
-
WatchConfig.UpsertEntry silently deletes existing contexts when re-upserting a watched fileTalvez já em andamento @aryarathoree assumiu há 3 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
microcks/microcks-cli#610 · 5 comentários ·
Mantenedores costumam responder em até 3 dias
-
bug: microcks test get swallows test failure details and operation results in text output modeTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
microcks/microcks-cli#608 · 2 comentários ·
Mantenedores costumam responder em até 3 dias
-
KeycloakClient strips realm path when realm URL lacks trailing slashTalvez já em andamento @aryarathoree assumiu há 3 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
microcks/microcks-cli#606 · 1 comentário ·
Mantenedores costumam responder em até 3 dias
-
Windows test failures in MockFileSystem.Walk due to path separatorTalvez já em andamento @dipak0000812 assumiu há 7 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
microcks/microcks-cli#601 · 1 comentário ·
Mantenedores costumam responder em até 3 dias
Todas as issues de microcks/microcks-cli
Issues semelhantes
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 80/100
-
/shutdown/ready can fail to return an HTTP response when readiness takes longer than the server write timeoutTalvez já em andamento @floriankoch assumiu hoje. Abertatriage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
envoyproxy/gateway#10562 ·
Mantenedores costumam responder em até 1 dia
-
Adding an LDAP group reports every search failure as "LDAP Group DN is not found"Talvez já em andamento @Daksha1611 assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100