Skip to content

docs(base): align record write schema guidance#2000

Merged
zgz2048 merged 3 commits into
larksuite:mainfrom
zgz2048:codex/base-record-object-schema
Jul 22, 2026
Merged

docs(base): align record write schema guidance#2000
zgz2048 merged 3 commits into
larksuite:mainfrom
zgz2048:codex/base-record-object-schema

Conversation

@zgz2048

@zgz2048 zgz2048 commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Align Base record-write guidance with the object-based batch schemas exposed by the current OpenAPI. Batch create now consistently teaches create_records, while batch update continues to teach update_records; legacy request shapes are removed from agent-facing guidance.

Changes

  • Update +record-batch-create help, tips, skill references, and workflow coverage to use one field map per create_records entry.
  • Keep create/update schema details in command help and dedicated references instead of duplicating them in the root skill.
  • Clarify that select and multiselect CellValues must use existing field options and direct agents to +field-list or +field-search-options before writing.
  • Align shortcut tests and the live workflow fixture with the record-ID-only create response.

Test Plan

  • make unit-test
  • go vet ./...
  • make fmt-check
  • node scripts/skill-format-check/index.js skills
  • Manual local help verification confirms create/update expose only create_records / update_records guidance.

Related Issues

  • None

Summary by CodeRabbit

  • Documentation

    • Updated batch record creation guidance to use the create_records JSON format.
    • Clarified that up to 200 records can be created per request.
    • Improved select and multi-select value examples and usage guidance.
    • Documented that select values must match existing field options, which can be checked before writing.
  • Tests

    • Updated command examples, validation, and end-to-end coverage for the new batch creation format.

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

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The Base batch-create payload format is updated from fields/rows to create_records, with matching CLI help, tests, workflow coverage, and documentation. Select-field guidance now distinguishes single- and multi-select values and requires existing-option verification.

Changes

Record batch create contract

Layer / File(s) Summary
CLI payload contract and test coverage
shortcuts/base/..., tests/cli_e2e/base/...
CLI examples, mocked execution, workflow data, and coverage references now use create_records; execution assertions validate record_id_list.
Batch payload and response guidance
skills/lark-base/references/lark-base-record-batch-create.md, skills/lark-base/references/lark-base-cell-value.md
Documentation defines per-record field maps, a 200-record limit, record_id_list, and optional ignored_fields.
Select field writing guidance
shortcuts/base/..., skills/lark-base/...
Help and reference text distinguish multiple=false string values from multiple=true arrays and require existing-option checks.

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

Possibly related PRs

  • larksuite/cli#277: Adds related record batch create/update shortcuts and batch-create test coverage.
  • larksuite/cli#636: Updates Base record write JSON handling by removing the legacy fields wrapper.

Suggested reviewers: liangshuo-1

🚥 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 is concise and accurately summarizes the main change: aligning Base record-write schema guidance.
Description check ✅ Passed The description follows the required template with Summary, Changes, Test Plan, and Related Issues sections filled in.
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.

@zgz2048
zgz2048 marked this pull request as ready for review July 22, 2026 09:30
kongenpei
kongenpei previously approved these changes Jul 22, 2026
@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@04c355d187d5d690db0fd6427f18894378fcea8e

🧩 Skill update

npx skills add zgz2048/cli#codex/base-record-object-schema -y -g

@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: 1

🤖 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_execute_test.go`:
- Around line 2442-2445: Update the batch-create test around
BaseRecordBatchCreate to capture the mock request, decode its CapturedBody, and
assert that the request contains both expected create_records maps while
excluding legacy fields and rows keys. Keep the existing response assertions,
and ensure the request-body assertions fail if the implementation reverts to the
legacy payload shape.
🪄 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

Run ID: 351f3138-42d5-40ec-9eb8-629f646efc63

📥 Commits

Reviewing files that changed from the base of the PR and between 54ddcf4 and 04c355d.

📒 Files selected for processing (11)
  • shortcuts/base/base_execute_test.go
  • shortcuts/base/base_shortcuts_test.go
  • shortcuts/base/field_search_options.go
  • shortcuts/base/record_batch_create.go
  • shortcuts/base/record_ops.go
  • skills/lark-base/SKILL.md
  • skills/lark-base/references/lark-base-cell-value.md
  • skills/lark-base/references/lark-base-record-batch-create.md
  • skills/lark-base/references/lark-base-record-upsert.md
  • tests/cli_e2e/base/base_record_batch_update_workflow_test.go
  • tests/cli_e2e/base/coverage.md

Comment thread shortcuts/base/base_execute_test.go
@zgz2048
zgz2048 merged commit 78bf126 into larksuite:main Jul 22, 2026
39 checks passed
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