fix(calendar): support all-day event creation#1603
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthrough
ChangesCalendar all-day create support
Sequence Diagram(s)sequenceDiagram
participant CalendarCreate
participant buildCalendarCreateEventData
participant calendarEventsCreate
CalendarCreate->>buildCalendarCreateEventData: build payload from --all-day, --start, --end
buildCalendarCreateEventData-->>CalendarCreate: eventData or validation error
CalendarCreate->>calendarEventsCreate: POST create event request
calendarEventsCreate-->>CalendarCreate: response
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
shortcuts/calendar/calendar_create.go (1)
145-152: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winUpdate the CLI help text for
--start/--endnow that--all-dayexists.
--all-dayis documented here, but the adjacent--startand--endflag descriptions still say ISO 8601 only.calendar +create --helpwill therefore contradict the new validation path that requiresYYYY-MM-DDin all-day mode.🤖 Prompt for 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. In `@shortcuts/calendar/calendar_create.go` around lines 145 - 152, Update the CLI help text in the calendar create command so the `start` and `end` flag descriptions reflect the `all-day` mode added alongside them. In `calendar_create.go`, adjust the flag metadata for the `start` and `end` entries used by the create command so their descriptions mention ISO 8601 for normal events and YYYY-MM-DD when `all-day` is enabled, keeping the help text consistent with the validation logic and the `all-day` flag documentation.
🤖 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 269-326: Add a positive all-day create test for the allowed
single-day case where start equals end, since
TestCreate_AllDayValidationTypedErrors only covers rejection paths. Extend the
calendar create test coverage around CalendarCreate/mountAndRun to assert that
an all-day event with identical --start and --end succeeds, so a regression that
re-rejects end == start will fail.
---
Outside diff comments:
In `@shortcuts/calendar/calendar_create.go`:
- Around line 145-152: Update the CLI help text in the calendar create command
so the `start` and `end` flag descriptions reflect the `all-day` mode added
alongside them. In `calendar_create.go`, adjust the flag metadata for the
`start` and `end` entries used by the create command so their descriptions
mention ISO 8601 for normal events and YYYY-MM-DD when `all-day` is enabled,
keeping the help text consistent with the validation logic and the `all-day`
flag documentation.
🪄 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: 5720233c-9079-4fd1-b168-74c071d7add8
📒 Files selected for processing (6)
shortcuts/calendar/calendar_create.goshortcuts/calendar/calendar_test.goskills/lark-calendar/SKILL.mdskills/lark-calendar/references/lark-calendar-create.mdtests/cli_e2e/calendar/calendar_create_dryrun_test.gotests/cli_e2e/calendar/coverage.md
|
Addressed CodeRabbit follow-ups in e911063: updated the --start/--end CLI help text to mention YYYY-MM-DD with --all-day, and added positive coverage for a single-day all-day event where start equals end. |
Summary
Adds
--all-daysupport tocalendar +createso the shortcut can create true date-based all-day events instead of timestamp-only events.Changes
--all-daytocalendar +create.--start/--endasYYYY-MM-DD, including single-day events where start equals end.start_time.date/end_time.datefor all-day events, withfree_busy_status: freeandvchat.vc_type: no_meeting.Test Plan
GOPROXY=https://goproxy.cn,direct go test ./shortcuts/calendar -count=1GOPROXY=https://goproxy.cn,direct go test ./shortcuts/calendar -run 'TestCreate_AllDay|TestBuildEventData_DefaultVChat|TestCreate_CreateEventOnly' -count=1LARK_CLI_BIN=/Users/xu/Documents/Codex/2026-06-24/ba/work/larksuite-cli-862/lark-cli GOPROXY=https://goproxy.cn,direct go test ./tests/cli_e2e/calendar -run TestCalendar_CreateAllDayDryRun -count=1gofmt -l shortcuts/calendar/calendar_create.go shortcuts/calendar/calendar_test.go tests/cli_e2e/calendar/calendar_create_dryrun_test.gogit diff --checkRelated Issues
Summary by CodeRabbit
New Features
calendar +create --all-dayto create all-day events.YYYY-MM-DDstart/end (date fields) and apply all-day defaults (free/busy and video-meeting disabled).Bug Fixes
--all-daydate format and ensures the end date is on/after the start date.Documentation
--all-day.