docs: 全 JSON 入力コマンドのヘルプを改善#72
Conversation
- description に JSON payload example を追加 - examples にインライン JSON・stdin pipe・interactive mode の具体例を追加 - 対象: entities, subscriptions, registrations, batch, attrs, temporal, models, rules, admin tenants/users/policies/oauth-clients/cadde
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthrough複数のCLIコマンドのヘルプと使用例を拡張し、JSONペイロードのインライン・ファイル・stdin・対話モード例を追加。CHANGELOGにv0.6.2を追記。e2eヘルパーのperformLoginにリトライと/token検証を追加し、テストDBのcleanupでコレクションをdropせず特定データコレクションを Changes
Sequence Diagram(s)sequenceDiagram
participant TestRunner as Test Runner
participant AuthAPI as Auth API
participant MeAPI as /me Endpoint
participant FS as Config File
Note over TestRunner,AuthAPI: performLogin開始(最大3回リトライ、バックオフ)
TestRunner->>AuthAPI: POST /login (credentials)
alt login成功
AuthAPI-->>TestRunner: token (+ refreshToken)
TestRunner->>MeAPI: GET /me (verify token)
alt token検証成功
MeAPI-->>TestRunner: 200 OK
TestRunner->>FS: write profile config (token, refreshToken?)
TestRunner-->>TestRunner: return profile
else token検証失敗
MeAPI-->>TestRunner: error
TestRunner-->>AuthAPI: retry (backoff)
end
else login失敗
AuthAPI-->>TestRunner: error
TestRunner-->>AuthAPI: retry (backoff)
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
DB クリーンアップ後にサーバーが admin user を再生成するまでの レースコンディションで whoami テストがフレーキーに失敗していた。 performLogin に最大3回リトライと /me でのトークン検証を追加。
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/e2e/support/world.ts`:
- Around line 115-143: The retry loop around the login + token verification
should wrap each attempt in a try-catch so network/JSON errors don’t abort
retries: inside the for loop (the logic that builds loginUrl, calls fetch with
TEST_EMAIL/TEST_PASSWORD, awaits res.json() to extract token, then calls /me
using meUrl), enclose that entire per-attempt sequence in a try block and in the
catch set lastError to the caught Error (or new Error with message + err) and
continue to the next attempt; ensure you still set lastError and continue on
non-ok responses (the existing checks for res.ok and meRes.ok remain) so any
thrown exceptions from fetch or res.json() are captured and allow the loop to
retry.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 23b583f9-57ab-4e07-b047-770e455cd149
📒 Files selected for processing (2)
CHANGELOG.mdtests/e2e/support/world.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- CHANGELOG.md
コレクション drop はサーバーのインメモリ状態と不整合を起こし、 直後の /me 呼び出しが 401 を返すフレーキーテストの原因になっていた。 deleteMany でドキュメントのみクリアし、コレクション構造を保持する。
- users コレクションを deleteMany から除外し、サーバーの ユーザーキャッシュとDBの不整合を防止 - performLogin のリトライループを try-catch で保護し、 fetch/json 例外時もリトライが継続するよう修正
ブロックリストではなくホワイトリスト方式に変更。 entities, subscriptions 等のデータコレクションのみクリアし、 auth 関連コレクション(users, tenants, policies 等)を保持する。
- hooks.ts を元の drop() 方式に戻す(DB cleanup は原因ではなかった) - performLogin から /me 検証を除去(サーバー側の一時的な 401 が原因) - performLogin のリトライ + try-catch は維持 - cucumber retry を 1 → 2 に引き上げ(サーバー内部の一時的な不整合を吸収)
Summary
--helpを改善@file・stdin pipe・interactive mode の具体例を追加Test plan
npm run lintパスnpm run typecheckパスnpm test全 624 テストパスgeonic help <command> createで各コマンドのヘルプ出力を確認Summary by CodeRabbit