Skip to content

feat(docs): upload local image and source resources#1864

Open
SunPeiYang996 wants to merge 1 commit into
mainfrom
sun/lark-cli-local-resources
Open

feat(docs): upload local image and source resources#1864
SunPeiYang996 wants to merge 1 commit into
mainfrom
sun/lark-cli-local-resources

Conversation

@SunPeiYang996

@SunPeiYang996 SunPeiYang996 commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add first-class local resource support to lark-cli docs v2:

  • XML: <img path="@relative/path.png"> and <source path="@relative/file.pdf">
  • Markdown: ![alt](@relative/path.png) plus <source path="@relative/file.pdf">
  • docs +create and docs +update, including append and block_insert_after
  • user and bot identities, and both Docx and Wiki URLs

The CLI validates local resources, sends only opaque placeholder markers to Docs AI, receives the new block_id / block_type, uploads the real media, and binds the uploaded token to the placeholder block. Real local paths are never persisted or returned by the document service.

What changed

  • Added local image and source discovery for XML and Markdown input.
  • Added cwd-confined path validation and resource metadata collection.
  • Added image/file upload and placeholder binding for create and update flows.
  • Added retry, pacing, stable client token/revision, ambiguous-response verification, failed-placeholder cleanup, 20-item bind batching, and multipart upload for files larger than 20 MiB.
  • Preserved image captions/titles and source name, MIME type, size, and token across XML/Markdown fetches.
  • Updated lark-doc skill documentation and CLI docs.
  • Added permanent workflow, parser, validation, upload, bind, cleanup, and round-trip tests.

Safety and compatibility

  • Rejects missing files, directories, empty files, path traversal, symlink escape, and reserved internal markers before document mutation.
  • Ignores resource-like syntax in inert Markdown contexts.
  • Existing remote-resource and ordinary Docs v2 behavior is unchanged.
  • No OpenAPI, IDL, or ai_edit RPC contract changes are required.
  • Local paths never leave the CLI; server-side correlation uses random opaque markers such as @lcli_img_<32hex> and @lcli_file_<32hex>.

Cross-repository dependency chain

Recommended merge/deploy order:

  1. DocX engine — preserve <source name> during XML export: https://code.byted.org/larkdoc/docx_engine/merge_requests/2928
  2. DocxXML SDK — create and return local-resource placeholders: https://code.byted.org/lark/office_ai_sdk/merge_requests/184
  3. ai_edit — consume SDK v0.0.62-0.20260713111932-3aa1d6116278: https://code.byted.org/ccm-platform/ai_edit/merge_requests/176
  4. This lark-cli PR

PPE versions used for acceptance:

  • creation/docx/engine 1.0.0.9466
  • creation/platform/ai_edit 1.0.0.574
  • DocxXML SDK 3aa1d6116278
  • PPE lane ppe_sun_ai_test

Verification

Pre-merge validation:

  • make vet build unit-test — pass
  • make fmt-check script-test — pass, including 103 script tests
  • go mod tidy — no diff
  • golangci-lint — 0 findings
  • Static review — no P0/P1/P2 findings after fixing quoted Markdown image titles containing )

True PPE E2E:

  • 59/59 passed
  • 41/41 functional cases and 18/18 lifecycle cases
  • user + bot, XML + Markdown, image + source, create + update
  • real Wiki and Docx URLs
  • 20 MiB+ multipart source upload
  • 21 resources with observed 20+1 bind batches
  • TOCTOU cleanup and negative path/authentication cases
  • 189 JSON outputs parsed and validated
  • 8/8 test documents deleted and verified with 3380003
  • no marker, local-path, credential, or raw-artifact leakage

Full report: https://bytedance.larkoffice.com/docx/LFg3db8YZo5jh3xqSVhcnanHnYb

Rollback

Revert this PR to remove CLI-side local resource detection/upload/bind behavior. The feature has no persistent client migration. If the server chain is also rolled back, revert in reverse order: ai_edit, SDK, then engine. Documents already created contain normal image/file blocks and remain readable.

Summary by CodeRabbit

  • New Features

    • Added support for inserting local images and attachments into documents using XML or Markdown.
    • Local resources are automatically uploaded, linked, and represented with real media tokens after creation or supported updates.
    • Added dry-run visibility for local resource uploads, binding, and cleanup operations.
    • Added configurable pacing between multipart upload requests.
  • Bug Fixes

    • Improved handling of partial resource failures and cleanup.
    • Clarified errors when operations target unsupported document types.
  • Documentation

    • Documented local resource syntax, validation rules, update restrictions, and partial-failure behavior.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

The PR adds local image and attachment handling for Docs V2 create/update flows, including parsing, validation, upload, token binding, cleanup, dry-run support, pacing, scope enforcement, tests, and documentation.

Local document resources

Layer / File(s) Summary
Resource parsing and preparation
shortcuts/doc/local_doc_resources.go, shortcuts/doc/local_doc_resources_test.go
XML and Markdown local resources are validated and rewritten with placeholders while preserving supported metadata and ignoring inert contexts.
Upload, binding, and cleanup
shortcuts/doc/local_doc_resources.go, shortcuts/doc/local_doc_resources_test.go
Resources are correlated, uploaded with retries, bound in batches, verified, cleaned up when safe, and reported with structured outcomes.
V2 document write integration
shortcuts/doc/html5_block_resources.go, shortcuts/doc/docs_create*.go, shortcuts/doc/docs_update*.go, shortcuts/doc/helpers.go
Create and update flows carry prepared local resources through scope validation, dry-run generation, API writes, wiki resolution, and finalization.
Multipart request pacing
shortcuts/common/drive_media_upload.go, shortcuts/doc/doc_media_upload.go
Multipart upload configuration supports minimum intervals between prepare, part, and finish requests with context cancellation.
Validation, documentation, and end-to-end coverage
cmd/root_test.go, shortcuts/doc/doc_media_insert.go, skills/lark-doc/references/*, tests/cli_e2e/docs/*
Authorization and validation expectations, local-resource usage documentation, coverage records, dry-run checks, and create/update workflows are updated.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant DocsCLI
  participant DocsOpenAPI
  participant MediaAPI
  DocsCLI->>DocsCLI: parse and rewrite local resources
  DocsCLI->>DocsOpenAPI: create or update document with placeholders
  DocsOpenAPI-->>DocsCLI: document response with placeholder blocks
  DocsCLI->>MediaAPI: upload local files and images
  MediaAPI-->>DocsCLI: return media tokens
  DocsCLI->>DocsOpenAPI: bind tokens and clean placeholders
Loading

Possibly related PRs

  • larksuite/cli#638: The v2 create/update flow is extended with local-resource preparation and finalization.
  • larksuite/cli#1346: Both changes modify typed Docs API helper error handling.
  • larksuite/cli#1690: Both changes modify v2 document write preparation and reference-map handling.

Suggested labels: size/M, feature

Suggested reviewers: fangshuyu-768, liangshuo-1

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 4.20% 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 clearly summarizes the main change: adding local image and source resource uploads for docs.
Description check ✅ Passed The description covers the required content well, including summary, changes, verification, and related context, though headings differ from the template.
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 sun/lark-cli-local-resources

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 added domain/ccm PR touches the ccm domain size/XL Architecture-level or global-impact change labels Jul 13, 2026
@github-actions

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#sun/lark-cli-local-resources -y -g

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown

PR Quality Summary

CI did not complete successfully. Use the failed check links below to decide whether this PR needs a code change or a rerun.

Failed checks

@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.16095% with 513 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.38%. Comparing base (e96c4fa) to head (d960f15).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
shortcuts/doc/local_doc_resources.go 67.27% 353 Missing and 110 partials ⚠️
shortcuts/common/drive_media_upload.go 23.52% 10 Missing and 3 partials ⚠️
shortcuts/doc/docs_update_v2.go 56.66% 8 Missing and 5 partials ⚠️
shortcuts/doc/docs_create_v2.go 30.76% 7 Missing and 2 partials ⚠️
shortcuts/doc/html5_block_resources.go 60.00% 6 Missing and 2 partials ⚠️
shortcuts/doc/docs_update.go 0.00% 4 Missing ⚠️
shortcuts/doc/doc_media_insert.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1864      +/-   ##
==========================================
- Coverage   74.58%   74.38%   -0.21%     
==========================================
  Files         861      872      +11     
  Lines       89971    92358    +2387     
==========================================
+ Hits        67106    68699    +1593     
- Misses      17669    18271     +602     
- Partials     5196     5388     +192     

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

@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: 3

Caution

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

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

524-561: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Move recovery guidance into .WithHint(...) for the "doc" case.

Line 534 bakes recovery guidance ("use a docx token/URL or a wiki URL that resolves to docx") into the main error message instead of .WithHint(...), while the sibling wiki/default branches keep the message fact-only. As per coding guidelines: "recovery guidance goes in .WithHint(...)".

♻️ Proposed fix
 	case "doc":
-		return "", errs.NewValidationError(errs.SubtypeInvalidArgument, "this document operation only supports docx documents; use a docx token/URL or a wiki URL that resolves to docx").WithParam("--doc")
+		return "", errs.NewValidationError(errs.SubtypeInvalidArgument, "this document operation only supports docx documents").
+			WithParam("--doc").
+			WithHint("use a docx token/URL or a wiki URL that resolves to docx")
🤖 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/doc_media_insert.go` around lines 524 - 561, Update the "doc"
branch of resolveDocxDocumentID so the main validation error remains
fact-focused, and move the existing recovery guidance into a chained WithHint
call. Keep the existing error subtype and --doc parameter unchanged.

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.

Inline comments:
In `@shortcuts/common/drive_media_upload.go`:
- Around line 8-12: Add tests around waitDriveMediaMultipartRequest covering
both MinRequestInterval pauses: prepare→part and part→finish. Verify each pause
enforces the configured interval, and add a cancellation case confirming the
wait exits promptly when the context is canceled.

In `@skills/lark-doc/references/lark-doc-update.md`:
- Around line 59-60: Keep the warning text beginning with “本地图片和附件” as one
continuous blockquote by removing the blank line inside it or adding the
blockquote marker to that line, preventing the warning from being split into
separate blocks.

In `@tests/cli_e2e/docs/coverage.md`:
- Around line 26-34: Update the command descriptions in the coverage table cells
for docs +fetch and docs +update to escape or replace the alternative separators
in “markdown|xml” and “overwrite|append”. Preserve the documented command
options while ensuring each row remains exactly six Markdown table columns and
satisfies MD056.

---

Outside diff comments:
In `@shortcuts/doc/doc_media_insert.go`:
- Around line 524-561: Update the "doc" branch of resolveDocxDocumentID so the
main validation error remains fact-focused, and move the existing recovery
guidance into a chained WithHint call. Keep the existing error subtype and --doc
parameter 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: ea3862b6-8026-45fd-872d-1e380e5b465f

📥 Commits

Reviewing files that changed from the base of the PR and between 83352fe and d960f15.

📒 Files selected for processing (19)
  • cmd/root_test.go
  • shortcuts/common/drive_media_upload.go
  • shortcuts/doc/doc_media_insert.go
  • shortcuts/doc/doc_media_upload.go
  • shortcuts/doc/docs_create.go
  • shortcuts/doc/docs_create_v2.go
  • shortcuts/doc/docs_update.go
  • shortcuts/doc/docs_update_v2.go
  • shortcuts/doc/helpers.go
  • shortcuts/doc/html5_block_resources.go
  • shortcuts/doc/local_doc_resources.go
  • shortcuts/doc/local_doc_resources_test.go
  • skills/lark-doc/references/lark-doc-create.md
  • skills/lark-doc/references/lark-doc-md.md
  • skills/lark-doc/references/lark-doc-update.md
  • skills/lark-doc/references/lark-doc-xml.md
  • tests/cli_e2e/docs/coverage.md
  • tests/cli_e2e/docs/docs_local_resources_dryrun_test.go
  • tests/cli_e2e/docs/docs_local_resources_workflow_test.go

Comment on lines +8 to +12
"context"
"fmt"
"io"
"net/http"
"time"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for tests covering the multipart pacing / MinRequestInterval behavior
rg -n 'MinRequestInterval\|waitDriveMediaMultipartRequest\|MinRequestInterval' --type go -g '*_test.go'

Repository: larksuite/cli

Length of output: 151


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Map the target file and surrounding tests.
git ls-files 'shortcuts/common/drive_media_upload.go' 'shortcuts/common/*_test.go' 'shortcuts/**/*_test.go' | sed -n '1,200p'

echo '--- outline ---'
ast-grep outline shortcuts/common/drive_media_upload.go --view expanded

echo '--- search for pacing-related tests and symbols ---'
rg -n 'MinRequestInterval|waitDriveMediaMultipartRequest|multipart.*request|drive media upload|drive_media_upload' shortcuts -g '*_test.go' -g '*.go'

Repository: larksuite/cli

Length of output: 11172


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- drive_media_upload_test.go outline ---'
ast-grep outline shortcuts/common/drive_media_upload_test.go --view expanded

echo '--- drive_media_upload_typed_test.go outline ---'
ast-grep outline shortcuts/common/drive_media_upload_typed_test.go --view expanded

echo '--- relevant test snippets ---'
sed -n '1,260p' shortcuts/common/drive_media_upload_test.go
echo '--- typed tests ---'
sed -n '1,260p' shortcuts/common/drive_media_upload_typed_test.go

Repository: larksuite/cli

Length of output: 17589


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- all references to MinRequestInterval / waitDriveMediaMultipartRequest ---'
rg -n 'MinRequestInterval|waitDriveMediaMultipartRequest' shortcuts -g '*.go'

echo '--- continue drive_media_upload_typed_test.go ---'
sed -n '260,360p' shortcuts/common/drive_media_upload_typed_test.go

Repository: larksuite/cli

Length of output: 2716


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- tests that exercise doc media upload flow ---'
rg -n 'upload_prepare|upload_part|upload_finish|MinRequestInterval|localDocResourceUploadInterval|wait.*Request' shortcuts/doc -g '*_test.go'

echo '--- test files in shortcuts/doc ---'
git ls-files 'shortcuts/doc/*_test.go' | sed -n '1,200p'

Repository: larksuite/cli

Length of output: 4190


Add tests for multipart pacing. Existing multipart tests cover the request bodies, but not the new MinRequestInterval wait path in waitDriveMediaMultipartRequest or its context-cancellation behavior. Add coverage for the prepare→part and part→finish pauses.

🤖 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/common/drive_media_upload.go` around lines 8 - 12, Add tests around
waitDriveMediaMultipartRequest covering both MinRequestInterval pauses:
prepare→part and part→finish. Verify each pause enforces the configured
interval, and add a cancellation case confirming the wait exits promptly when
the context is canceled.

Source: Coding guidelines

Comment on lines +59 to +60
> 本地图片和附件只允许用于 `append` 或 `block_insert_after`。`str_replace` 不会创建资源 block,而 `block_replace` / `overwrite` 一旦在后续上传绑定失败会先破坏旧内容,因此 CLI 会在写文档前拒绝这些组合。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Keep the warning in one blockquote.

Line [60] is a blank line inside the blockquote, triggering MD028 and breaking the warning into separate blockquotes. Remove the blank line or prefix it with >.

Proposed fix
 > 本地图片和附件只允许用于 `append` 或 `block_insert_after`。`str_replace` 不会创建资源 block,而 `block_replace` / `overwrite` 一旦在后续上传绑定失败会先破坏旧内容,因此 CLI 会在写文档前拒绝这些组合。
-
+>
 > **匹配范围:**
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 60-60: Blank line inside blockquote

(MD028, no-blanks-blockquote)

🤖 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 `@skills/lark-doc/references/lark-doc-update.md` around lines 59 - 60, Keep the
warning text beginning with “本地图片和附件” as one continuous blockquote by removing
the blank line inside it or adding the blockquote marker to that line,
preventing the warning from being split into separate blocks.

Source: Linters/SAST tools

Comment on lines +26 to +34
| ✓ | docs +fetch | shortcut | docs_fetch_dryrun_test.go::TestDocsFetchDryRunIgnoresAPIVersionCompatFlag; docs_create_fetch_test.go::TestDocs_CreateAndFetchWorkflow/fetch as bot; docs_update_test.go::TestDocs_UpdateWorkflow/verify as bot; docs_create_fetch_test.go::TestDocs_CreateAndFetchWorkflowAsUser/fetch as user; docs_local_resources_workflow_test.go::testDocsLocalResourcesWorkflow/fetch verifies persisted resources; docs_update_dryrun_test.go::TestDocs_DryRunDefaultsToV2OpenAPI/fetch | `--doc <docToken>`; `--doc-format markdown|xml`; `--detail full`; default `extra_param.enable_user_cite_reference_map=true`; `--api-version v1` compatibility flag still dry-runs the v2 fetch endpoint | local-resource fetch asserts captions/file names persist and internal markers/paths do not leak |
| ✓ | docs +history-list | shortcut | docs_update_dryrun_test.go::TestDocs_DryRunDefaultsToV2OpenAPI/history list; docs_history_workflow_test.go::TestDocs_HistoryWorkflow | `--doc`; `--page-size`; `--page-token` | live workflow gated by `LARK_DOC_HISTORY_E2E=1` |
| ✓ | docs +history-revert | shortcut | docs_update_dryrun_test.go::TestDocs_DryRunDefaultsToV2OpenAPI/history revert; docs_history_workflow_test.go::TestDocs_HistoryWorkflow | `--doc`; `--history-version-id`; `--wait-timeout-ms` | live workflow gated by `LARK_DOC_HISTORY_E2E=1` |
| ✓ | docs +history-revert-status | shortcut | docs_update_dryrun_test.go::TestDocs_DryRunDefaultsToV2OpenAPI/history revert status; docs_history_workflow_test.go::TestDocs_HistoryWorkflow | `--doc`; `--task-id` | live workflow polls only when revert returns `running` |
| ✕ | docs +media-download | shortcut | | none | no media fixture workflow yet |
| ✕ | docs +media-insert | shortcut | | none | requires deterministic upload fixture and rollback assertions |
| ✕ | docs +media-preview | shortcut | | none | requires deterministic media fixture |
| ✕ | docs +search | shortcut | | none | search results are ambient and not yet stabilized for E2E |
| ✓ | docs +update | shortcut | docs_update_test.go::TestDocs_UpdateWorkflow/update-title-and-content as bot; docs_update_dryrun_test.go::TestDocs_DryRunDefaultsToV2OpenAPI/update | `--doc`; `--command overwrite`; `--doc-format markdown`; `--content`; optional `--reference-map` -> body `reference_map` | |
| ✓ | docs +update | shortcut | docs_update_test.go::TestDocs_UpdateWorkflow/update-title-and-content as bot; docs_local_resources_workflow_test.go::testDocsLocalResourcesWorkflow/append image and source; docs_local_resources_dryrun_test.go::TestDocs_LocalResourcesDryRun/update append; docs_update_dryrun_test.go::TestDocs_DryRunDefaultsToV2OpenAPI/update | `--doc`; `--command overwrite|append`; `--doc-format markdown|xml`; `--content`; local `<img path>` / `<source path>`; optional `--reference-map` -> body `reference_map` | local resources are covered under both bot and user identities |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Escape or replace alternative separators inside table cells.

The literal | characters in markdown|xml and overwrite|append are interpreted as Markdown table delimiters, producing extra columns and triggering MD056. Use /, or, or escaped pipes so the command table remains six columns.

Proposed fix
-| ✓ | docs +fetch | ... | `--doc-format markdown|xml` | ...
+| ✓ | docs +fetch | ... | `--doc-format markdown or xml` | ...
-| ✓ | docs +update | ... | `--command overwrite|append`; `--doc-format markdown|xml`; ... | ...
+| ✓ | docs +update | ... | `--command overwrite or append`; `--doc-format markdown or xml`; ... | ...
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
|| docs +fetch | shortcut | docs_fetch_dryrun_test.go::TestDocsFetchDryRunIgnoresAPIVersionCompatFlag; docs_create_fetch_test.go::TestDocs_CreateAndFetchWorkflow/fetch as bot; docs_update_test.go::TestDocs_UpdateWorkflow/verify as bot; docs_create_fetch_test.go::TestDocs_CreateAndFetchWorkflowAsUser/fetch as user; docs_local_resources_workflow_test.go::testDocsLocalResourcesWorkflow/fetch verifies persisted resources; docs_update_dryrun_test.go::TestDocs_DryRunDefaultsToV2OpenAPI/fetch | `--doc <docToken>`; `--doc-format markdown|xml`; `--detail full`; default `extra_param.enable_user_cite_reference_map=true`; `--api-version v1` compatibility flag still dry-runs the v2 fetch endpoint | local-resource fetch asserts captions/file names persist and internal markers/paths do not leak |
|| docs +history-list | shortcut | docs_update_dryrun_test.go::TestDocs_DryRunDefaultsToV2OpenAPI/history list; docs_history_workflow_test.go::TestDocs_HistoryWorkflow | `--doc`; `--page-size`; `--page-token` | live workflow gated by `LARK_DOC_HISTORY_E2E=1` |
|| docs +history-revert | shortcut | docs_update_dryrun_test.go::TestDocs_DryRunDefaultsToV2OpenAPI/history revert; docs_history_workflow_test.go::TestDocs_HistoryWorkflow | `--doc`; `--history-version-id`; `--wait-timeout-ms` | live workflow gated by `LARK_DOC_HISTORY_E2E=1` |
|| docs +history-revert-status | shortcut | docs_update_dryrun_test.go::TestDocs_DryRunDefaultsToV2OpenAPI/history revert status; docs_history_workflow_test.go::TestDocs_HistoryWorkflow | `--doc`; `--task-id` | live workflow polls only when revert returns `running` |
|| docs +media-download | shortcut | | none | no media fixture workflow yet |
|| docs +media-insert | shortcut | | none | requires deterministic upload fixture and rollback assertions |
|| docs +media-preview | shortcut | | none | requires deterministic media fixture |
|| docs +search | shortcut | | none | search results are ambient and not yet stabilized for E2E |
|| docs +update | shortcut | docs_update_test.go::TestDocs_UpdateWorkflow/update-title-and-content as bot; docs_update_dryrun_test.go::TestDocs_DryRunDefaultsToV2OpenAPI/update | `--doc`; `--command overwrite`; `--doc-format markdown`; `--content`; optional `--reference-map` -> body `reference_map` | |
|| docs +update | shortcut | docs_update_test.go::TestDocs_UpdateWorkflow/update-title-and-content as bot; docs_local_resources_workflow_test.go::testDocsLocalResourcesWorkflow/append image and source; docs_local_resources_dryrun_test.go::TestDocs_LocalResourcesDryRun/update append; docs_update_dryrun_test.go::TestDocs_DryRunDefaultsToV2OpenAPI/update | `--doc`; `--command overwrite|append`; `--doc-format markdown|xml`; `--content`; local `<img path>` / `<source path>`; optional `--reference-map` -> body `reference_map` | local resources are covered under both bot and user identities |
|| docs +fetch | shortcut | docs_fetch_dryrun_test.go::TestDocsFetchDryRunIgnoresAPIVersionCompatFlag; docs_create_fetch_test.go::TestDocs_CreateAndFetchWorkflow/fetch as bot; docs_update_test.go::TestDocs_UpdateWorkflow/verify as bot; docs_create_fetch_test.go::TestDocs_CreateAndFetchWorkflowAsUser/fetch as user; docs_local_resources_workflow_test.go::testDocsLocalResourcesWorkflow/fetch verifies persisted resources; docs_update_dryrun_test.go::TestDocs_DryRunDefaultsToV2OpenAPI/fetch | `--doc <docToken>`; `--doc-format markdown or xml`; `--detail full`; default `extra_param.enable_user_cite_reference_map=true`; `--api-version v1` compatibility flag still dry-runs the v2 fetch endpoint | local-resource fetch asserts captions/file names persist and internal markers/paths do not leak |
|| docs +history-list | shortcut | docs_update_dryrun_test.go::TestDocs_DryRunDefaultsToV2OpenAPI/history list; docs_history_workflow_test.go::TestDocs_HistoryWorkflow | `--doc`; `--page-size`; `--page-token` | live workflow gated by `LARK_DOC_HISTORY_E2E=1` |
|| docs +history-revert | shortcut | docs_update_dryrun_test.go::TestDocs_DryRunDefaultsToV2OpenAPI/history revert; docs_history_workflow_test.go::TestDocs_HistoryWorkflow | `--doc`; `--history-version-id`; `--wait-timeout-ms` | live workflow gated by `LARK_DOC_HISTORY_E2E=1` |
|| docs +history-revert-status | shortcut | docs_update_dryrun_test.go::TestDocs_DryRunDefaultsToV2OpenAPI/history revert status; docs_history_workflow_test.go::TestDocs_HistoryWorkflow | `--doc`; `--task-id` | live workflow polls only when revert returns `running` |
|| docs +media-download | shortcut | | none | no media fixture workflow yet |
|| docs +media-insert | shortcut | | none | requires deterministic upload fixture and rollback assertions |
|| docs +media-preview | shortcut | | none | requires deterministic media fixture |
|| docs +search | shortcut | | none | search results are ambient and not yet stabilized for E2E |
|| docs +update | shortcut | docs_update_test.go::TestDocs_UpdateWorkflow/update-title-and-content as bot; docs_local_resources_workflow_test.go::testDocsLocalResourcesWorkflow/append image and source; docs_local_resources_dryrun_test.go::TestDocs_LocalResourcesDryRun/update append; docs_update_dryrun_test.go::TestDocs_DryRunDefaultsToV2OpenAPI/update | `--doc`; `--command overwrite or append`; `--doc-format markdown or xml`; `--content`; local `<img path>` / `<source path>`; optional `--reference-map` -> body `reference_map` | local resources are covered under both bot and user identities |
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 26-26: Spaces inside code span elements

(MD038, no-space-in-code)


[warning] 26-26: Spaces inside code span elements

(MD038, no-space-in-code)


[warning] 26-26: Spaces inside code span elements

(MD038, no-space-in-code)


[warning] 26-26: Table column count
Expected: 6; Actual: 7; Too many cells, extra data will be missing

(MD056, table-column-count)


[warning] 34-34: Spaces inside code span elements

(MD038, no-space-in-code)


[warning] 34-34: Spaces inside code span elements

(MD038, no-space-in-code)


[warning] 34-34: Spaces inside code span elements

(MD038, no-space-in-code)


[warning] 34-34: Spaces inside code span elements

(MD038, no-space-in-code)


[warning] 34-34: Images should have alternate text (alt text)

(MD045, no-alt-text)


[warning] 34-34: Table column count
Expected: 6; Actual: 8; Too many cells, extra data will be missing

(MD056, table-column-count)

🤖 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/coverage.md` around lines 26 - 34, Update the command
descriptions in the coverage table cells for docs +fetch and docs +update to
escape or replace the alternative separators in “markdown|xml” and
“overwrite|append”. Preserve the documented command options while ensuring each
row remains exactly six Markdown table columns and satisfies MD056.

Source: Linters/SAST tools

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.

1 participant