bug: --filteredOperations fails on comma-separated list
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
pkg/connectors/microcks_client.goから始めてensureValidOperationsListを読み、その後、test.mdにある--filteredOperationsの説明と関連するユニットテストを確認してください。カンマ区切りの値と単一の操作がトリミングされて変換される一方で、JSON配列入力も引き続きサポートされることを確認してください。これらのケースが通り、CLIが期待される操作リストを送信すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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!
- 主要言語
- Go
- スター
- 59
- フォーク
- 75
- 平均マージ
- 7日 12時間
- マージ済み PR(30日)
- 20
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microcks/microcks-cli のほかの issue
-
Logging into a locally started instance clears its container reference, causing stop to do nothingオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
microcks/microcks-cli#620 ·
メンテナーはふだん 3 日以内に返信
-
WatchConfig.UpsertEntry silently deletes existing contexts when re-upserting a watched file対応中かも @aryarathoree が 3 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
microcks/microcks-cli#610 · コメント 5 件 ·
メンテナーはふだん 3 日以内に返信
-
bug: microcks test get swallows test failure details and operation results in text output mode対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
microcks/microcks-cli#608 · コメント 2 件 ·
メンテナーはふだん 3 日以内に返信
-
KeycloakClient strips realm path when realm URL lacks trailing slash対応中かも @aryarathoree が 3 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
microcks/microcks-cli#606 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
Windows test failures in MockFileSystem.Walk due to path separator対応中かも @dipak0000812 が 7 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
microcks/microcks-cli#601 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
microcks/microcks-cli の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
-
/shutdown/ready can fail to return an HTTP response when readiness takes longer than the server write timeout対応中かも @floriankoch が今日担当しました。 オープンtriage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
envoyproxy/gateway#10562 ·
メンテナーはふだん 1 日以内に返信
-
Adding an LDAP group reports every search failure as "LDAP Group DN is not found"対応中かも @Daksha1611 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100