fix(drive): require user id before bot-created resources#1457
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 (5)
📝 WalkthroughWalkthroughAdds a new ChangesBot current-user preflight for Drive create operations
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 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 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 |
Summary
Prevent
drive +uploadanddrive +importfrom creating new bot-owned Drive resources when the CLI does not know the current user'sopen_id. This avoids returning resources that cannot be auto-granted back to the user.Fixes #1455
Changes
failed_preconditionwhenuser_open_idis missing.drive +uploadnew uploads anddrive +import.drive +upload --file-tokenoverwrite behavior unchanged because it does not create a new resource.Test Plan
go test ./shortcuts/drive -run "TestDrive(UploadBotAutoGrantSuccess|UploadBotRequiresCurrentUserBeforeCreate|UploadBotAutoGrantFailed|UploadBotOverwriteSkipsPermissionGrant|ImportBotAutoGrantSuccess|ImportBotRequiresCurrentUserBeforeCreate|ImportTimeoutReturnsFollowUpCommand|UploadSmallFile$|UploadLargeFileUsesMultipart$|UploadLargeFileToWikiUsesMultipart$|UploadSmallFileToWiki$|UploadSmallFileAPIError$|UploadPrepareInvalidResponse$|UploadPartAPIError$|UploadFinishNoToken$|UploadWithCustomName$)" -count=1go test ./shortcuts/common -run "TestAutoGrant" -count=1go build -o lark-cli.exe .go test ./shortcuts/drive -count=1(fails on existing Windows local filesystem/symlink and rollback-mock tests unrelated to this change)go test ./tests/cli_e2e/drive -run "TestDriveUploadDryRun" -count=1(Windows helper rejectslark-cli.exebecause it checks Unix executable mode bits)Related Issues
Summary by CodeRabbit
New Features
Tests