feat(calendar): auto-add bot self as attendee and note user-only search - #1991
Conversation
📝 WalkthroughWalkthroughChangesThe calendar create flow resolves the running identity’s OpenID for attendee inclusion, handles bot lookup failures without aborting creation, updates dry-run guidance, adds bot-path tests, and documents bot identity limitations in user search. Calendar bot attendee flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Execute
participant selfAttendeeId
participant BotInfoAPI
participant parseAttendees
participant AttendeesAPI
Execute->>selfAttendeeId: resolve running identity OpenID
selfAttendeeId->>BotInfoAPI: request bot information
BotInfoAPI-->>selfAttendeeId: return OpenID or failure
selfAttendeeId-->>Execute: return OpenID or empty value
Execute->>parseAttendees: pass self attendee ID
parseAttendees->>AttendeesAPI: submit attendee OpenIDs
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 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 |
When creating an event as a bot, resolve the bot's own open_id via /bot/v3/info and add it to the attendee list, mirroring how a user is auto-joined to their own events; warn and proceed without it if the lookup fails. Also note in the +create skill doc that the user-search API is user-only, so resolving a name to open_id needs --as user.
2f093ae to
5dabb57
Compare
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@5dabb57e13ed3494c3f873b09887016db29c7686🧩 Skill updatenpx skills add larksuite/cli#docs/calendar-create-bot-search-note -y -g |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1991 +/- ##
=======================================
Coverage 75.05% 75.05%
=======================================
Files 901 901
Lines 95391 95399 +8
=======================================
+ Hits 71591 71599 +8
Misses 18307 18307
Partials 5493 5493 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/calendar/calendar_test.go`:
- Around line 254-255: Isolate configuration state in both affected tests by
setting LARKSUITE_CLI_CONFIG_DIR to t.TempDir() immediately before each
cmdutil.TestFactory call: shortcuts/calendar/calendar_test.go lines 254-255 and
321-322. No other changes are needed.
🪄 Autofix (Beta)
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
Run ID: b7077d03-3f36-46f1-b051-2eb1d1f8f0b7
📒 Files selected for processing (3)
shortcuts/calendar/calendar_create.goshortcuts/calendar/calendar_test.goskills/lark-calendar/references/lark-calendar-create.md
Summary
Auto-add the bot itself as an attendee when creating an event as a bot, and document that user search is user-only.
Changes
+createskill doc that the user-search API requires--as user.Test Plan
lark-cli calendar +createflow works as expectedRelated Issues
Summary by CodeRabbit
New Features
Bug Fixes
Documentation