mirror of
https://github.com/larksuite/cli.git
synced 2026-07-07 00:55:53 +08:00
Add docs +history-list, +history-revert, and +history-revert-status backed by docs_ai history OpenAPI endpoints. Document the safe history workflow and extend dry-run/live E2E coverage for the new shortcuts.
4.4 KiB
4.4 KiB
Docs CLI E2E Coverage
Metrics
- Denominator: 11 leaf commands
- Covered: 6
- Coverage: 54.5%
Summary
- TestDocs_CreateAndFetchWorkflow: proves
docs +createanddocs +fetch; keyt.Run(...)proof points arecreate as botandfetch as bot. - TestDocs_CreateAndFetchWorkflowAsUser: proves the same shortcut pair with UAT injection via
create as userandfetch as user; creates its own Drive folder fixture first, then reads back the created doc by token. - TestDocs_UpdateWorkflow: proves
docs +updateviaupdate-title-and-content as bot, then re-fetches the same doc inverify as botto assert persisted title/content changes. - TestDocs_DryRunDefaultsToV2OpenAPI: proves
docs +create,docs +fetch, anddocs +updatedry-run all emit/open-apis/docs_ai/v1/...requests without MCP or--api-versionguidance; its fetch case asserts fetch sends the defaultextra_param, and its update case asserts--reference-mapis sent as request bodyreference_map. - TestDocs_CreateTitleDryRunPrependsContent: proves
docs +create --titledry-run prepends an escaped<title>...</title>tag to request bodycontent. - TestDocs_DryRunDefaultsToV2OpenAPI also proves
docs +history-list,docs +history-revert, anddocs +history-revert-statusdry-run endpoint and query/body shapes. - TestDocs_HistoryWorkflow proves the guarded live history flow (
LARK_DOC_HISTORY_E2E=1): create, update, list prior revisions, revert, poll status when needed, and fetch to verify reverted content. - Setup note: docs workflows create a Drive folder through
drive files create_folderinhelpers_test.go; that helper is external to the docs domain and is not counted here. - Blocked area: media and search shortcuts still need deterministic fixtures and local file orchestration.
Command Table
| Status | Cmd | Type | Testcase | Key parameter shapes | Notes / uncovered reason |
|---|---|---|---|---|---|
| ✓ | docs +create | shortcut | docs/helpers_test.go::createDocWithRetry; docs_create_fetch_test.go::TestDocs_CreateAndFetchWorkflowAsUser/create as user; docs_update_dryrun_test.go::TestDocs_DryRunDefaultsToV2OpenAPI/create; docs_update_dryrun_test.go::TestDocs_CreateTitleDryRunPrependsContent | --parent-token; --doc-format markdown; --content; --title |
helper asserts returned doc id from data.document.document_id; dry-run asserts title is prepended into request body content |
| ✓ | docs +fetch | shortcut | 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_update_dryrun_test.go::TestDocs_DryRunDefaultsToV2OpenAPI/fetch | --doc <docToken>; --doc-format markdown; default extra_param.enable_user_cite_reference_map=true |
|
| ✓ | 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 +whiteboard-update | shortcut | none | requires whiteboard fixture and DSL-specific assertions |