Skip to content

fix: standardize CLI shortcut text in English#1942

Open
caojie0621 wants to merge 1 commit into
mainfrom
chore/lang
Open

fix: standardize CLI shortcut text in English#1942
caojie0621 wants to merge 1 commit into
mainfrom
chore/lang

Conversation

@caojie0621

@caojie0621 caojie0621 commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

Standardize user-facing shortcut help text, examples, permission messages, and generated resource labels in English across Docs, Drive, Sheets, Slides, and Wiki. Raw API/schema output and user-provided content are unchanged.

Changes

  • Translate the Docs --reference-map help description and keyword example into English.
  • Convert Docs IM Markdown resource labels:
    • 任务Task
    • 群聊卡片Chat card
    • 多维表格Base
  • Remove the Chinese annotation from full_access permission messages, help tips, and dry-run output.
  • Replace Chinese examples in Drive comment validation and Sheets mixed-type documentation.
  • Add and update regression tests for the English output.

Test Plan

  • Unit tests pass.
  • Manual local verification confirms the lark-cli <domain> <command> flow works as expected.
  • gofmt -l reports no formatting issues in the modified Go files.
  • git diff --check passes.

Related Issues

  • None

Summary by CodeRabbit

  • Documentation
    • Updated command help, tips, and bot-mode dry-run messaging to use consistent English permission text, showing only full_access (without any extra parenthetical hint).
    • Clarified bot auto-grant behavior across document/folder creation, including overwrite via --file-token not changing permissions on existing files.
    • Refreshed v2 --reference-map help text plus related fetch/im-markdown label and expected output updates.
  • Bug Fixes
    • Removed the localized permission hint from user-facing permission grant messages.
  • Tests
    • Updated assertions for revised permission-grant text/help output and dry-run JSON fields, and added unit coverage to ensure full_access is used as-is.

@github-actions github-actions Bot added domain/ccm PR touches the ccm domain size/L Large or sensitive change across domains or core paths labels Jul 17, 2026
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR removes the localized permission hint from full_access messages and updates bot-mode descriptions, Drive upload guidance, help text, labels, examples, and related tests to use English wording.

Changes

Permission and text updates

Layer / File(s) Summary
Permission message contract and shortcut surfaces
shortcuts/common/*, shortcuts/base/*, shortcuts/doc/*, shortcuts/drive/*, shortcuts/sheets/..., shortcuts/slides/*, shortcuts/wiki/*
Permission-grant messages now return only full_access; bot-mode descriptions, Drive upload overwrite guidance, identity setup, JSON shapes, and related tests reflect the updated wording across shortcuts.
Documentation and rendered labels
shortcuts/doc/*, shortcuts/drive/drive_add_comment.go
IM Markdown labels, keyword examples, reference-map help text, and invalid-JSON examples now use English wording, with exact expected outputs and help assertions updated.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • larksuite/cli#360: Refines shared permission-grant message construction.
  • larksuite/cli#470: Covers permission-grant outputs for Drive and Wiki shortcut flows.
  • larksuite/cli#497: Covers Base shortcut permission-grant messages affected by the shared formatting change.

Suggested labels: documentation

Suggested reviewers: wittam-01

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% 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: standardizing shortcut text in English.
Description check ✅ Passed The description matches the required template and includes a summary, changes, test plan, and related issues.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/lang

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

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@45647c5571ce3ba28739340291532fece5cad3ba

🧩 Skill update

npx skills add larksuite/cli#chore/lang -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: 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/doc/docs_create_test.go`:
- Around line 176-178: Strengthen the text assertions in
shortcuts/doc/docs_create_test.go:176-178 by comparing grant["message"] against
the complete standardized failure message rather than checking only for
“full_access”. Also update shortcuts/drive/drive_create_folder_test.go:89-95 to
assert the decoded dry-run Desc value exactly, preserving the existing test flow
and expected output contract.

In `@shortcuts/drive/drive_import_test.go`:
- Line 111: Update shortcuts/drive/drive_import_test.go:111 to assert the exact
expected bot-mode Desc value, and update
shortcuts/drive/drive_io_test.go:1103-1104 to assert the exact expected
PostUploadNote value in their respective decoded dry-run responses. Keep the
existing decoding and test flow unchanged.
🪄 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: c7d8771b-57e7-4e88-a90f-bcbe894d9ec5

📥 Commits

Reviewing files that changed from the base of the PR and between 767386c and 476befb.

📒 Files selected for processing (24)
  • shortcuts/common/permission_grant.go
  • shortcuts/common/permission_grant_test.go
  • shortcuts/doc/docs_create_test.go
  • shortcuts/doc/docs_create_v2.go
  • shortcuts/doc/docs_fetch_im_markdown.go
  • shortcuts/doc/docs_fetch_im_markdown_test.go
  • shortcuts/doc/docs_fetch_v2.go
  • shortcuts/doc/docs_fetch_v2_test.go
  • shortcuts/doc/docs_update_v2.go
  • shortcuts/doc/html5_block_resources_test.go
  • shortcuts/drive/drive_add_comment.go
  • shortcuts/drive/drive_create_folder.go
  • shortcuts/drive/drive_create_folder_test.go
  • shortcuts/drive/drive_import.go
  • shortcuts/drive/drive_import_test.go
  • shortcuts/drive/drive_io_test.go
  • shortcuts/drive/drive_permission_grant_test.go
  • shortcuts/drive/drive_upload.go
  • shortcuts/drive/shortcuts_test.go
  • shortcuts/sheets/backward/lark_sheets_sheet_create_test.go
  • shortcuts/sheets/backward/lark_sheets_spreadsheet_management.go
  • shortcuts/slides/slides_create.go
  • shortcuts/wiki/wiki_node_create.go
  • shortcuts/wiki/wiki_node_create_test.go

Comment thread shortcuts/doc/docs_create_test.go
Comment thread shortcuts/drive/drive_import_test.go Outdated

var got struct {
API []struct {
Desc string `json:"desc"`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Assert newly added dry-run fields directly.

Both tests decode new response fields without checking their values, so they can pass while the user-facing dry-run text is missing or incorrect. As per coding guidelines, add exact assertions for each field.

  • shortcuts/drive/drive_import_test.go#L111-L111: assert the expected bot-mode Desc.
  • shortcuts/drive/drive_io_test.go#L1103-L1104: assert the expected PostUploadNote.
📍 Affects 2 files
  • shortcuts/drive/drive_import_test.go#L111-L111 (this comment)
  • shortcuts/drive/drive_io_test.go#L1103-L1104
🤖 Prompt for 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.

In `@shortcuts/drive/drive_import_test.go` at line 111, Update
shortcuts/drive/drive_import_test.go:111 to assert the exact expected bot-mode
Desc value, and update shortcuts/drive/drive_io_test.go:1103-1104 to assert the
exact expected PostUploadNote value in their respective decoded dry-run
responses. Keep the existing decoding and test flow unchanged.

Source: Coding guidelines

@github-actions github-actions Bot added domain/base PR touches the base domain size/XL Architecture-level or global-impact change and removed size/L Large or sensitive change across domains or core paths labels Jul 17, 2026
- translate Docs create and update help descriptions
- remove localized permission annotations
- replace Chinese examples and fallback text
- use English labels for Docs IM Markdown resources
- update regression tests for English output

@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/drive/drive_create_folder_test.go`:
- Line 93: Update the test’s final API assertions to directly verify the decoded
Desc field with an exact expected dry-run text string. Use the existing decoded
response variable and assertion style, ensuring the newly added Desc contract is
validated alongside the other fields.
🪄 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: d188a996-66ba-4d02-ab1d-472aa71bac57

📥 Commits

Reviewing files that changed from the base of the PR and between 7474ffd and 45647c5.

📒 Files selected for processing (26)
  • shortcuts/base/base_execute_test.go
  • shortcuts/base/base_ops.go
  • shortcuts/common/permission_grant.go
  • shortcuts/common/permission_grant_test.go
  • shortcuts/doc/docs_create_test.go
  • shortcuts/doc/docs_create_v2.go
  • shortcuts/doc/docs_fetch_im_markdown.go
  • shortcuts/doc/docs_fetch_im_markdown_test.go
  • shortcuts/doc/docs_fetch_v2.go
  • shortcuts/doc/docs_fetch_v2_test.go
  • shortcuts/doc/docs_update_v2.go
  • shortcuts/doc/html5_block_resources_test.go
  • shortcuts/drive/drive_add_comment.go
  • shortcuts/drive/drive_create_folder.go
  • shortcuts/drive/drive_create_folder_test.go
  • shortcuts/drive/drive_import.go
  • shortcuts/drive/drive_import_test.go
  • shortcuts/drive/drive_io_test.go
  • shortcuts/drive/drive_permission_grant_test.go
  • shortcuts/drive/drive_upload.go
  • shortcuts/drive/shortcuts_test.go
  • shortcuts/sheets/backward/lark_sheets_sheet_create_test.go
  • shortcuts/sheets/backward/lark_sheets_spreadsheet_management.go
  • shortcuts/slides/slides_create.go
  • shortcuts/wiki/wiki_node_create.go
  • shortcuts/wiki/wiki_node_create_test.go
🚧 Files skipped from review as they are similar to previous changes (23)
  • shortcuts/sheets/backward/lark_sheets_spreadsheet_management.go
  • shortcuts/common/permission_grant_test.go
  • shortcuts/drive/drive_add_comment.go
  • shortcuts/doc/docs_fetch_v2.go
  • shortcuts/wiki/wiki_node_create.go
  • shortcuts/doc/docs_update_v2.go
  • shortcuts/doc/docs_fetch_im_markdown_test.go
  • shortcuts/drive/drive_permission_grant_test.go
  • shortcuts/base/base_ops.go
  • shortcuts/doc/html5_block_resources_test.go
  • shortcuts/doc/docs_create_v2.go
  • shortcuts/wiki/wiki_node_create_test.go
  • shortcuts/drive/drive_io_test.go
  • shortcuts/doc/docs_create_test.go
  • shortcuts/drive/drive_create_folder.go
  • shortcuts/slides/slides_create.go
  • shortcuts/drive/drive_upload.go
  • shortcuts/doc/docs_fetch_im_markdown.go
  • shortcuts/common/permission_grant.go
  • shortcuts/sheets/backward/lark_sheets_sheet_create_test.go
  • shortcuts/drive/drive_import.go
  • shortcuts/doc/docs_fetch_v2_test.go
  • shortcuts/base/base_execute_test.go

Comment thread shortcuts/drive/drive_create_folder_test.go
@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.25000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.03%. Comparing base (767386c) to head (45647c5).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
shortcuts/doc/docs_create_v2.go 0.00% 1 Missing ⚠️
shortcuts/slides/slides_create.go 0.00% 1 Missing ⚠️
shortcuts/wiki/wiki_node_create.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1942      +/-   ##
==========================================
+ Coverage   74.96%   75.03%   +0.06%     
==========================================
  Files         892      894       +2     
  Lines       94077    94294     +217     
==========================================
+ Hits        70529    70752     +223     
+ Misses      18137    18134       -3     
+ Partials     5411     5408       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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 domain/ccm PR touches the ccm domain size/XL Architecture-level or global-impact change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant