Skip to content

fix: standardize CLI shortcut text in English - #1942

Merged
caojie0621 merged 2 commits into
mainfrom
chore/lang
Jul 20, 2026
Merged

fix: standardize CLI shortcut text in English#1942
caojie0621 merged 2 commits 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 messages to consistently show English full_access only (no extra parenthetical hint).
    • Refreshed v2 --reference-map flag help text and related output expectations.
    • Clarified bot auto-grant messaging for folders/files and that overwriting via --file-token won’t change permissions on existing files.
  • Bug Fixes
    • Removed the localized permission hint from user-facing permission grant messages.
  • Tests
    • Updated assertions for revised permission-grant text and dry-run JSON fields; added coverage to ensure the permission text is used exactly as full_access.

@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

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8e710f66-b198-4f1b-bd42-c16dde1c808d

📥 Commits

Reviewing files that changed from the base of the PR and between 45647c5 and 49e20a8.

📒 Files selected for processing (6)
  • shortcuts/base/base_execute_test.go
  • shortcuts/doc/docs_create_test.go
  • shortcuts/drive/drive_create_folder_test.go
  • shortcuts/drive/drive_import_test.go
  • shortcuts/drive/drive_io_test.go
  • shortcuts/sheets/backward/lark_sheets_sheet_create_test.go
🚧 Files skipped from review as they are similar to previous changes (3)
  • shortcuts/doc/docs_create_test.go
  • shortcuts/drive/drive_io_test.go
  • shortcuts/base/base_execute_test.go

📝 Walkthrough

Walkthrough

This PR removes localized permission hints 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, upload guidance, and related assertions 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.
Dry-run output validation
shortcuts/drive/*, shortcuts/sheets/...
Tests establish bot identity and validate serialized API descriptions, upload notes, folder tokens, and updated permission-grant messages.

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 reviewers: fangshuyu-768

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.79% 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 clearly summarizes the main change: standardizing shortcut text in English.
Description check ✅ Passed The description follows the required template and includes 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@49e20a8153380f242006d3d18aff177319a03b25

🧩 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 Outdated
Comment thread shortcuts/drive/drive_import_test.go
@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 (49e20a8).
⚠️ Report is 4 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.

Comment thread shortcuts/base/base_execute_test.go
Comment thread shortcuts/drive/drive_io_test.go
Comment thread shortcuts/sheets/backward/lark_sheets_sheet_create_test.go
Comment thread shortcuts/drive/drive_import_test.go
@caojie0621
caojie0621 merged commit 6ff1022 into main Jul 20, 2026
31 of 41 checks passed
@caojie0621
caojie0621 deleted the chore/lang branch July 20, 2026 06:05
@liangshuo-1 liangshuo-1 mentioned this pull request Jul 20, 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 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.

2 participants