feat(vc): add +recording shortcut for meeting_id to minute_token conversion#246
feat(vc): add +recording shortcut for meeting_id to minute_token conversion#246
Conversation
📝 WalkthroughWalkthroughAdds a new Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client/CLI
participant Validator as Validator
participant Calendar as Calendar API
participant VCApi as VC Recording API
Client->>Validator: vc +recording (--meeting-ids | --calendar-event-ids)
Validator->>Validator: validate flags (mutual exclusivity, ≤50) and scopes
alt using --meeting-ids
loop per meeting_id
Validator->>VCApi: GET recording by meeting_id
VCApi-->>Validator: recording metadata + URL
Validator->>Validator: extract minute_token from /minutes/{token}
end
else using --calendar-event-ids
loop per calendar_event_id
Validator->>Calendar: resolve event -> meeting_instance_ids
Calendar-->>Validator: list of meeting_ids
loop per resolved meeting_id
Validator->>VCApi: GET recording by meeting_id
VCApi-->>Validator: recording metadata + URL
Validator->>Validator: extract minute_token if present
end
end
end
Validator-->>Client: aggregated results (per-item status, minute_token/duration or error)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Greptile SummaryAdds Confidence Score: 5/5Safe to merge — no P0/P1 issues; only a minor Chinese comment in the test file remains. All previously raised concerns (note-specific flags, table row blank meeting_id, Chinese comment in vc_notes.go) are resolved. The single remaining finding is a P2 style nit (Chinese comments in the test file). Logic, error handling, scope checks, and the shared-function refactor are all correct. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant CLI as lark-cli
participant VC as VC API
participant CAL as Calendar API
alt --meeting-ids path
CLI->>VC: GET /vc/v1/meetings/{meeting_id}/recording
VC-->>CLI: recording { url, duration }
CLI->>CLI: extractMinuteToken(url)
CLI-->>CLI: minute_token
else --calendar-event-ids path
CLI->>CAL: POST /calendar/v4/calendars/primary
CAL-->>CLI: calendar_id
CLI->>CAL: POST mget_instance_relation_info
CAL-->>CLI: meeting_instance_ids[]
loop try each meeting_id until recording found
CLI->>VC: GET /vc/v1/meetings/{meeting_id}/recording
VC-->>CLI: recording { url, duration }
end
CLI->>CLI: extractMinuteToken(url)
CLI-->>CLI: minute_token + calendar_event_id
end
Reviews (4): Last reviewed commit: "test(vc): add integration eval for +reco..." | Re-trigger Greptile |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
shortcuts/vc/vc_recording.go (1)
218-241: Consider includingcalendar_event_idin table output for the calendar-event-ids path.When using
--calendar-event-ids, failed results (Line 182, 198) includecalendar_event_idbut the table rendering (Line 223-224) only extractsmeeting_id, which will be empty for resolution failures. This could make it harder to identify which calendar event failed.♻️ Optional enhancement to show calendar_event_id in table
for _, r := range results { m, _ := r.(map[string]any) meetingID, _ := m["meeting_id"].(string) - row := map[string]interface{}{"meeting_id": meetingID} + row := map[string]interface{}{} + if meetingID != "" { + row["meeting_id"] = meetingID + } + if calEventID, _ := m["calendar_event_id"].(string); calEventID != "" { + row["calendar_event_id"] = calEventID + } if errMsg, _ := m["error"].(string); errMsg != "" {🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@shortcuts/vc/vc_recording.go` around lines 218 - 241, The table output omits calendar_event_id so failures from the calendar-event-ids path are hard to trace; update the rows construction inside the runtime.OutFormat lambda (where results are iterated, and rows are built for output.PrintTable) to extract "calendar_event_id" from each result (like you already extract "meeting_id") and include it in the row map for both error and success branches so the printed table shows calendar_event_id when present; ensure you reference the same variables (results, row, successCount) so counts remain correct and output.PrintTable prints the new field.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@shortcuts/vc/vc_recording.go`:
- Around line 218-241: The table output omits calendar_event_id so failures from
the calendar-event-ids path are hard to trace; update the rows construction
inside the runtime.OutFormat lambda (where results are iterated, and rows are
built for output.PrintTable) to extract "calendar_event_id" from each result
(like you already extract "meeting_id") and include it in the row map for both
error and success branches so the printed table shows calendar_event_id when
present; ensure you reference the same variables (results, row, successCount) so
counts remain correct and output.PrintTable prints the new field.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ffb61914-5f3c-4f2b-a112-bc596a968a06
📒 Files selected for processing (6)
shortcuts/vc/shortcuts.goshortcuts/vc/vc_notes.goshortcuts/vc/vc_recording.goshortcuts/vc/vc_recording_test.goskills/lark-vc/SKILL.mdskills/lark-vc/references/lark-vc-recording.md
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@7a813db6c03adc02338e04fc8b05cb72fce48708🧩 Skill updatenpx skills add larksuite/cli#feat/meeting-id-to-minute-token -y -g |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
shortcuts/vc/vc_recording_test.go (1)
59-69: Use English comments for consistency.Lines 59 and 65 contain Chinese comments. For an open-source project, consider using English comments for better accessibility and consistency with the rest of the codebase.
📝 Suggested changes
- // 没传任何 flag + // No flags provided err := mountAndRun(t, VCRecording, []string{"+recording", "--as", "user"}, f, nil) if err == nil { t.Fatal("expected validation error for no flags") } - // 两个 flag 都传了 + // Both flags provided err = mountAndRun(t, VCRecording, []string{"+recording", "--meeting-ids", "m1", "--calendar-event-ids", "e1", "--as", "user"}, f, nil)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@shortcuts/vc/vc_recording_test.go` around lines 59 - 69, Replace the Chinese inline comments in vc_recording_test.go with English equivalents to match project conventions: update the two comment lines above the mountAndRun calls (the ones describing "no flags passed" and "both flags passed") to clear English phrases (e.g., "no flags provided" and "both flags provided") while leaving the test logic and references to mountAndRun and VCRecording unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@shortcuts/vc/vc_recording_test.go`:
- Around line 59-69: Replace the Chinese inline comments in vc_recording_test.go
with English equivalents to match project conventions: update the two comment
lines above the mountAndRun calls (the ones describing "no flags passed" and
"both flags passed") to clear English phrases (e.g., "no flags provided" and
"both flags provided") while leaving the test logic and references to
mountAndRun and VCRecording unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: fe4ae91e-bb6f-4085-8822-9d55c1dcacd4
📒 Files selected for processing (1)
shortcuts/vc/vc_recording_test.go
Summary
Add
vc +recordingshortcut that bridges VC and Minutes domains by convertingmeeting_idtominute_tokenvia the recording API.vc +recordingshortcut with--meeting-idsand--calendar-event-idspathsresolveMeetingIDsFromCalendarEventshared function fromvc_notes.gofor reuseChanges
New files
shortcuts/vc/vc_recording.go— +recording shortcut implementation (~170 lines)shortcuts/vc/vc_recording_test.go— 25 test cases (unit + integration)skills/lark-vc/references/lark-vc-recording.md— skill reference docModified files
shortcuts/vc/vc_notes.go— extractresolveMeetingIDsFromCalendarEventshared function (pure refactor, +notes behavior unchanged)shortcuts/vc/shortcuts.go— registerVCRecordingskills/lark-vc/SKILL.md— add +recording to shortcuts table, permissions table, resource diagramAPI
GET /open-apis/vc/v1/meetings/{meeting_id}/recording→ extractminute_tokenfrom recording URLTest plan
extractMinuteToken(12 cases),resolveMeetingIDsFromCalendarEvent(3 cases)fetchRecordingByMeetingID(4 cases), validation (3 cases), dry-run (3 cases)go test ./... -racefull project passgolangci-lintincremental: 0 issues7624382238545480669→ minute_tokenobcns5675246n77gy7lw37o3Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests