Skip to content

feat(minutes): add media upload shortcut#725

Merged
calendar-assistant merged 1 commit intomainfrom
feat/minutes-upload-workflow
Apr 30, 2026
Merged

feat(minutes): add media upload shortcut#725
calendar-assistant merged 1 commit intomainfrom
feat/minutes-upload-workflow

Conversation

@calendar-assistant
Copy link
Copy Markdown
Collaborator

@calendar-assistant calendar-assistant commented Apr 30, 2026

Summary

Add a lark-cli minutes +upload shortcut that turns an existing Drive media file_token into a Minutes record. The shortcut documents the Drive-first upload workflow and returns the generated minute_url.

Changes

  • Add minutes +upload with --file-token, user auth scope metadata, validation, dry-run output, and JSON result formatting.
  • Register the shortcut under the minutes domain.
  • Add unit coverage for validation, help metadata, dry-run output, and successful execution.
  • Add minutes E2E dry-run coverage for request method, URL, auth type, and body shape.
  • Update the lark-minutes skill documentation with the upload workflow and examples.

Test Plan

  • Unit tests pass: make unit-test
  • Vet passes: go vet ./...
  • Formatting check passes: gofmt -l .
  • Module tidy check passes: go mod tidy made no changes
  • New-change lint passes: go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1.6 run --new-from-rev=origin/main
  • Minutes E2E tests pass: go test -count=1 ./tests/cli_e2e/minutes

Related Issues

  • None

Summary by CodeRabbit

  • New Features

    • Added minutes +upload command to generate meeting notes from audio/video files previously uploaded to Drive. Validates file token and supports dry-run mode.
  • Documentation

    • Added guide for the new upload feature, including supported formats, constraints (≤6 GB file size, ≤6 hours duration), and usage examples.
  • Tests

    • Added unit and end-to-end tests verifying upload functionality and validation behavior.

Support minutes +upload to generate a minute from an uploaded media file token.

Change-Id: I59c0719a39541134e395a23262aea7f387105715
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions github-actions Bot added the size/M Single-domain feat or fix with limited business impact label Apr 30, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

📝 Walkthrough

Walkthrough

Adds a new MinutesUpload shortcut enabling users to upload media files to the minutes service. Implementation includes shortcut code, unit and end-to-end tests, and comprehensive documentation. Registers the shortcut in the minutes package and updates skill documentation to support audio/video upload for minute generation.

Changes

Cohort / File(s) Summary
Core Implementation
shortcuts/minutes/minutes_upload.go
Implements MinutesUpload shortcut with file-token parameter validation, POST request to /open-apis/minutes/v1/minutes/upload, dry-run support, and minute_url extraction from API response.
Testing
shortcuts/minutes/minutes_upload_test.go, tests/cli_e2e/minutes/minutes_upload_test.go
Adds unit tests verifying validation errors, flag descriptions, command tips, dry-run output, and JSON response parsing; includes e2e test confirming command execution and HTTP endpoint validation.
Registry & Integration
shortcuts/minutes/shortcuts.go
Registers MinutesUpload in the minutes package's Shortcuts() function to expose the new upload capability alongside existing search and download shortcuts.
Documentation
skills/lark-minutes/SKILL.md, skills/lark-minutes/references/lark-minutes-upload.md
Updates skill description to include audio/video upload capability; adds routing rules showing drive upload followed by minutes upload; provides new reference documentation with end-to-end usage, parameter specifications, supported formats, constraints, and expected output schema.

Sequence Diagram

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

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

domain/vc, size/L

Suggested reviewers

  • zhaoleibd

Poem

🐰 With tokens gathered, brave and true,
To minutes' vault they gently flew,
Upload, convert, and moments gleam,
A rabbit's gift—the perfect dream! 🎬✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(minutes): add media upload shortcut' clearly and concisely describes the main change: adding a new upload shortcut for the minutes functionality.
Description check ✅ Passed The pull request description comprehensively covers all template sections: Summary explains the feature, Changes lists all modifications, and Test Plan documents verification with checked items.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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/minutes-upload-workflow

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.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

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

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 30, 2026

Codecov Report

❌ Patch coverage is 72.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.14%. Comparing base (6f444c5) to head (d889de7).
⚠️ Report is 46 commits behind head on main.

Files with missing lines Patch % Lines
shortcuts/minutes/minutes_upload.go 75.00% 3 Missing and 3 partials ⚠️
shortcuts/minutes/shortcuts.go 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#feat/minutes-upload-workflow -y -g

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.

Actionable comments posted: 2

🧹 Nitpick comments (1)
tests/cli_e2e/minutes/minutes_upload_test.go (1)

34-37: ⚡ Quick win

Cover 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

📥 Commits

Reviewing files that changed from the base of the PR and between d7ee5b5 and d889de7.

📒 Files selected for processing (6)
  • shortcuts/minutes/minutes_upload.go
  • shortcuts/minutes/minutes_upload_test.go
  • shortcuts/minutes/shortcuts.go
  • skills/lark-minutes/SKILL.md
  • skills/lark-minutes/references/lark-minutes-upload.md
  • tests/cli_e2e/minutes/minutes_upload_test.go

Comment thread shortcuts/minutes/minutes_upload.go
Comment thread tests/cli_e2e/minutes/minutes_upload_test.go
@calendar-assistant calendar-assistant merged commit 0250054 into main Apr 30, 2026
21 of 22 checks passed
@calendar-assistant calendar-assistant deleted the feat/minutes-upload-workflow branch April 30, 2026 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Single-domain feat or fix with limited business impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants