feat: support bot identity - #2278
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughMinutes, note, and VC shortcuts now support bot authentication where applicable. VC recording scope checks resolve tokens for the active identity. Tests and documentation describe the new identity behavior. ChangesShortcut authentication and validation
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant CLI
participant Shortcut
participant Credential
participant API
CLI->>Shortcut: Run command with --as bot
Shortcut->>Credential: Resolve token for active identity
Credential-->>Shortcut: Return bot token and scopes
Shortcut->>API: Send request or dry-run request
API-->>Shortcut: Return response or validation result
Shortcut-->>CLI: Render command result
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
69d6c51 to
f1cf9a8
Compare
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@986363523619f6d8fe9bea826096c32cfe0d5fd8🧩 Skill updatenpx skills add larksuite/cli#feat/support_bot_identity -y -g |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@shortcuts/vc/bot_identity_test.go`:
- Around line 121-129: Update recordingIdentityTokenResolver to record the
requested token type in req.Type, then assert after mountAndRun that it equals
credential.TokenTypeTAT. Keep the existing error assertion and ensure the test
directly verifies tenant-token preflight resolution.
In `@shortcuts/vc/vc_recording.go`:
- Around line 120-127: The missing-scope error handling around runtime.As() must
not suggest lark-cli auth login when the identity is bot. Use a bot-specific
app-scope hint for bot credentials, while preserving the existing user-login
hint for non-bot identities.
In `@skills/lark-minutes/SKILL.md`:
- Line 23: Update the command identity guidance in SKILL.md to include
+apply-permission alongside +detail and +download as supporting --as bot, while
preserving the default --as user behavior and existing bot permission
limitation.
In `@skills/lark-vc/SKILL.md`:
- Line 23: 更新 lark-vc skill 中的 bot 支持命令说明:将 +detail、+notes 和 +recording 加入支持
--as bot 的列表,并将 +search 的 Markdown 反引号标记修正为有效格式;保留现有 meeting-events 和
meeting-message-send 必须沿用 meeting_id 来源身份的说明。
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: b4987ed4-c908-4afd-84cb-23ff20971ded
📒 Files selected for processing (21)
shortcuts/minutes/bot_identity_test.goshortcuts/minutes/minutes_apply_permission.goshortcuts/minutes/minutes_detail.goshortcuts/note/note_detail.goshortcuts/note/note_test.goshortcuts/vc/bot_identity_test.goshortcuts/vc/vc_detail.goshortcuts/vc/vc_notes.goshortcuts/vc/vc_recording.goshortcuts/vc/vc_recording_test.goskills/lark-minutes/SKILL.mdskills/lark-note/SKILL.mdskills/lark-note/references/lark-note-detail.mdskills/lark-vc/SKILL.mdskills/lark-vc/references/lark-vc-recording.mdtests/cli_e2e/minutes/minutes_apply_permission_test.gotests/cli_e2e/minutes/minutes_detail_dryrun_test.gotests/cli_e2e/note/coverage.mdtests/cli_e2e/note/note_dryrun_test.gotests/cli_e2e/vc/vc_detail_dryrun_test.gotests/cli_e2e/vc/vc_recording_dryrun_test.go
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (25.00%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #2278 +/- ##
==========================================
- Coverage 76.44% 76.44% -0.01%
==========================================
Files 1013 1013
Lines 111957 111969 +12
==========================================
+ Hits 85588 85594 +6
- Misses 19859 19863 +4
- Partials 6510 6512 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
f1cf9a8 to
9863635
Compare
Summary
Changes
Test Plan
lark-cli <domain> <command>flow works as expectedRelated Issues
Summary by CodeRabbit
New Features
Documentation
Tests