Skip to content

refactor(docs): remove v1 execution paths and standardize on v2#1291

Merged
SunPeiYang996 merged 1 commit into
mainfrom
sun/chore
Jun 8, 2026
Merged

refactor(docs): remove v1 execution paths and standardize on v2#1291
SunPeiYang996 merged 1 commit into
mainfrom
sun/chore

Conversation

@SunPeiYang996

@SunPeiYang996 SunPeiYang996 commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

refactor(docs): remove v1 execution paths and standardize on v2

Summary

This PR removes the legacy docs v1 shortcut implementation and makes docs +create, docs +fetch, and docs +update always use the docs v2/OpenAPI flow.

It keeps rollback-safe compatibility parsing for deprecated flags such as --api-version v1, but both v1 and v2 now execute the v2 path. Legacy v1-only flags are hidden and rejected with structured, actionable migration errors
that point users and AI agents to the current lark-cli skills read lark-doc ... guidance.

Key Changes

  • Removed docs v1 create/fetch/update execution paths and related v1-only helpers.
  • Deleted obsolete markdown-fix and update-check logic that only supported the old v1 workflow.
  • Added shared v2-only validation for deprecated docs flags and API version compatibility.
  • Updated docs command help to direct AI agents to embedded skill content via lark-cli skills read.
  • Updated lark-doc skill references and docs E2E coverage to reflect the v2-only workflow.
  • Adjusted unit and dry-run E2E tests to verify docs commands default to the docs v2/OpenAPI endpoints and reject unsupported legacy flags with migration guidance.

Summary by CodeRabbit

Release Notes

  • New Features

    • Docs shortcuts now expose v2 flags (--content, --doc-format, --parent-token) for improved usability.
  • Improvements

    • Consolidated docs +create, docs +fetch, and docs +update to exclusively use v2 (OpenAPI) endpoints; v1 (MCP) support removed.
    • Deprecated --api-version flag now hidden but still accepted for backward compatibility.
    • Legacy flags retained as hidden for compatibility but no longer appear in help.
    • Simplified help text and removed version-selection messaging.
  • Documentation

    • Updated skill documentation to remove v2-requirement callouts.

@github-actions github-actions Bot added domain/ccm PR touches the ccm domain size/XL Architecture-level or global-impact change labels Jun 5, 2026
@coderabbitai

coderabbitai Bot commented Jun 5, 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
📝 Walkthrough

Walkthrough

Docs shortcuts (+create, +fetch, +update) are migrated to v2-only behavior by introducing shared API-version and legacy-flag validation, removing v1/MCP support and v1 routing, unifying help to embedded-skill guidance, and updating unit tests, E2E tests, and skill documentation to reflect the v2-only shape.

Changes

Docs shortcuts v2-only migration

Layer / File(s) Summary
V2-only validation and legacy flag framework
shortcuts/doc/v2_only.go, shortcuts/doc/v2_only_test.go
New docsAPIVersionCompatFlag() provides a v2-default api-version flag; legacy v1 flag maps for create/fetch/update are defined and converted to hidden parse-only common.Flags; validateDocsV2Only() enforces accepted values and rejects used legacy flags with formatted guidance; unit tests updated for allowed/rejected cases.
Create/fetch/update rewiring to v2
shortcuts/doc/docs_create.go, shortcuts/doc/docs_create_v2.go, shortcuts/doc/docs_fetch.go, shortcuts/doc/docs_fetch_v2.go, shortcuts/doc/docs_update.go, shortcuts/doc/docs_update_v2.go
DocsCreate, DocsFetch, DocsUpdate remove v1/v2 auto-detection; Validate, DryRun, Execute unconditionally call v2 handlers; v2-only validation inserted early; v2 flags made visible; v1 flags retained only as hidden parse-only compat flags; post-mount help switched to installDocsShortcutHelp("+...").
Docs help text refactoring to embedded-skill guidance
shortcuts/doc/shortcuts.go
Removes version-selection tips and dynamic help overrides; introduces embedded-skill read-command variants and maps each shortcut to a consistent docsHelpLong() parent/shortcut help presentation.
Shortcut registration and help assertions
shortcuts/register_test.go
Docs root help tests updated to expect embedded-skill "Start here" guidance (no Tips/v1 upgrade text), ensure --api-version is present as a v2-default visible flag while legacy flags are hidden, and replace versioned-help tests with table-driven v2-only expectations.
Unit tests for v2-only shortcut behavior
shortcuts/doc/docs_create_test.go, shortcuts/doc/docs_fetch_v2_test.go, shortcuts/doc/docs_update_test.go
Removed V1/MCP tests; added V2-focused tests asserting --api-version acceptance for allowed values and explicit rejections (with replacement guidance) for legacy flags (--title, --markdown, --offset, --mode); added test runtime helpers.
E2E tests and documentation alignment
tests/cli_e2e/docs/docs_update_dryrun_test.go, tests/cli_e2e/docs/docs_create_fetch_test.go, tests/cli_e2e/docs/docs_update_test.go, tests/cli_e2e/docs/helpers_test.go, tests/cli_e2e/docs/coverage.md, skills/lark-doc/SKILL.md, skills/lark-doc/references/*
E2E dry-run test replaced to verify v2 OpenAPI defaults and absence of MCP/--api-version prompts; create/fetch/update E2E flows updated to use --parent-token/--content/--doc-format markdown and parse v2 response shapes (data.document.content, data.document.document_id); skill docs updated to remove lark-shared/SKILL.md prerequisite and refresh references.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • larksuite/cli#469: Overlaps on removal of shortcuts/doc/markdown_fix.go and its markdown normalization logic.
  • larksuite/cli#638: Foundation for v2 routing and implementations which this PR then consolidates into unconditional v2 handlers.
  • larksuite/cli#710: Related changes to docs help/tips wiring that may overlap or conflict with this PR’s help refactor.

Suggested labels

documentation

Suggested reviewers

  • fangshuyu-768
  • liangshuo-1

🐰 A rabbit's ode to v2's glow:

Version one had gone astray,
Two hops forward, bright as day.
Hidden flags now tucked away,
Embedded reads show the way —
Hooray for v2, let’s play! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 31.96% 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
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.
Title check ✅ Passed The title clearly and concisely summarizes the main objective: removing v1 execution paths and standardizing the docs shortcuts on v2, which aligns with the substantial refactoring evident across the 20+ modified files.
Description check ✅ Passed The PR description covers the motivation, key changes, and provides comprehensive context, though it lacks explicit Test Plan and Related Issues sections as specified in the template.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 sun/chore

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 and usage tips.

@codecov

codecov Bot commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.64706% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.33%. Comparing base (9d84544) to head (2d34418).

Files with missing lines Patch % Lines
shortcuts/doc/shortcuts.go 86.11% 5 Missing ⚠️
shortcuts/doc/docs_fetch.go 50.00% 2 Missing ⚠️
shortcuts/doc/docs_update.go 50.00% 2 Missing ⚠️
shortcuts/doc/docs_create.go 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1291      +/-   ##
==========================================
+ Coverage   71.20%   71.33%   +0.12%     
==========================================
  Files         688      686       -2     
  Lines       65997    65369     -628     
==========================================
- Hits        46996    46631     -365     
+ Misses      15340    15089     -251     
+ Partials     3661     3649      -12     

☔ 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.

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@2d344186beb4d15d02b4ecba38c4063e19b9ec99

🧩 Skill update

npx skills add larksuite/cli#sun/chore -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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/cli_e2e/docs/docs_update_dryrun_test.go (1)

16-23: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Isolate config-dir state in this E2E dry-run test setup.

The test sets credential env vars but leaves config-dir shared, which can make dry-run assertions sensitive to local config state.

Suggested patch
 func TestDocs_DryRunDefaultsToV2OpenAPI(t *testing.T) {
 	// Fake creds are enough — dry-run short-circuits before any real API call.
 	t.Setenv("LARKSUITE_CLI_APP_ID", "app")
 	t.Setenv("LARKSUITE_CLI_APP_SECRET", "secret")
 	t.Setenv("LARKSUITE_CLI_BRAND", "feishu")
+	t.Setenv("LARKSUITE_CLI_CONFIG_DIR", t.TempDir())

As per coding guidelines: **/*_test.go: Use t.Setenv("LARKSUITE_CLI_CONFIG_DIR", t.TempDir()) to isolate config state in tests.

🤖 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 `@tests/cli_e2e/docs/docs_update_dryrun_test.go` around lines 16 - 23, In
TestDocs_DryRunDefaultsToV2OpenAPI add isolation for the CLI config dir by
calling t.Setenv("LARKSUITE_CLI_CONFIG_DIR", t.TempDir()) (e.g., immediately
after setting the other env vars and before creating the context) so the test
uses a fresh temp config directory; update the
TestDocs_DryRunDefaultsToV2OpenAPI function to include this call.
🤖 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_update_test.go`:
- Around line 106-135: newUpdateShortcutTestRuntime currently doesn't isolate
LARKSUITE_CLI_CONFIG_DIR and can leak config between parallel tests; update the
helper (newUpdateShortcutTestRuntime) to call
t.Setenv("LARKSUITE_CLI_CONFIG_DIR", t.TempDir()) early in the function so each
test gets its own temporary config dir before creating the cobra.Command and
flags.

---

Outside diff comments:
In `@tests/cli_e2e/docs/docs_update_dryrun_test.go`:
- Around line 16-23: In TestDocs_DryRunDefaultsToV2OpenAPI add isolation for the
CLI config dir by calling t.Setenv("LARKSUITE_CLI_CONFIG_DIR", t.TempDir())
(e.g., immediately after setting the other env vars and before creating the
context) so the test uses a fresh temp config directory; update the
TestDocs_DryRunDefaultsToV2OpenAPI function to include this call.
🪄 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: e352719b-7cf5-480c-b50f-633253c120b1

📥 Commits

Reviewing files that changed from the base of the PR and between f3949f0 and 5e26cb6.

📒 Files selected for processing (30)
  • cmd/build.go
  • cmd/skill/skill.go
  • cmd/skill/skill_test.go
  • internal/skillcontent/reader.go
  • internal/skillcontent/reader_test.go
  • shortcuts/doc/code_fence.go
  • shortcuts/doc/docs_create.go
  • shortcuts/doc/docs_create_test.go
  • shortcuts/doc/docs_create_v2.go
  • shortcuts/doc/docs_fetch.go
  • shortcuts/doc/docs_fetch_v2.go
  • shortcuts/doc/docs_fetch_v2_test.go
  • shortcuts/doc/docs_update.go
  • shortcuts/doc/docs_update_check.go
  • shortcuts/doc/docs_update_check_test.go
  • shortcuts/doc/docs_update_test.go
  • shortcuts/doc/docs_update_v2.go
  • shortcuts/doc/get_skill.go
  • shortcuts/doc/shortcuts.go
  • shortcuts/doc/v2_only.go
  • shortcuts/doc/v2_only_test.go
  • shortcuts/doc/versioned_help.go
  • shortcuts/doc/versioned_help_test.go
  • shortcuts/register_test.go
  • skills_embed.go
  • tests/cli_e2e/docs/coverage.md
  • tests/cli_e2e/docs/docs_create_fetch_test.go
  • tests/cli_e2e/docs/docs_update_dryrun_test.go
  • tests/cli_e2e/docs/docs_update_test.go
  • tests/cli_e2e/docs/helpers_test.go
💤 Files with no reviewable changes (4)
  • shortcuts/doc/versioned_help.go
  • shortcuts/doc/docs_update_check_test.go
  • shortcuts/doc/docs_update_check.go
  • shortcuts/doc/versioned_help_test.go

Comment thread shortcuts/doc/docs_update_test.go

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
shortcuts/doc/docs_update_v2.go (1)

61-64: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

str_replace cannot reliably carry an explicit empty replacement

At Line 156, content is only serialized when non-empty, so --content "" gets dropped from the request body. That conflicts with the stated behavior that empty content deletes matches and makes omission vs explicit-empty indistinguishable.

💡 Proposed fix
 	case "str_replace":
 		if pattern == "" {
 			return common.FlagErrorf("--command str_replace requires --pattern")
 		}
+		if !runtime.Changed("content") {
+			return common.FlagErrorf("--command str_replace requires --content (use --content \"\" to delete match)")
+		}
@@
-	if v := runtime.Str("content"); v != "" {
-		body["content"] = v
-	}
+	if runtime.Changed("content") {
+		body["content"] = runtime.Str("content")
+	}

Also applies to: 156-158

🤖 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/doc/docs_update_v2.go` around lines 61 - 64, The request body drops
an explicit empty replacement because the serialization omits content when it's
"", making omission indistinguishable from explicit-empty for the "str_replace"
command; modify the code that builds the request payload so the content field is
always included when the user provided the --content flag (even if empty) —
e.g., track presence of the flag or switch the payload field to a *string (or
explicit boolean like ContentSet) and set it to "" (or pointer to "") when the
flag was passed; update the "str_replace" case and the serialization logic that
currently skips content (around the content serialization at lines ~156-158) to
ensure the content key is present in the sent JSON when intended.
🤖 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/v2_only.go`:
- Around line 52-59: docsLegacyFlagDefinitions currently registers legacy flags
without their type metadata, causing Cobra to parse booleans/ints incorrectly
before validateDocsV2Only runs; update docsLegacyFlagDefinitions to copy the
legacy flag's type information into the generated common.Flag (e.g., set the
Type/Kind field on common.Flag from the docsLegacyFlag.Type or similar
identifier) so the parser treats legacy flags with their original types and only
validation/redirect happens in validateDocsV2Only; locate
docsLegacyFlagDefinitions and docsLegacyFlag and ensure the common.Flag
construction includes the legacy type field when appending.

---

Outside diff comments:
In `@shortcuts/doc/docs_update_v2.go`:
- Around line 61-64: The request body drops an explicit empty replacement
because the serialization omits content when it's "", making omission
indistinguishable from explicit-empty for the "str_replace" command; modify the
code that builds the request payload so the content field is always included
when the user provided the --content flag (even if empty) — e.g., track presence
of the flag or switch the payload field to a *string (or explicit boolean like
ContentSet) and set it to "" (or pointer to "") when the flag was passed; update
the "str_replace" case and the serialization logic that currently skips content
(around the content serialization at lines ~156-158) to ensure the content key
is present in the sent JSON when intended.
🪄 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: 663a70ae-59f3-498e-85dc-50b7774eaaa4

📥 Commits

Reviewing files that changed from the base of the PR and between 5e26cb6 and 16a28de.

📒 Files selected for processing (30)
  • shortcuts/doc/docs_create.go
  • shortcuts/doc/docs_create_test.go
  • shortcuts/doc/docs_create_v2.go
  • shortcuts/doc/docs_fetch.go
  • shortcuts/doc/docs_fetch_v2.go
  • shortcuts/doc/docs_fetch_v2_test.go
  • shortcuts/doc/docs_update.go
  • shortcuts/doc/docs_update_check.go
  • shortcuts/doc/docs_update_check_test.go
  • shortcuts/doc/docs_update_test.go
  • shortcuts/doc/docs_update_v2.go
  • shortcuts/doc/markdown_fix.go
  • shortcuts/doc/markdown_fix_hardening_test.go
  • shortcuts/doc/markdown_fix_test.go
  • shortcuts/doc/shortcuts.go
  • shortcuts/doc/v2_only.go
  • shortcuts/doc/v2_only_test.go
  • shortcuts/doc/versioned_help.go
  • shortcuts/doc/versioned_help_test.go
  • shortcuts/register_test.go
  • skills/lark-doc/SKILL.md
  • skills/lark-doc/references/lark-doc-create.md
  • skills/lark-doc/references/lark-doc-fetch.md
  • skills/lark-doc/references/lark-doc-md.md
  • skills/lark-doc/references/lark-doc-update.md
  • tests/cli_e2e/docs/coverage.md
  • tests/cli_e2e/docs/docs_create_fetch_test.go
  • tests/cli_e2e/docs/docs_update_dryrun_test.go
  • tests/cli_e2e/docs/docs_update_test.go
  • tests/cli_e2e/docs/helpers_test.go
💤 Files with no reviewable changes (7)
  • shortcuts/doc/markdown_fix_hardening_test.go
  • shortcuts/doc/markdown_fix_test.go
  • shortcuts/doc/versioned_help_test.go
  • shortcuts/doc/docs_update_check_test.go
  • shortcuts/doc/markdown_fix.go
  • shortcuts/doc/docs_update_check.go
  • shortcuts/doc/versioned_help.go
✅ Files skipped from review due to trivial changes (4)
  • skills/lark-doc/references/lark-doc-md.md
  • skills/lark-doc/SKILL.md
  • skills/lark-doc/references/lark-doc-fetch.md
  • tests/cli_e2e/docs/coverage.md
🚧 Files skipped from review as they are similar to previous changes (12)
  • tests/cli_e2e/docs/docs_create_fetch_test.go
  • tests/cli_e2e/docs/docs_update_test.go
  • tests/cli_e2e/docs/helpers_test.go
  • shortcuts/doc/docs_fetch_v2_test.go
  • shortcuts/doc/docs_create_v2.go
  • shortcuts/doc/docs_update.go
  • shortcuts/doc/docs_fetch_v2.go
  • tests/cli_e2e/docs/docs_update_dryrun_test.go
  • shortcuts/doc/v2_only_test.go
  • shortcuts/doc/docs_update_test.go
  • shortcuts/doc/docs_fetch.go
  • shortcuts/doc/docs_create_test.go

Comment thread shortcuts/doc/v2_only.go

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/cli_e2e/docs/docs_update_dryrun_test.go (1)

18-20: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add config-dir isolation for this E2E test setup.

This test sets credential env vars but does not isolate CLI config state, which can make outcomes depend on host/user config.

Suggested patch
 func TestDocs_DryRunDefaultsToV2OpenAPI(t *testing.T) {
 	// Fake creds are enough — dry-run short-circuits before any real API call.
+	t.Setenv("LARKSUITE_CLI_CONFIG_DIR", t.TempDir())
 	t.Setenv("LARKSUITE_CLI_APP_ID", "app")
 	t.Setenv("LARKSUITE_CLI_APP_SECRET", "secret")
 	t.Setenv("LARKSUITE_CLI_BRAND", "feishu")

As per coding guidelines: **/*_test.go: Use t.Setenv("LARKSUITE_CLI_CONFIG_DIR", t.TempDir()) to isolate config state in tests.

🤖 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 `@tests/cli_e2e/docs/docs_update_dryrun_test.go` around lines 18 - 20, The test
currently sets credential env vars but doesn't isolate CLI config state; add a
call to set LARKSUITE_CLI_CONFIG_DIR to a temporary directory (use
t.Setenv("LARKSUITE_CLI_CONFIG_DIR", t.TempDir())) alongside the existing
t.Setenv calls so the test uses an isolated config directory and does not depend
on host/user config; place this new t.Setenv immediately with the other env
setup in the test function.

Source: Coding guidelines

🤖 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.

Outside diff comments:
In `@tests/cli_e2e/docs/docs_update_dryrun_test.go`:
- Around line 18-20: The test currently sets credential env vars but doesn't
isolate CLI config state; add a call to set LARKSUITE_CLI_CONFIG_DIR to a
temporary directory (use t.Setenv("LARKSUITE_CLI_CONFIG_DIR", t.TempDir()))
alongside the existing t.Setenv calls so the test uses an isolated config
directory and does not depend on host/user config; place this new t.Setenv
immediately with the other env setup in the test function.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 97fa37ed-e19b-4992-a425-9049bcb2f963

📥 Commits

Reviewing files that changed from the base of the PR and between 16a28de and e063e75.

📒 Files selected for processing (37)
  • cmd/build.go
  • cmd/skill/skill.go
  • cmd/skill/skill_test.go
  • internal/cmdutil/factory.go
  • internal/skillcontent/reader.go
  • internal/skillcontent/reader_test.go
  • shortcuts/doc/docs_create.go
  • shortcuts/doc/docs_create_test.go
  • shortcuts/doc/docs_create_v2.go
  • shortcuts/doc/docs_fetch.go
  • shortcuts/doc/docs_fetch_v2.go
  • shortcuts/doc/docs_fetch_v2_test.go
  • shortcuts/doc/docs_update.go
  • shortcuts/doc/docs_update_check.go
  • shortcuts/doc/docs_update_check_test.go
  • shortcuts/doc/docs_update_test.go
  • shortcuts/doc/docs_update_v2.go
  • shortcuts/doc/markdown_fix.go
  • shortcuts/doc/markdown_fix_hardening_test.go
  • shortcuts/doc/markdown_fix_test.go
  • shortcuts/doc/shortcuts.go
  • shortcuts/doc/v2_only.go
  • shortcuts/doc/v2_only_test.go
  • shortcuts/doc/versioned_help.go
  • shortcuts/doc/versioned_help_test.go
  • shortcuts/register_test.go
  • skills/lark-doc/SKILL.md
  • skills/lark-doc/references/lark-doc-create.md
  • skills/lark-doc/references/lark-doc-fetch.md
  • skills/lark-doc/references/lark-doc-md.md
  • skills/lark-doc/references/lark-doc-update.md
  • skills_embed.go
  • tests/cli_e2e/docs/coverage.md
  • tests/cli_e2e/docs/docs_create_fetch_test.go
  • tests/cli_e2e/docs/docs_update_dryrun_test.go
  • tests/cli_e2e/docs/docs_update_test.go
  • tests/cli_e2e/docs/helpers_test.go
💤 Files with no reviewable changes (7)
  • shortcuts/doc/docs_update_check_test.go
  • shortcuts/doc/versioned_help_test.go
  • shortcuts/doc/markdown_fix.go
  • shortcuts/doc/markdown_fix_test.go
  • shortcuts/doc/docs_update_check.go
  • shortcuts/doc/markdown_fix_hardening_test.go
  • shortcuts/doc/versioned_help.go
✅ Files skipped from review due to trivial changes (5)
  • skills/lark-doc/SKILL.md
  • skills/lark-doc/references/lark-doc-md.md
  • skills/lark-doc/references/lark-doc-update.md
  • skills/lark-doc/references/lark-doc-fetch.md
  • tests/cli_e2e/docs/coverage.md
🚧 Files skipped from review as they are similar to previous changes (16)
  • shortcuts/doc/docs_update_v2.go
  • skills/lark-doc/references/lark-doc-create.md
  • tests/cli_e2e/docs/helpers_test.go
  • shortcuts/doc/docs_fetch_v2.go
  • shortcuts/doc/docs_create_v2.go
  • shortcuts/doc/shortcuts.go
  • shortcuts/doc/docs_fetch_v2_test.go
  • shortcuts/doc/docs_update.go
  • tests/cli_e2e/docs/docs_update_test.go
  • shortcuts/doc/docs_create_test.go
  • shortcuts/doc/v2_only_test.go
  • internal/skillcontent/reader_test.go
  • shortcuts/doc/docs_fetch.go
  • shortcuts/doc/docs_update_test.go
  • shortcuts/doc/docs_create.go
  • shortcuts/register_test.go

Change-Id: I29d0af3e5325261f94949d3ab3f65051fb6bd52b

@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.

♻️ Duplicate comments (1)
shortcuts/doc/v2_only.go (1)

52-62: ⚠️ Potential issue | 🟠 Major | ⚖️ Poor tradeoff

Hidden compatibility flags should preserve legacy flag types.

The docsLegacyFlagDefinitions function registers legacy flags without type metadata. This can cause Cobra parse errors for boolean/integer legacy flags before validateDocsV2Only runs, preventing users from receiving the intended v2-only guidance error.

🤖 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/doc/v2_only.go` around lines 52 - 62, The docsLegacyFlagDefinitions
function is registering legacy flags without preserving their type, which causes
Cobra to parse booleans/integers incorrectly before validateDocsV2Only runs;
update docsLegacyFlagDefinitions to copy the flag.Type (and any other necessary
metadata like Default/Value if present on docsLegacyFlag) into the returned
common.Flag so the legacy flag Type is preserved when creating the common.Flag
(referencing docsLegacyFlag and common.Flag) and ensure validateDocsV2Only still
performs the v2-only guidance check.
🤖 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.

Duplicate comments:
In `@shortcuts/doc/v2_only.go`:
- Around line 52-62: The docsLegacyFlagDefinitions function is registering
legacy flags without preserving their type, which causes Cobra to parse
booleans/integers incorrectly before validateDocsV2Only runs; update
docsLegacyFlagDefinitions to copy the flag.Type (and any other necessary
metadata like Default/Value if present on docsLegacyFlag) into the returned
common.Flag so the legacy flag Type is preserved when creating the common.Flag
(referencing docsLegacyFlag and common.Flag) and ensure validateDocsV2Only still
performs the v2-only guidance check.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 555d85e2-51cf-44eb-8fc1-6bdbaa28cd2e

📥 Commits

Reviewing files that changed from the base of the PR and between 827b302 and 2d34418.

📒 Files selected for processing (30)
  • shortcuts/doc/docs_create.go
  • shortcuts/doc/docs_create_test.go
  • shortcuts/doc/docs_create_v2.go
  • shortcuts/doc/docs_fetch.go
  • shortcuts/doc/docs_fetch_v2.go
  • shortcuts/doc/docs_fetch_v2_test.go
  • shortcuts/doc/docs_update.go
  • shortcuts/doc/docs_update_check.go
  • shortcuts/doc/docs_update_check_test.go
  • shortcuts/doc/docs_update_test.go
  • shortcuts/doc/docs_update_v2.go
  • shortcuts/doc/markdown_fix.go
  • shortcuts/doc/markdown_fix_hardening_test.go
  • shortcuts/doc/markdown_fix_test.go
  • shortcuts/doc/shortcuts.go
  • shortcuts/doc/v2_only.go
  • shortcuts/doc/v2_only_test.go
  • shortcuts/doc/versioned_help.go
  • shortcuts/doc/versioned_help_test.go
  • shortcuts/register_test.go
  • skills/lark-doc/SKILL.md
  • skills/lark-doc/references/lark-doc-create.md
  • skills/lark-doc/references/lark-doc-fetch.md
  • skills/lark-doc/references/lark-doc-md.md
  • skills/lark-doc/references/lark-doc-update.md
  • tests/cli_e2e/docs/coverage.md
  • tests/cli_e2e/docs/docs_create_fetch_test.go
  • tests/cli_e2e/docs/docs_update_dryrun_test.go
  • tests/cli_e2e/docs/docs_update_test.go
  • tests/cli_e2e/docs/helpers_test.go
💤 Files with no reviewable changes (7)
  • shortcuts/doc/markdown_fix_test.go
  • shortcuts/doc/docs_update_check.go
  • shortcuts/doc/versioned_help_test.go
  • shortcuts/doc/docs_update_check_test.go
  • shortcuts/doc/versioned_help.go
  • shortcuts/doc/markdown_fix.go
  • shortcuts/doc/markdown_fix_hardening_test.go
✅ Files skipped from review due to trivial changes (5)
  • skills/lark-doc/references/lark-doc-md.md
  • skills/lark-doc/references/lark-doc-fetch.md
  • skills/lark-doc/SKILL.md
  • skills/lark-doc/references/lark-doc-update.md
  • tests/cli_e2e/docs/coverage.md
🚧 Files skipped from review as they are similar to previous changes (13)
  • tests/cli_e2e/docs/docs_create_fetch_test.go
  • tests/cli_e2e/docs/docs_update_test.go
  • skills/lark-doc/references/lark-doc-create.md
  • shortcuts/doc/docs_create_v2.go
  • tests/cli_e2e/docs/helpers_test.go
  • shortcuts/doc/docs_update_v2.go
  • shortcuts/doc/shortcuts.go
  • shortcuts/doc/docs_fetch_v2.go
  • tests/cli_e2e/docs/docs_update_dryrun_test.go
  • shortcuts/doc/docs_fetch.go
  • shortcuts/doc/docs_update.go
  • shortcuts/doc/docs_create.go
  • shortcuts/register_test.go

@SunPeiYang996 SunPeiYang996 changed the title Sun/chore Remove docs v1 api Jun 8, 2026
@fangshuyu-768 fangshuyu-768 changed the title Remove docs v1 api refactor(docs): remove v1 execution paths and standardize on v2 Jun 8, 2026
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/XL Architecture-level or global-impact change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants