Skip to content

fix(drive): abort push on parent sibling limit - #1813

Merged
fangshuyu-768 merged 1 commit into
mainfrom
codex/drive-push-parent-sibling-limit
Jul 9, 2026
Merged

fix(drive): abort push on parent sibling limit#1813
fangshuyu-768 merged 1 commit into
mainfrom
codex/drive-push-parent-sibling-limit

Conversation

@fangshuyu-768

@fangshuyu-768 fangshuyu-768 commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • classify Drive code 1062507 as the destination parent folder child-count limit
  • make drive +push treat 1062507 as a terminal parent_sibling_limit failure with a concrete hint
  • document the non-retry guidance in the drive +push skill reference

Tests

  • go test ./internal/errclass ./shortcuts/drive

Notes

  • go test ./... was also attempted locally; it fails on unrelated existing environment/e2e issues such as missing local lark-cli binary, registry/schema fixtures, permission scopes, and temp-dir cleanup.

Summary by CodeRabbit

  • Bug Fixes

    • Improved Drive upload error handling for parent-folder child-limit failures.
    • The command now stops immediately, reports the failure clearly, and avoids continuing with additional folders.
  • Documentation

    • Added guidance for this error, including suggested next steps like cleaning up the destination folder, using a different folder token, or splitting uploads into subfolders.

@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 9, 2026
@coderabbitai

coderabbitai Bot commented Jul 9, 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: a0ab7c2a-a18a-4d79-b5b0-13a16e47e1a1

📥 Commits

Reviewing files that changed from the base of the PR and between c04da47 and 1511e41.

📒 Files selected for processing (5)
  • internal/errclass/classify_test.go
  • internal/errclass/codemeta_drive.go
  • shortcuts/drive/drive_push.go
  • shortcuts/drive/drive_push_test.go
  • skills/lark-drive/references/lark-drive-push.md

📝 Walkthrough

Walkthrough

Introduces handling for Lark Drive error code 1062507 (parent sibling/child-count limit). Adds classification metadata mapping the code to quota-exceeded API error, marks it terminal in drive push batch failure handling with a corrective hint, adds a regression test, updates test matrix, and documents the error in reference docs.

Changes

Parent Sibling Limit Error Classification

Layer / File(s) Summary
Error code metadata registration
internal/errclass/codemeta_drive.go, internal/errclass/classify_test.go
Registers Drive code 1062507 as CategoryAPI/SubtypeQuotaExceeded and adds a matching test-case row expecting exit code 1 and typed APIError.
Drive push terminal failure handling and tests
shortcuts/drive/drive_push.go, shortcuts/drive/drive_push_test.go
Adds a branch in driveClassifyBatchFailure for code 1062507 setting Class=parent_sibling_limit, Terminal=true, and a hint; adds a regression test verifying push aborts after the first create_folder failure without processing sibling folders.
Documentation update
skills/lark-drive/references/lark-drive-push.md
Documents parent_sibling_limit (code 1062507) in the terminal errors table with remediation guidance.

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

Sequence Diagram(s)

sequenceDiagram
  participant Test as DrivePushTest
  participant Push as DrivePushCommand
  participant Classifier as driveClassifyBatchFailure
  participant API as MockedLarkAPI

  Test->>Push: run push command
  Push->>API: create_folder for "a"
  API-->>Push: error code 1062507
  Push->>Classifier: classify failure
  Classifier-->>Push: Class=parent_sibling_limit, Terminal=true, Hint
  Push-->>Test: PartialFailureError (failed=1, aborted=true)
  Push--x Push: skip create_folder for "b"
Loading

Possibly related PRs

  • larksuite/cli#1703: Shares the same Drive error-code mapping and batch-failure metadata handling that the new 1062507 classification builds on.
  • larksuite/cli#1779: Modifies the same batch-failure classification/terminal decision path in drive_push.go that this PR extends.
  • larksuite/cli#709: Introduces the drive push shortcut that this PR's error handling extends.

Suggested labels: size/M

Suggested reviewers: caojie0621, SunPeiYang996

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: aborting Drive push on the parent sibling limit.
Description check ✅ Passed The description covers summary and verification, but it does not follow the template sections for Changes, Test Plan, and Related Issues exactly.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 codex/drive-push-parent-sibling-limit

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.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#codex/drive-push-parent-sibling-limit -y -g

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.44%. Comparing base (c04da47) to head (1511e41).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1813   +/-   ##
=======================================
  Coverage   74.44%   74.44%           
=======================================
  Files         860      860           
  Lines       89855    89859    +4     
=======================================
+ Hits        66891    66897    +6     
+ Misses      17780    17778    -2     
  Partials     5184     5184           

☔ View full report in Codecov by Harness.
📢 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.

@fangshuyu-768
fangshuyu-768 merged commit 80fadf1 into main Jul 9, 2026
37 of 39 checks passed
@fangshuyu-768
fangshuyu-768 deleted the codex/drive-push-parent-sibling-limit branch July 9, 2026 03:29
@liangshuo-1 liangshuo-1 mentioned this pull request Jul 9, 2026
3 tasks
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.

3 participants