Skip to content

feat(drive): support importing .png files as slides#1960

Closed
tianyouskrrr wants to merge 1 commit into
mainfrom
feat/drive-import-png
Closed

feat(drive): support importing .png files as slides#1960
tianyouskrrr wants to merge 1 commit into
mainfrom
feat/drive-import-png

Conversation

@tianyouskrrr

@tianyouskrrr tianyouskrrr commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add .png to the allowed drive-import extension list, mapped to slides
  • Update validation error messages and skill docs accordingly
  • Cover with a unit test plus a dry-run e2e test

Test plan

  • go build ./...
  • unit tests for drive_import_common.go
  • dry-run e2e test verifying file_extension: "png" in both upload_all and import_tasks request bodies

Summary by CodeRabbit

  • New Features

    • Added support for importing .png files as Slides.
    • PNG imports can include a custom name and are validated for the correct target type.
    • Added guidance for PNG import limits and usage.
  • Documentation

    • Updated Drive import documentation and examples to describe PNG-to-Slides conversion.
  • Tests

    • Added validation and end-to-end coverage for PNG imports.

Adds .png to the allowed drive-import extension list (mapped to
slides), updates validation error messages and skill docs, and
covers it with a unit test plus a dry-run e2e test.
@CLAassistant

CLAassistant commented Jul 20, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions Bot added domain/ccm PR touches the ccm domain size/M Single-domain feat or fix with limited business impact labels Jul 20, 2026
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b4c31e57-1ad4-4ddc-b9c2-95913f73818d

📥 Commits

Reviewing files that changed from the base of the PR and between 6ff1022 and 6727934.

📒 Files selected for processing (6)
  • shortcuts/drive/drive_import.go
  • shortcuts/drive/drive_import_common.go
  • shortcuts/drive/drive_import_common_test.go
  • skills/lark-drive/SKILL.md
  • skills/lark-drive/references/lark-drive-import.md
  • tests/cli_e2e/drive/drive_import_dryrun_test.go

📝 Walkthrough

Walkthrough

Changes

PNG Drive import

Layer / File(s) Summary
PNG mapping and validation
shortcuts/drive/drive_import_common.go, shortcuts/drive/drive_import_common_test.go
PNG maps to slides, validation messages list .png, and tests cover valid Slides imports and invalid document imports.
PNG import execution coverage
shortcuts/drive/drive_import.go, tests/cli_e2e/drive/drive_import_dryrun_test.go
The CLI advertises PNG support, while the dry-run test verifies upload metadata and the Slides import task request.
PNG import documentation
skills/lark-drive/SKILL.md, skills/lark-drive/references/lark-drive-import.md
Documentation describes PNG-to-Slides conversion, constraints, and an example command.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant DriveImportCLI
  participant UploadAPI
  participant ImportTaskAPI
  User->>DriveImportCLI: drive +import screenshot.png --type slides
  DriveImportCLI->>UploadAPI: initialize PNG upload
  UploadAPI-->>DriveImportCLI: upload metadata
  DriveImportCLI->>ImportTaskAPI: create Slides import task
  ImportTaskAPI-->>DriveImportCLI: import task request
Loading

Possibly related PRs

  • larksuite/cli#194: Added the Drive import implementation and related validation and tests.
  • larksuite/cli#599: Updated shared Drive import extension-to-target validation for another file extension.
  • larksuite/cli#1068: Added Slides mapping and validation for .pptx imports.

Suggested reviewers: liangshuo-1

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 clearly states the main change: adding .png import support for slides.
Description check ✅ Passed The description covers Summary and Test Plan, but it omits the template's Changes and Related Issues headings.
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.
✨ 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/drive-import-png
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch feat/drive-import-png

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

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

@tianyouskrrr tianyouskrrr self-assigned this Jul 20, 2026
@tianyouskrrr
tianyouskrrr requested a review from ethan-zhx July 20, 2026 06:43
@tianyouskrrr

Copy link
Copy Markdown
Collaborator Author

Per team decision: this branch is maintained for Doubao's exclusive use, not merged into lark-cli main. Keeping feat/drive-import-png as a live branch, closing this PR without merging.

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

Labels

domain/ccm PR touches the ccm domain size/M Single-domain feat or fix with limited business impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants