feat: support PDF imports as slides#1327
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
✅ Files skipped from review due to trivial changes (4)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThis PR extends the ChangesPDF Support for Drive Import Feature
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
shortcuts/drive/drive_import.go (1)
36-44:⚠️ Potential issue | 🟠 Major | ⚡ Quick winAdd safe-path validation before any filesystem access for
--file.
--filecomes from CLI input and is used infio.Stat(...)without an explicit safe-path validation gate in this flow. Please validate the input path before preflight/stat/read to enforce the CLI trust boundary consistently.As per coding guidelines: “Validate paths before reading with
validate.SafeInputPathbecause CLI arguments are untrusted (they come from AI agents).”Also applies to: 159-165
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@shortcuts/drive/drive_import.go` around lines 36 - 44, The CLI-provided file path (runtime.Str("file")) is not being checked with the safe-path validator before filesystem operations; update the Validate closure that builds the driveImportSpec (and the corresponding preflight/Stat/read paths referenced later) to call validate.SafeInputPath on the FilePath value and return an error if it fails; specifically, ensure validateDriveImportSpec (or the Validate func that constructs driveImportSpec) enforces validate.SafeInputPath(FilePath) prior to any fio.Stat/fio.Read usage so the untrusted --file input is rejected when unsafe.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@shortcuts/drive/drive_import.go`:
- Around line 36-44: The CLI-provided file path (runtime.Str("file")) is not
being checked with the safe-path validator before filesystem operations; update
the Validate closure that builds the driveImportSpec (and the corresponding
preflight/Stat/read paths referenced later) to call validate.SafeInputPath on
the FilePath value and return an error if it fails; specifically, ensure
validateDriveImportSpec (or the Validate func that constructs driveImportSpec)
enforces validate.SafeInputPath(FilePath) prior to any fio.Stat/fio.Read usage
so the untrusted --file input is rejected when unsafe.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ddd70acc-4033-4420-a128-0cbe1703d55a
📒 Files selected for processing (6)
shortcuts/drive/drive_import.goshortcuts/drive/drive_import_common.goshortcuts/drive/drive_import_common_test.goskills/lark-drive/references/lark-drive-import.mdtests/cli_e2e/drive/coverage.mdtests/cli_e2e/drive/drive_import_dryrun_test.go
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1327 +/- ##
==========================================
+ Coverage 71.47% 71.95% +0.47%
==========================================
Files 688 699 +11
Lines 65482 66164 +682
==========================================
+ Hits 46806 47611 +805
+ Misses 15031 14864 -167
- Partials 3645 3689 +44 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@a84fe91fa12bf3ce22f7a97ea2c85cb9e9578dee🧩 Skill updatenpx skills add larksuite/cli#feat/import_pdf_as_slides -y -g |
9edaeb9 to
a84fe91
Compare
Summary
Adds support for importing PDF files as Slides through the drive import flow.
Changes
Test Plan
Related Issues
Summary by CodeRabbit
New Features
Documentation
Tests
Chores