bug: --filteredOperations fails on comma-separated list
Los mantenedores suelen responder en 3 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 65/100
Línea de trabajo
Empieza en pkg/connectors/microcks_client.go y lee ensureValidOperationsList; después, revisa la descripción de --filteredOperations en test.md y las pruebas unitarias relacionadas. Confirma que los valores separados por comas y una sola operación se recortan y se convierten, mientras que la entrada como array JSON sigue siendo compatible; el trabajo estará terminado cuando estos casos pasen y la CLI envíe la lista de operaciones esperada.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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!
- Lenguaje dominante
- Go
- Estrellas
- 59
- Forks
- 75
- Merge medio
- 7 d 12 h
- PR fusionados (30 d)
- 20
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microcks/microcks-cli
-
Logging into a locally started instance clears its container reference, causing stop to do nothingAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
microcks/microcks-cli#620 ·
Los mantenedores suelen responder en 3 días
-
WatchConfig.UpsertEntry silently deletes existing contexts when re-upserting a watched filePosiblemente ocupada @aryarathoree la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
microcks/microcks-cli#610 · 5 comentarios ·
Los mantenedores suelen responder en 3 días
-
bug: microcks test get swallows test failure details and operation results in text output modePosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
microcks/microcks-cli#608 · 2 comentarios ·
Los mantenedores suelen responder en 3 días
-
KeycloakClient strips realm path when realm URL lacks trailing slashPosiblemente ocupada @aryarathoree la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
microcks/microcks-cli#606 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
Windows test failures in MockFileSystem.Walk due to path separatorPosiblemente ocupada @dipak0000812 la tomó hace 7 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
microcks/microcks-cli#601 · 1 comentario ·
Los mantenedores suelen responder en 3 días
Todos los issues de microcks/microcks-cli
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
-
/shutdown/ready can fail to return an HTTP response when readiness takes longer than the server write timeoutPosiblemente ocupada @floriankoch la tomó hoy. Abiertotriage
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
envoyproxy/gateway#10562 ·
Los mantenedores suelen responder en 1 día
-
Adding an LDAP group reports every search failure as "LDAP Group DN is not found"Posiblemente ocupada @Daksha1611 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100