docs(base): clarify form and file operation routing - #2110
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:
📝 WalkthroughWalkthroughUpdated Base routing, form workflows, form-question dry-run validation, advanced-permission role guidance, and CLI coverage documentation. ChangesBase contracts and command workflows
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant CLI
participant BaseFormQuestionsCreate
participant DryRunRequest
CLI->>BaseFormQuestionsCreate: Validate --questions
BaseFormQuestionsCreate->>DryRunRequest: Attach questions payload
DryRunRequest-->>CLI: Render POST request
Possibly related PRs
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@061c6ecc077fcfd3bab7adab066a0b43bf175a21🧩 Skill updatenpx skills add zhouyue-bytedance/cli#auto-research/01KYRM46K72WBWZAT60JHRTQB7-20260730042344 -y -g |
e40dd5d to
a6b6c9b
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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.
Inline comments:
In `@tests/cli_e2e/base/base_skill_contract_test.go`:
- Around line 24-26: Update the assertions in the base skill contract test to
match the documented routing text exactly: retain the local-file assertion with
`本地文件与 Base 之间的导入/导出转 \`lark-drive\`` and change the online-copy assertion to
`在线复制 Base 使用 \`+base-copy\``. Remove the mismatched alternate literals.
In `@tests/cli_e2e/base/coverage.md`:
- Around line 5-6: Update the coverage metrics in coverage.md to reflect 25
covered commands out of 78 total, using approximately 32.1% coverage instead of
the current 23 and 29.5% values.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 089fb902-c37f-4248-a4ab-0c872f6797ae
📒 Files selected for processing (4)
skills/lark-base/SKILL.mdtests/cli_e2e/base/base_form_detail_dryrun_test.gotests/cli_e2e/base/base_skill_contract_test.gotests/cli_e2e/base/coverage.md
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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.
Inline comments:
In `@shortcuts/base/base_form_questions_create.go`:
- Around line 35-45: Update the `DryRun` validation and corresponding `Execute`
handling in the form question creation flow to reject JSON `null` by checking
that the unmarshaled `questions` slice is non-nil after `json.Unmarshal`; return
the same invalid-array validation response instead of sending `"questions":
null`, and ensure `Execute` performs the same check with guarded output
handling.
In `@tests/cli_e2e/base/base_form_questions_create_dryrun_test.go`:
- Around line 16-42: Extend TestBaseFormQuestionsCreateDryRun with regression
cases for malformed --questions JSON and null or non-array values. Run the
command for each invalid input and assert the expected dry-run failure
representation directly, while preserving the existing valid-array assertions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: a4c3cf8a-6acf-4f5e-8986-5952ef3205f5
📒 Files selected for processing (8)
shortcuts/base/base_form_questions_create.goshortcuts/base/base_form_questions_create_tips_test.goskills/lark-base/SKILL.mdskills/lark-base/references/lark-base-form-questions-create.mdskills/lark-base/references/lark-base-role-guide.mdskills/lark-base/references/role-config.mdtests/cli_e2e/base/base_form_questions_create_dryrun_test.gotests/cli_e2e/base/coverage.md
🚧 Files skipped from review as they are similar to previous changes (2)
- skills/lark-base/SKILL.md
- tests/cli_e2e/base/coverage.md
b5c4aa7 to
0d5d779
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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.
Inline comments:
In `@shortcuts/base/base_form_questions_create.go`:
- Around line 86-91: Update parseFormQuestionsCreate to unmarshal into the typed
request/question shape rather than []interface{}, preserving supported nested
fields. Validate that the input is a non-null JSON array containing valid
question objects with required title and type fields and no more than 10 items,
returning baseValidationErrorf for any contract violation before the API flow
continues.
In `@tests/cli_e2e/base/base_form_questions_create_dryrun_test.go`:
- Around line 65-69: Update the assertions in the dry-run validation test to
parse the structured error envelope from result.Stdout instead of result.Stderr,
while retaining the existing validation fields and expected error values. Keep
the assertion that result.Stderr is empty, and verify the validation failure’s
exit code is 2 if the test already exposes an exit-code assertion path.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 4ba93a52-546f-4781-9e3b-84fc920b93bf
📒 Files selected for processing (10)
shortcuts/base/base_form_questions_create.goshortcuts/base/base_form_questions_create_tips_test.goskills/lark-base/SKILL.mdskills/lark-base/references/lark-base-form-questions-create.mdskills/lark-base/references/lark-base-role-guide.mdskills/lark-base/references/role-config.mdtests/cli_e2e/base/base_form_detail_dryrun_test.gotests/cli_e2e/base/base_form_questions_create_dryrun_test.gotests/cli_e2e/base/base_skill_contract_test.gotests/cli_e2e/base/coverage.md
🚧 Files skipped from review as they are similar to previous changes (4)
- skills/lark-base/references/lark-base-role-guide.md
- skills/lark-base/references/lark-base-form-questions-create.md
- skills/lark-base/references/role-config.md
- tests/cli_e2e/base/coverage.md
Summary
Clarify Base form identifier routing and keep Base file import/export guidance at the correct skill boundary. Base table forms use
base_token + table_id, shared form detail usesshare_token, and local file operations delegate tolark-drive.Changes
+form-list.lark-drivewhile keeping online Base copies on+base-copy.lark-basewith a routing contract test.Test Plan
make unit-testgo test ./tests/cli_e2e/base -run 'TestBaseSkillRoutesFileImportExportToDrive|TestBaseFormListDryRun_UsesBaseAndTableIdentifiers'+form-listuses the Base and table identifiers in the expected endpoint.Related Issues
Summary by CodeRabbit
table_id复用、分享链接凭证及主字段删除限制。base +form-questions-create --dry-run,确保提交题目内容并拒绝无效 JSON。