feat(minutes): add media upload shortcut#725
Conversation
Support minutes +upload to generate a minute from an uploaded media file token. Change-Id: I59c0719a39541134e395a23262aea7f387105715
|
|
📝 WalkthroughWalkthroughAdds a new Changes
Sequence DiagramsequenceDiagram
actor User
participant Drive as Drive API
participant Minutes as Minutes API
User->>Drive: +upload (local audio/video)
Drive-->>User: file_token
User->>Minutes: +upload --file-token
Minutes-->>User: minute_url
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #725 +/- ##
==========================================
+ Coverage 62.50% 64.14% +1.64%
==========================================
Files 432 505 +73
Lines 37758 44338 +6580
==========================================
+ Hits 23599 28440 +4841
- Misses 12033 13421 +1388
- Partials 2126 2477 +351 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@d889de71ff54be78be07a46f6d9a3eaea4b935a7🧩 Skill updatenpx skills add larksuite/cli#feat/minutes-upload-workflow -y -g |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
tests/cli_e2e/minutes/minutes_upload_test.go (1)
34-37: ⚡ Quick winCover auth identity in dry-run assertions.
Line 34-37 validates method/path/body token, but not auth identity. Add an assertion that dry-run output indicates user identity/auth type to fully lock the contract this PR introduces.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/cli_e2e/minutes/minutes_upload_test.go` around lines 34 - 37, Add an assertion in the minutes upload dry-run test to verify the auth identity appears in the CLI output: inspect the same output variable used in the existing assertions (see current asserts checking "POST", "/open-apis/minutes/v1/minutes/upload", and "boxcn123456") and add an assert.True that strings.Contains(output, "<expected-auth-identity-or-type>") (replace placeholder with the expected user identity or auth type string your contract requires) so the test validates auth identity is present in the dry-run.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@shortcuts/minutes/minutes_upload.go`:
- Around line 63-70: The current code reads minuteURL via common.GetString and
always calls runtime.OutFormat returning success even when minute_url is empty;
change this to fail fast: after minuteURL := common.GetString(data,
"minute_url") check if minuteURL == "" and if so call runtime.OutFormat with an
error payload (or return a non-nil error) describing the missing minute_url,
then return that error instead of proceeding; keep the existing successful
runtime.OutFormat path only when minuteURL is non-empty. Use the identifiers
minuteURL, common.GetString and runtime.OutFormat to locate and update the
logic.
In `@tests/cli_e2e/minutes/minutes_upload_test.go`:
- Around line 39-44: The test helper setDryRunConfigEnv currently sets runtime
credential env vars but doesn't isolate CLI config state, causing
environment-coupled flakes; update setDryRunConfigEnv to also set
LARKSUITE_CLI_CONFIG_DIR to a fresh temporary directory via t.TempDir() so the
CLI config is isolated for each test run (modify the function setDryRunConfigEnv
to call t.Setenv("LARKSUITE_CLI_CONFIG_DIR", t.TempDir())).
---
Nitpick comments:
In `@tests/cli_e2e/minutes/minutes_upload_test.go`:
- Around line 34-37: Add an assertion in the minutes upload dry-run test to
verify the auth identity appears in the CLI output: inspect the same output
variable used in the existing assertions (see current asserts checking "POST",
"/open-apis/minutes/v1/minutes/upload", and "boxcn123456") and add an
assert.True that strings.Contains(output, "<expected-auth-identity-or-type>")
(replace placeholder with the expected user identity or auth type string your
contract requires) so the test validates auth identity is present in the
dry-run.
🪄 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: c666d018-0005-4824-aded-bdb69f91cce7
📒 Files selected for processing (6)
shortcuts/minutes/minutes_upload.goshortcuts/minutes/minutes_upload_test.goshortcuts/minutes/shortcuts.goskills/lark-minutes/SKILL.mdskills/lark-minutes/references/lark-minutes-upload.mdtests/cli_e2e/minutes/minutes_upload_test.go
Summary
Add a
lark-cli minutes +uploadshortcut that turns an existing Drive mediafile_tokeninto a Minutes record. The shortcut documents the Drive-first upload workflow and returns the generatedminute_url.Changes
minutes +uploadwith--file-token, user auth scope metadata, validation, dry-run output, and JSON result formatting.lark-minutesskill documentation with the upload workflow and examples.Test Plan
make unit-testgo vet ./...gofmt -l .go mod tidymade no changesgo run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1.6 run --new-from-rev=origin/maingo test -count=1 ./tests/cli_e2e/minutesRelated Issues
Summary by CodeRabbit
New Features
minutes +uploadcommand to generate meeting notes from audio/video files previously uploaded to Drive. Validates file token and supports dry-run mode.Documentation
Tests