docs(me api-keys / me oauth-clients): hint --policy (create) vs --policy-id (update) asymmetry#121
Merged
miya0001 merged 3 commits intoMay 11, 2026
Conversation
…icy-id (update) asymmetry `me api-keys` と `me oauth-clients` では create のフラグが `--policy`、update のフラグが `--policy-id` で命名が非対称になっており、ユーザーが詰まる原因になっている。`admin api-keys` は create / update 両方とも `--policy` で対称なので、`me` 系だけ非対称が残っている形。 命名統一 (alias 追加) は破壊的影響の検討が要るため別 issue で扱い、本 PR ではヘルプとドキュメントで明示的に案内するに留める。 修正: - `src/commands/me-api-keys.ts`: - L104 (create の `--policy`): description に `(NOTE: use --policy-id on update)` を追記 - L249 (update の `--policy-id`): description に `(NOTE: use --policy on create)` を追記 - `src/commands/me-oauth-clients.ts`: 上と同様に L51 / L150 を修正 - `README.md`: `me api-keys` / `me oauth-clients` セクションに「Note on flag naming」を追加 (L231 / L271 相当) 回帰防止としてユニットテストを追加 (`tests/me-api-keys.test.ts`, `tests/me-oauth-clients.test.ts`): - create の `--policy` option description が `--policy-id` と `update` を含む文字列であること - update の `--policy-id` option description が `--policy` と `create` を含む文字列であること 実装変更前にテストを追加して 4 件 red 確認 → ヘルプ description 修正で green。lint / typecheck / 全 35 spec / 737 tests いずれも pass。 Closes geolonia#119
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughこのプルリクエストは、 ChangesCLI フラグ命名の非対称性の明確化
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…-flag-asymmetry # Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
me api-keysとme oauth-clientsでは create のフラグが--policy、update のフラグが--policy-idという命名非対称になっており、ユーザーが詰まる原因になっている (admin api-keysは両方--policyで対称)。命名統一 (alias 追加) は破壊的影響の検討が要るため本 PR では扱わず、ヘルプ description と README で明示的に案内するに留める。Closes #119
Changes
src/commands/me-api-keys.ts:--policy): description に(NOTE: use --policy-id on update)を追記--policy-id): description に(NOTE: use --policy on create)を追記src/commands/me-oauth-clients.ts: 同様に L51 / L150 を修正README.md:me api-keys/me oauth-clientsセクションに「Note on flag naming」を追加 (admin api-keysは両方--policyで対称、という対比情報も含めた)tests/me-api-keys.test.ts/tests/me-oauth-clients.test.ts: 回帰防止のユニットテストを 4 件追加CHANGELOG.md:[Unreleased]に Docs エントリ追加TDD
実装変更前にテストを追加して red 確認 → 修正で green、の手順:
Test plan
npm test全 35 spec / 737 tests passnpm run lintcleannpm run typecheckcleanOut of scope
--policy/--policy-idの alias 追加 (= 長期的にadmin系と一貫性を取る) は別 issue で議論する想定。本 PR はあくまでヘルプとドキュメントの案内強化にとどめる。Summary by CodeRabbit
リリースノート
ドキュメント
--policyvs--policy-id)の使い分けを明確化しました。バグ修正
tenantIdからprimaryTenantIdに修正しました。