feat(sheets): add +get-revision shortcut#1602
Open
zhengzhijiej-tech wants to merge 1 commit into
Open
Conversation
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.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a read-only
+get-revisionshortcut 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-infolists every sub-sheet's metadata) or require reading cell data with a range (+cells-get/+csv-get).+get-revisionhands callers the single number directly.How
It is a thin read-only derivative over the existing
get_workbook_structureread — the lightest read (token only, no range) — and projects the response down to the singlerevisionfield. No new backend capability is required; the revision is already present on read responses.lark_sheet_get_revision.go— shortcut +projectRevisionhelperlark_sheet_get_revision_test.go— unit test for the projectionshortcuts.go— registrationdata/flag-defs.json+flag_defs_gen.go— flag definitions (mirrors+workbook-info:--url/--spreadsheet-tokenXOR)Testing
go build ./...andgo test ./shortcuts/...pass, including the flag-defs drift and registration-contract tests.--dry-runrenders the expectedinvoke_read/get_workbook_structurecall; execute returns{"revision": N}matching+workbook-info; the--urland--tokenalias forms and the missing-locator error all behave as expected.