Skip to content

feat(calendar): auto-add bot self as attendee and note user-only search - #1991

Merged
calendar-assistant merged 1 commit into
mainfrom
docs/calendar-create-bot-search-note
Jul 22, 2026
Merged

feat(calendar): auto-add bot self as attendee and note user-only search#1991
calendar-assistant merged 1 commit into
mainfrom
docs/calendar-create-bot-search-note

Conversation

@calendar-assistant

@calendar-assistant calendar-assistant commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

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

  • Add the bot's own open_id to the attendee list on bot-identity event creation.
  • Add tests for the bot auto-join path and its fallback.
  • Note in the +create skill doc that the user-search API requires --as user.

Test Plan

  • Unit tests pass
  • Manual local verification confirms the lark-cli calendar +create flow works as expected

Related Issues

  • None

Summary by CodeRabbit

  • New Features

    • Calendar events created by bots now automatically include the bot as an attendee when identity information is available.
    • Events still create successfully if bot identity lookup fails, while retaining explicitly provided attendees.
  • Bug Fixes

    • Improved consistency of self-attendee handling for user and bot event creation.
  • Documentation

    • Clarified that searching for users does not support bot identities and must be performed as a user.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

The 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

Layer / File(s) Summary
Resolve and pass self attendee identity
shortcuts/calendar/calendar_create.go, skills/lark-calendar/references/lark-calendar-create.md
User and bot identities are resolved for attendee parsing; dry-run guidance and bot identity documentation are updated.
Validate bot attendee outcomes
shortcuts/calendar/calendar_test.go
Tests verify bot self-attendee inclusion on successful lookup and continued creation without it when lookup fails.

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
Loading

Possibly related PRs

  • larksuite/cli#245: Both changes modify calendar creation’s bot-identity behavior.

Suggested reviewers: liangshuo-1

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: auto-adding the bot as an attendee and noting the user-only search limitation.
Description check ✅ Passed The description follows the template with summary, changes, test plan, and related issues, and is mostly complete.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/calendar-create-bot-search-note

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added domain/calendar PR touches the calendar domain size/M Single-domain feat or fix with limited business impact labels Jul 21, 2026
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.
@calendar-assistant
calendar-assistant force-pushed the docs/calendar-create-bot-search-note branch from 2f093ae to 5dabb57 Compare July 21, 2026 13:16
@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@5dabb57e13ed3494c3f873b09887016db29c7686

🧩 Skill update

npx skills add larksuite/cli#docs/calendar-create-bot-search-note -y -g

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.05%. Comparing base (6675e3c) to head (5dabb57).
⚠️ Report is 5 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 12ca42c and 2f093ae.

📒 Files selected for processing (3)
  • shortcuts/calendar/calendar_create.go
  • shortcuts/calendar/calendar_test.go
  • skills/lark-calendar/references/lark-calendar-create.md

Comment thread shortcuts/calendar/calendar_test.go
@calendar-assistant
calendar-assistant merged commit fc2761d into main Jul 22, 2026
45 checks passed
@calendar-assistant
calendar-assistant deleted the docs/calendar-create-bot-search-note branch July 22, 2026 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/calendar PR touches the calendar domain size/M Single-domain feat or fix with limited business impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants