Skip to content

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

Open
Ren1104 wants to merge 7 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 7 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 a vc +recording command to fetch meeting recordings, extract minute tokens, support --meeting-ids or --calendar-event-ids (mutually exclusive), batch limit 50, dry-run, progress output, and aggregate per-item results. VCRecording added to shortcuts.
  • Bug Fixes

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

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

    • Added extensive tests covering parsing, 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

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a new vc +recording shortcut that queries 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 adds tests and docs.

Changes

Cohort / File(s) Summary
Shortcut registry
shortcuts/vc/shortcuts.go
Registered new VCRecording in Shortcuts() so the recording shortcut is exposed.
Calendar event resolution
shortcuts/vc/vc_notes.go
Added resolveMeetingIDsFromCalendarEvent(runtime, instanceID, calendarID) ([]string, error) to centralize relation-info calls and coerce meeting_instance_ids to []string; 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) implementing flags --meeting-ids / --calendar-event-ids (mutually exclusive, ≤50), scope checks, dry-run steps, sequential execution with progress, recording fetch by meeting, and minute_token extraction from /minutes/{token} URLs. Per-item results include recording_url, duration, optionally minute_token, or per-item errors.
Tests
shortcuts/vc/vc_recording_test.go
Comprehensive tests added: token extraction, arg validation, dry-run, recording fetch behaviors, calendar→meeting resolution, partial failures, and end-to-end executions using HTTP stubs and bot wrapper.
Skill docs
skills/lark-vc/SKILL.md
Documented +recording shortcut and added permissions rows for both input modes.
Reference guide
skills/lark-vc/references/lark-vc-recording.md
New reference doc describing usage, inputs, outputs (recordings array with meeting_id, minute_token, recording_url, duration), examples, permissions, and troubleshooting.

Sequence Diagram(s)

sequenceDiagram
    participant CLI as Client/CLI
    participant Validator as Validator
    participant Calendar as Calendar API
    participant VCApi as VC Recording API

    CLI->>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 /vc/meeting/recording?meeting_id={id}
            VCApi-->>Validator: recording metadata + URL / error
            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 (or error)
            loop per resolved meeting_id
                Validator->>VCApi: GET recording by meeting_id
                VCApi-->>Validator: recording metadata + URL / error
                Validator->>Validator: extract minute_token if present
            end
        end
    end

    Validator-->>CLI: 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,
One flag or the other, pick a single trail,
Tests stamp their feet and docs wag their tail,
Minute tokens found — the rabbit sings, "Hooray!"

🚥 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 title directly and clearly describes the main feature added: a new vc +recording shortcut that performs meeting_id to minute_token conversion via the recording API.
Description check ✅ Passed The description covers all required template sections: Summary explains motivation, Changes lists all modifications, and Test Plan documents verification steps with checkmarks indicating completion.

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

✨ Finishing Touches
🧪 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

This PR adds a vc +recording shortcut that queries the Lark recording API and extracts minute_token from the recording URL, supporting both --meeting-ids and --calendar-event-ids input paths. It also cleanly refactors resolveMeetingIDsFromCalendarEvent into a shared function consumed by both +notes and +recording. All previously identified P0/P1 issues (domain-specific flags, empty meeting_id column for calendar-event-id error rows, Chinese inline comment, all-nil IDs edge case) were addressed in 015c11e prior to this review round.

Confidence Score: 5/5

Safe to merge — all prior P0/P1 findings have been resolved and no new defects were found

All previously identified issues (domain flags, empty table column, Chinese comment, nil-IDs edge case) were addressed before this review round. The only remaining finding is two Chinese inline comments in the new test file — a P2 style nit that does not affect correctness or reliability.

No files require special attention; vc_recording_test.go has two minor Chinese comments

Important Files Changed

Filename Overview
shortcuts/vc/vc_recording.go New +recording shortcut: clean implementation following VCNotes patterns, both paths well-handled, previous review concerns resolved
shortcuts/vc/vc_notes.go Pure refactor extracting resolveMeetingIDsFromCalendarEvent; domain-specific flags removed, English comment restored, no behavioral change to +notes
shortcuts/vc/vc_recording_test.go Comprehensive test coverage (25 cases) across unit, validation, dry-run, and integration paths; two minor Chinese inline comments remain
shortcuts/vc/shortcuts.go Trivial one-line VCRecording registration
skills/lark-vc/SKILL.md Documentation updated with +recording shortcut, permissions, and resource diagram
skills/lark-vc/references/lark-vc-recording.md New reference doc with examples, permissions, and troubleshooting for +recording

Sequence Diagram

sequenceDiagram
    participant User
    participant CLI as vc +recording
    participant RecAPI as vc/v1/meetings/{id}/recording
    participant CalAPI as calendar/v4/calendars
    participant Minutes as minutes URL

    alt --meeting-ids path
        User->>CLI: --meeting-ids m1,m2,...
        loop each meeting_id
            CLI->>RecAPI: GET /recording
            RecAPI-->>CLI: recording.url
            CLI->>Minutes: extractMinuteToken(url)
            Minutes-->>CLI: minute_token
        end
    else --calendar-event-ids path
        User->>CLI: --calendar-event-ids e1,e2,...
        CLI->>CalAPI: POST /primary
        CalAPI-->>CLI: calendar_id
        loop each calendar_event_id
            CLI->>CalAPI: POST mget_instance_relation_info
            CalAPI-->>CLI: meeting_instance_ids[]
            loop each meeting_id (fallback)
                CLI->>RecAPI: GET /recording
                RecAPI-->>CLI: recording.url
                CLI->>Minutes: extractMinuteToken(url)
                Minutes-->>CLI: minute_token
                note over CLI: break on first success
            end
        end
    end
    CLI-->>User: table(meeting_id, minute_token, duration, status)
Loading

Reviews (6): Last reviewed commit: "fix(vc): address review findings for +re..." | 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@43f8f8ed54ec13dbfcd81c06176c8e6bc881b71a

🧩 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