Skip to content

feat(sheets): add +get-revision shortcut#1602

Open
zhengzhijiej-tech wants to merge 1 commit into
feat/lark-sheets-developfrom
feat/get-revision-shortcut
Open

feat(sheets): add +get-revision shortcut#1602
zhengzhijiej-tech wants to merge 1 commit into
feat/lark-sheets-developfrom
feat/get-revision-shortcut

Conversation

@zhengzhijiej-tech

Copy link
Copy Markdown
Collaborator

What

Adds a read-only +get-revision shortcut that returns a spreadsheet's current document revision (version number).

Why

There is no lightweight way to fetch just the current revision. The existing options either return a full payload (+workbook-info lists every sub-sheet's metadata) or require reading cell data with a range (+cells-get / +csv-get). +get-revision hands callers the single number directly.

How

It is a thin read-only derivative over the existing get_workbook_structure read — the lightest read (token only, no range) — and projects the response down to the single revision field. No new backend capability is required; the revision is already present on read responses.

  • lark_sheet_get_revision.go — shortcut + projectRevision helper
  • lark_sheet_get_revision_test.go — unit test for the projection
  • shortcuts.go — registration
  • data/flag-defs.json + flag_defs_gen.go — flag definitions (mirrors +workbook-info: --url / --spreadsheet-token XOR)

Testing

  • go build ./... and go test ./shortcuts/... pass, including the flag-defs drift and registration-contract tests.
  • Manual: --dry-run renders the expected invoke_read / get_workbook_structure call; execute returns {"revision": N} matching +workbook-info; the --url and --token alias forms and the missing-locator error all behave as expected.

Return a spreadsheet's current document revision without pulling the full
sub-sheet listing. +get-revision is a read-only derivative over
get_workbook_structure (the lightest read — token only, no range) that
projects the response down to the single revision field.

Adds flag-defs entries and a unit test for the projection helper.
@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 Jun 26, 2026
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4cab37d5-4f80-459a-9b50-c9777eff619b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/get-revision-shortcut

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.

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.

1 participant