Skip to content

feat(vc): add +recording shortcut for meeting_id to minute_token conversion#246

Open
Ren1104 wants to merge 5 commits intomainfrom
feat/meeting-id-to-minute-token
Open

feat(vc): add +recording shortcut for meeting_id to minute_token conversion#246
Ren1104 wants to merge 5 commits intomainfrom
feat/meeting-id-to-minute-token

Conversation

@Ren1104
Copy link
Copy Markdown
Collaborator

@Ren1104 Ren1104 commented Apr 3, 2026

Summary

Add vc +recording shortcut that bridges VC and Minutes domains by converting meeting_id to minute_token via the recording API.

  • New vc +recording shortcut with --meeting-ids and --calendar-event-ids paths
  • Extract resolveMeetingIDsFromCalendarEvent shared function from vc_notes.go for reuse
  • Add skill reference doc and update SKILL.md with shortcuts/permissions/resource diagram

Changes

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 doc

Modified files

  • shortcuts/vc/vc_notes.go — extract resolveMeetingIDsFromCalendarEvent shared function (pure refactor, +notes behavior unchanged)
  • shortcuts/vc/shortcuts.go — register VCRecording
  • skills/lark-vc/SKILL.md — add +recording to shortcuts table, permissions table, resource diagram

API

GET /open-apis/vc/v1/meetings/{meeting_id}/recording → extract minute_token from recording URL

Test plan

  • Unit tests: extractMinuteToken (12 cases), resolveMeetingIDsFromCalendarEvent (3 cases)
  • Integration tests: fetchRecordingByMeetingID (4 cases), validation (3 cases), dry-run (3 cases)
  • All existing vc tests pass (zero regression)
  • go test ./... -race full project pass
  • golangci-lint incremental: 0 issues
  • Functional test: real API call with meeting_id 7624382238545480669 → minute_token obcns5675246n77gy7lw37o3

Summary by CodeRabbit

  • New Features

    • Added vc +recording command to fetch meeting recordings and extract minute tokens; supports --meeting-ids or --calendar-event-ids (mutually exclusive), batch limit 50, dry-run, progress output, and returns minute_token, recording_url, and duration. Added VCRecording to available shortcuts.
  • Bug Fixes

    • Improved calendar-event → meeting resolution with robust ID coercion and clearer error reporting when no meetings found.
  • Documentation

    • Added detailed skill docs and a recording reference with examples, permissions, and troubleshooting.
  • Tests

    • Added comprehensive tests for token extraction, validation, dry-run, API behaviors, calendar resolution, and mixed-success scenarios.

@github-actions github-actions bot added domain/vc PR touches the vc domain size/L Large or sensitive change across domains or core paths labels Apr 3, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 3, 2026

📝 Walkthrough

Walkthrough

Adds a new vc +recording shortcut that returns meeting recording info and extracts minute_token from recording URLs; supports mutually exclusive --meeting-ids or --calendar-event-ids modes, centralizes calendar-event→meeting resolution into a helper, and includes tests and documentation.

Changes

Cohort / File(s) Summary
Shortcut registry
shortcuts/vc/shortcuts.go
Registered the new VCRecording shortcut in the Shortcuts() list.
Calendar event resolution
shortcuts/vc/vc_notes.go
Added resolveMeetingIDsFromCalendarEvent(runtime, instanceID, calendarID) ([]string, error) to centralize relation-info calls and meeting ID coercion; helper now returns errors on failure and no longer requests note fields.
VC recording feature
shortcuts/vc/vc_recording.go
New vc +recording shortcut (VCRecording) with flags --meeting-ids / --calendar-event-ids, validation (mutual exclusivity, ≤50 IDs, scope checks), dry-run steps, sequential execution with progress, recording fetch, minute_token extraction from /minutes/{token} URLs, per-item results and errors.
Unit & integration tests
shortcuts/vc/vc_recording_test.go
Added extensive tests covering token extraction, argument validation, dry-run outputs, recording fetch behaviors, calendar→meeting resolution, partial failures, and execution flows using HTTP stubs and bot wrapper.
Skill docs
skills/lark-vc/SKILL.md
Documented the +recording shortcut and added permission entries for both input modes.
Reference guide
skills/lark-vc/references/lark-vc-recording.md
New reference doc describing command usage, input modes, output schema (recordings array with meeting_id, minute_token, recording_url, duration), permissions, examples, and troubleshooting.

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)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested reviewers

  • liangshuo-1

Poem

🐰 I hopped through code to fetch a token bright,
From events to meetings, I searched by night,
Two flags, one choice — pick a single trail,
Tests clap their paws and docs wag their tail,
Minute tokens found, the rabbit nibbles delight.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 44.44% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately and concisely describes the main change: adding a new +recording shortcut that converts meeting_id to minute_token.
Description check ✅ Passed The PR description comprehensively covers all required template sections with clear summaries, detailed change lists, API details, and a thorough test plan with checkmarks confirming verification.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 feat/meeting-id-to-minute-token

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

@Ren1104 Ren1104 added size/M Single-domain feat or fix with limited business impact and removed size/L Large or sensitive change across domains or core paths labels Apr 3, 2026
@github-actions github-actions bot added size/L Large or sensitive change across domains or core paths and removed size/M Single-domain feat or fix with limited business impact labels Apr 3, 2026
@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Apr 3, 2026

Greptile Summary

Adds vc +recording shortcut that converts meeting_idminute_token via the recording API, supporting both --meeting-ids and --calendar-event-ids paths with batch processing and partial-failure handling. The refactoring of resolveMeetingIDsFromCalendarEvent into a shared helper (with the note-specific API flags removed) is clean and keeps both callers in sync.

Confidence Score: 5/5

Safe 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

Filename Overview
shortcuts/vc/vc_recording.go New +recording shortcut: fetches recording info via meeting ID or calendar-event path, extracts minute_token from URL, handles batch + partial failures cleanly; no bugs found.
shortcuts/vc/vc_notes.go Pure refactor: extracts resolveMeetingIDsFromCalendarEvent as a shared function, removes note-specific API flags, updates fetchNoteByCalendarEventID to delegate to it; behavior unchanged.
shortcuts/vc/vc_recording_test.go Comprehensive tests covering extractMinuteToken (12 cases), validation, dry-run, fetchRecordingByMeetingID, and resolveMeetingIDsFromCalendarEvent; two Chinese inline comments remain in an otherwise English test file.
shortcuts/vc/shortcuts.go One-line change registering VCRecording in the shortcuts list.

Sequence Diagram

sequenceDiagram
    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
Loading

Reviews (4): Last reviewed commit: "test(vc): add integration eval for +reco..." | Re-trigger Greptile

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
shortcuts/vc/vc_recording.go (1)

218-241: Consider including calendar_event_id in table output for the calendar-event-ids path.

When using --calendar-event-ids, failed results (Line 182, 198) include calendar_event_id but the table rendering (Line 223-224) only extracts meeting_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

📥 Commits

Reviewing files that changed from the base of the PR and between 8425898 and e86dde5.

📒 Files selected for processing (6)
  • shortcuts/vc/shortcuts.go
  • shortcuts/vc/vc_notes.go
  • shortcuts/vc/vc_recording.go
  • shortcuts/vc/vc_recording_test.go
  • skills/lark-vc/SKILL.md
  • skills/lark-vc/references/lark-vc-recording.md

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2026

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@7a813db6c03adc02338e04fc8b05cb72fce48708

🧩 Skill update

npx skills add larksuite/cli#feat/meeting-id-to-minute-token -y -g

@Ren1104 Ren1104 requested a review from zhaoleibd April 3, 2026 07:30
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 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

📥 Commits

Reviewing files that changed from the base of the PR and between ef32e27 and 7a813db.

📒 Files selected for processing (1)
  • shortcuts/vc/vc_recording_test.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/vc PR touches the vc domain size/L Large or sensitive change across domains or core paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants