Skip to content

docs(base): clarify form and file operation routing - #2110

Merged
zhouyue-bytedance merged 8 commits into
larksuite:mainfrom
zhouyue-bytedance:auto-research/01KYRM46K72WBWZAT60JHRTQB7-20260730042344
Jul 31, 2026
Merged

docs(base): clarify form and file operation routing#2110
zhouyue-bytedance merged 8 commits into
larksuite:mainfrom
zhouyue-bytedance:auto-research/01KYRM46K72WBWZAT60JHRTQB7-20260730042344

Conversation

@zhouyue-bytedance

@zhouyue-bytedance zhouyue-bytedance commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

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 uses share_token, and local file operations delegate to lark-drive.

Changes

  • Separate Base-internal form management from shared-form detail routing and add a dry-run regression test for +form-list.
  • Route Base file import/export to lark-drive while keeping online Base copies on +base-copy.
  • Replace duplicated Drive flags and path rules in lark-base with a routing contract test.

Test Plan

  • make unit-test
  • go test ./tests/cli_e2e/base -run 'TestBaseSkillRoutesFileImportExportToDrive|TestBaseFormListDryRun_UsesBaseAndTableIdentifiers'
  • Manual dry-run verification confirms +form-list uses the Base and table identifiers in the expected endpoint.

Related Issues

  • None

Summary by CodeRabbit

  • Documentation
    • Standardized Base 文件导入/导出与本地、在线复制流程到 Drive。
    • Clarified Base 表单与题目管理规则,包括 table_id 复用、分享链接凭证及主字段删除限制。
    • 补充高级权限前置检查与角色配置说明。
  • Bug Fixes
    • 改进 base +form-questions-create --dry-run,确保提交题目内容并拒绝无效 JSON。
  • Tests
    • 扩展表单命令的 dry-run、帮助提示和参数校验覆盖范围,并更新覆盖率记录。

@github-actions github-actions Bot added domain/base PR touches the base domain size/M Single-domain feat or fix with limited business impact labels Jul 30, 2026
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Updated Base routing, form workflows, form-question dry-run validation, advanced-permission role guidance, and CLI coverage documentation.

Changes

Base contracts and command workflows

Layer / File(s) Summary
Routing and form ownership contracts
skills/lark-base/SKILL.md, skills/lark-base/references/lark-base-form-questions-create.md
File import/export routes through lark-drive, online copying uses +base-copy, and form workflows require consistent base_token and table_id handling with field-based question identifiers.
Form question creation validation
shortcuts/base/base_form_questions_create.go, shortcuts/base/base_form_questions_create_tips_test.go, tests/cli_e2e/base/base_form_questions_create_dryrun_test.go
Form-question creation adds workflow tips, validates --questions JSON during dry-run, preserves valid payloads, and tests request construction and help guidance.
Advanced permission role guidance
skills/lark-base/references/lark-base-role-guide.md, skills/lark-base/references/role-config.md
Role workflows check advanced status with +base-get, conditionally enable permissions, and document expanded table-rule examples and create/update constraints.
Form and routing coverage
tests/cli_e2e/base/base_form_detail_dryrun_test.go, tests/cli_e2e/base/base_skill_contract_test.go, tests/cli_e2e/base/coverage.md
Tests verify form identifiers, question validation, help text, and routing contracts, while coverage documentation records updated metrics and command statuses.

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
Loading

Possibly related PRs

Suggested reviewers: fangshuyu-768, kongenpei

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes to Base form and file operation routing.
Description check ✅ Passed The description includes all required sections and provides clear scope, changes, and verification details.
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 unit tests (beta)
  • Create PR with unit tests

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 30, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@061c6ecc077fcfd3bab7adab066a0b43bf175a21

🧩 Skill update

npx skills add zhouyue-bytedance/cli#auto-research/01KYRM46K72WBWZAT60JHRTQB7-20260730042344 -y -g

@zhouyue-bytedance
zhouyue-bytedance force-pushed the auto-research/01KYRM46K72WBWZAT60JHRTQB7-20260730042344 branch from e40dd5d to a6b6c9b Compare July 30, 2026 09:08

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between e40dd5d and a6b6c9b.

📒 Files selected for processing (4)
  • skills/lark-base/SKILL.md
  • tests/cli_e2e/base/base_form_detail_dryrun_test.go
  • tests/cli_e2e/base/base_skill_contract_test.go
  • tests/cli_e2e/base/coverage.md

Comment thread tests/cli_e2e/base/base_skill_contract_test.go
Comment thread tests/cli_e2e/base/coverage.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between a6b6c9b and b5c4aa7.

📒 Files selected for processing (8)
  • shortcuts/base/base_form_questions_create.go
  • shortcuts/base/base_form_questions_create_tips_test.go
  • skills/lark-base/SKILL.md
  • skills/lark-base/references/lark-base-form-questions-create.md
  • skills/lark-base/references/lark-base-role-guide.md
  • skills/lark-base/references/role-config.md
  • tests/cli_e2e/base/base_form_questions_create_dryrun_test.go
  • tests/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

Comment thread shortcuts/base/base_form_questions_create.go
Comment thread tests/cli_e2e/base/base_form_questions_create_dryrun_test.go
@zhouyue-bytedance
zhouyue-bytedance force-pushed the auto-research/01KYRM46K72WBWZAT60JHRTQB7-20260730042344 branch from b5c4aa7 to 0d5d779 Compare July 30, 2026 14:53

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between b5c4aa7 and 0d5d779.

📒 Files selected for processing (10)
  • shortcuts/base/base_form_questions_create.go
  • shortcuts/base/base_form_questions_create_tips_test.go
  • skills/lark-base/SKILL.md
  • skills/lark-base/references/lark-base-form-questions-create.md
  • skills/lark-base/references/lark-base-role-guide.md
  • skills/lark-base/references/role-config.md
  • tests/cli_e2e/base/base_form_detail_dryrun_test.go
  • tests/cli_e2e/base/base_form_questions_create_dryrun_test.go
  • tests/cli_e2e/base/base_skill_contract_test.go
  • tests/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

Comment thread shortcuts/base/base_form_questions_create.go
Comment thread tests/cli_e2e/base/base_form_questions_create_dryrun_test.go Outdated
@yballul-bytedance yballul-bytedance self-assigned this Jul 31, 2026
@zhouyue-bytedance
zhouyue-bytedance merged commit 5cf09ec into larksuite:main Jul 31, 2026
28 checks passed
@liangshuo-1 liangshuo-1 mentioned this pull request Jul 31, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/base PR touches the base 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.

2 participants