feat(drive): add +member-remove shortcut - #1994
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds the ChangesDrive member removal
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant CLI
participant DriveMemberRemove
participant DrivePermissionsAPI
participant Output
CLI->>DriveMemberRemove: submit validated removal command
DriveMemberRemove->>DrivePermissionsAPI: DELETE collaborator permission
DrivePermissionsAPI-->>DriveMemberRemove: response or typed API error
DriveMemberRemove->>Output: emit structured removal result
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@12a8709a03f50f019955608bdb71238143057c84🧩 Skill updatenpx skills add larksuite/cli#feat/drive-member-remove-shortcut -y -g |
4936c2c to
6a48bda
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1994 +/- ##
==========================================
+ Coverage 76.36% 76.39% +0.03%
==========================================
Files 1011 1013 +2
Lines 111269 111788 +519
==========================================
+ Hits 84970 85400 +430
- Misses 19815 19878 +63
- Partials 6484 6510 +26 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
b8fc727 to
162e896
Compare
7675328 to
da2c437
Compare
5bcb676 to
5bc85b6
Compare
6a16619 to
214abd8
Compare
214abd8 to
8fe0950
Compare
8fe0950 to
0540746
Compare
Add drive +member-remove for removing one collaborator permission from Drive documents, files, folders, wiki nodes, and Miaoda apps. The shortcut validates resource and member contracts before issuing the high-risk DELETE request, preserves structured CLI errors, and documents identity and wiki permission behavior. Key features: - Resolve resource type from supported URLs or require it for bare tokens - Accept Miaoda apps via /page/ URLs or explicit --type=apps - Support user and bot identities with member-type-specific validation - Require explicit confirmation and return stable removal metadata - Reject unsupported slash-containing tokens and member IDs before API calls - Add unit, dry-run E2E, live workflow, and skill documentation coverage
0540746 to
12a8709
Compare
Add a high-risk Drive shortcut for removing one collaborator permission through the permission member delete API. The command validates resource and member combinations, previews the exact DELETE request, and returns an auditable success receipt.
Key features:
Reuse existing Drive member target, member type, and wiki permission helpers without changing +member-add
Require explicit confirmation and reject unsupported bot department removal before the API call
Cover request shaping, typed errors, dry-run behavior, and the live add/remove workflow
Test Plan
shortcuts/drive/drive_member_remove_test.go): request construction, query/body shaping, conditional output fields, typed validation errors, and API-error passthrough.tests/cli_e2e/drive/drive_member_remove_dryrun_test.go): exact DELETE method/URL/params/body per resource type, plus regression cases rejecting ambiguous multi-segment URLs, %2F-encoded separators,--typeconflicts, and slash/comma-containing member IDs.tests/cli_e2e/drive/drive_member_remove_workflow_test.go): docx add→remove round trip, and a fixture-gated apps (Miaoda) add→remove round trip (LARK_CLI_E2E_DRIVE_APPS_TOKEN, skipped when unset) that only mutates a transient bot collaborator and reports cleanup failures viaclie2e.ReportCleanupFailure.go test ./shortcuts/drive/ -run MemberRemove(pass),go vet ./shortcuts/drive/,gofmt -l(clean).Related Issues
Summary by CodeRabbit
drive +member-removeto remove exactly one collaborator’s Drive permission, with wiki-specific handling and structured progress/output.--dry-run, parameter rules, and returned field meanings).