Skip to content

feat(wiki): add +node-get / +node-delete / +space-create shortcuts#904

Merged
fangshuyu-768 merged 1 commit into
mainfrom
feat/wiki-node-shortcuts
May 19, 2026
Merged

feat(wiki): add +node-get / +node-delete / +space-create shortcuts#904
fangshuyu-768 merged 1 commit into
mainfrom
feat/wiki-node-shortcuts

Conversation

@liujinkun2025

@liujinkun2025 liujinkun2025 commented May 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fills the wiki node/space CRUD gaps. Three new shortcuts plus a shared async-task helper:

  • wiki +node-get — wraps wiki.spaces.get_node. Accepts a raw node_token / obj_token or a Lark URL (URL path auto-infers obj_type; conflicting explicit --obj-type is rejected). Optional --space-id cross-check. Formatted output: title / obj_type / obj_token / node_token / space_id / parent_node_token / creator / updated_at / url.
  • wiki +node-delete — wraps the space.node delete API. high-risk-write (--yes gated), bounded async delete_node task polling, auto-resolves space_id via get_node when --space-id is omitted, --include-children defaults to true. Maps Lark codes 131011 (UI-approval required) and 131003 (subtree too large) to actionable hints; other codes pass through with the original code preserved.
  • wiki +space-create — wraps spaces.create. User-only identity (the API rejects tenant/bot tokens; framework CheckIdentity enforces it). --name required (no empty-name spaces), --description optional. Flattened space output, no url (the API returns none and there is no space-home URL builder).
  • Refactor — extracted the duplicated wiki delete-task poll loop / status classification into wiki_async_task.go (pollWikiAsyncTask / parseWikiAsyncTaskStatus / wikiAsyncTaskStatus). +delete-space now delegates to it via thin wrappers — no behavior change, ~110 lines of duplication removed.

Also renames the originally-proposed +get-node to +node-get for consistency with the +node-* family.

Risk-level note: spaces.create carries danger:true in the registry, but that flag only drives the lark-cli schema browser's red [danger] tag — it is not a runtime confirmation gate (only risk:high-risk-write is). The raw API runs without --yes today, so +space-create at Risk:write is runtime-consistent; a help Tip surfaces the danger flag and points to +delete-space for undo.

Test plan

  • go test ./shortcuts/... (and full suite excluding tests/cli_e2e) green
  • gofmt -l clean, go vet ./shortcuts/wiki/... clean, ./build.sh OK
  • New unit + httpmock tests: URL/token parsing, obj_type inference & conflict, space-id auto-resolve, sync/async/timeout/failure delete paths, error-code hint mapping, --yes gating, bot-identity rejection, output flattening
  • Manual smoke: --help, --dry-run, validation failures, identity rejection for each shortcut
  • golangci-lint not run (not installed in dev env) — please confirm in CI
  • tests/cli_e2e/wiki not run locally (hits real Feishu) — verify in CI/staging

Summary by CodeRabbit

  • New Features

    • Added wiki commands: +node-get, +node-delete, +space-create; shortcuts list expanded
    • Drive task result now supports wiki_delete_node scenario
  • Improvements

    • Centralized async-task polling for wiki operations with normalized status handling, clearer retry/resume hints, and consistent timeout/failure behavior
    • Input validation and user-facing output formatting improved for wiki commands
  • Tests

    • Extensive tests covering new commands, async polling, error hints, dry-run and mounted executions
  • Documentation

    • New/updated reference pages for node-get, node-delete, and space-create

Review Change Stack

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

coderabbitai Bot commented May 15, 2026

Copy link
Copy Markdown

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

Adds three wiki shortcuts (+space-create, +node-get, +node-delete), shared async-task parsing/polling helpers, drive task_result support for wiki delete-node, refactors delete-space to use shared helpers, updates docs/registry, and adds comprehensive tests.

Changes

Wiki node operations

Layer / File(s) Summary
Shared async task polling and tests
shortcuts/wiki/wiki_async_task.go, shortcuts/wiki/wiki_async_task_test.go
Adds unified async-task parsing and a bounded polling helper; tests cover success, terminal failure, timeout, wrapped upstream errors, and context cancellation.
drive +task_result: wiki_delete_node support
shortcuts/drive/drive_task_result.go, shortcuts/drive/drive_task_result_test.go
Extends drive +task_result to support wiki_delete_node scenario, adds dry-run/execute branches, scope precheck, and queryWikiDeleteNodeTask normalization.
wiki_delete refactor
shortcuts/wiki/wiki_delete.go, shortcuts/wiki/wiki_delete_test.go
Replaces bespoke delete-space polling/normalization with aliases/wrappers that call the shared async helpers and preserves test surface via thin wrappers.
Wiki node delete command
shortcuts/wiki/wiki_node_delete.go, shortcuts/wiki/wiki_node_delete_test.go
Implements +node-delete with token/URL parsing, optional space resolution, sync vs async delete handling via shared polling, error hint augmentation for specific API codes, dry-run, and broad unit/mounted tests.
Wiki node get command
shortcuts/wiki/wiki_node_get.go, shortcuts/wiki/wiki_node_get_test.go
Implements +node-get supporting URL/raw token inputs with obj_type inference/validation, GET /open-apis/wiki/v2/spaces/get_node dry-run/execute, timestamp formatting, output shaping, and tests for parsing, dry-run, and mounted execution.
Wiki space create command
shortcuts/wiki/wiki_space_create.go, shortcuts/wiki/wiki_space_create_test.go
Implements +space-create with --name/--description, request body building, dry-run, execute flow, flattened output, auth/scope enforcement, and mounted/unit tests.
Shortcut registry & docs
shortcuts/wiki/shortcuts.go, shortcuts/wiki/wiki_node_create_test.go, skills/lark-wiki/*
Registers new shortcuts (WikiSpaceCreate, WikiNodeGet, WikiNodeDelete), updates shortcut-count test, and adds SKILL/reference docs for node-get/node-delete/space-create.

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant WikiAPI as Wiki API
  participant TasksAPI as Tasks API
  CLI->>WikiAPI: (optional) GET /open-apis/wiki/v2/spaces/get_node (resolve space_id)
  CLI->>WikiAPI: DELETE /open-apis/wiki/v2/spaces/:space_id/nodes/:node_token
  WikiAPI-->>CLI: {task_id?} (empty => sync ready)
  CLI->>TasksAPI: poll /open-apis/wiki/v2/tasks/:task_id?task_type=delete_node
  TasksAPI-->>CLI: {task_id,status,status_msg}
  CLI->>CLI: pollWikiAsyncTask -> returns ready/failed/status/status_msg or resume hint
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • larksuite/cli#392: Related changes to wiki shortcut registry and ordering around WikiNodeCopy.
  • larksuite/cli#610: Prior work on wiki async polling and delete-space behavior overlapping helper design.
  • larksuite/cli#320: Earlier modifications to wiki shortcut registrations.

Suggested reviewers

  • fangshuyu-768
  • liangshuo-1
  • tengchengwei

Poem

🐰 I hopped through code and found a trail,
New shortcuts sprout where queries prevail,
A poller hums softly to watch tasks spin,
Space create, node get, node delete — begin.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 23.08% 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 and concisely summarizes the primary changes: adding three wiki shortcuts (+node-get, +node-delete, +space-create) with feature scope and clear command names.
Description check ✅ Passed The description covers motivation, lists main changes, includes test plan with checked boxes, but lacks explicit 'Related Issues' section completion (only states 'None').
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/wiki-node-shortcuts

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 May 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.77027% with 102 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.93%. Comparing base (f03138b) to head (7d8071f).
⚠️ Report is 20 commits behind head on main.

Files with missing lines Patch % Lines
shortcuts/wiki/wiki_node_get.go 71.66% 41 Missing and 10 partials ⚠️
shortcuts/wiki/wiki_node_delete.go 83.82% 23 Missing and 15 partials ⚠️
shortcuts/drive/drive_task_result.go 82.60% 4 Missing and 4 partials ⚠️
shortcuts/wiki/wiki_space_create.go 91.30% 2 Missing and 2 partials ⚠️
shortcuts/wiki/wiki_space_list.go 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #904      +/-   ##
==========================================
+ Coverage   65.95%   66.93%   +0.98%     
==========================================
  Files         523      568      +45     
  Lines       49590    52970    +3380     
==========================================
+ Hits        32707    35458    +2751     
- Misses      14090    14581     +491     
- Partials     2793     2931     +138     

☔ View full report in Codecov by Sentry.
📢 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 May 15, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#feat/wiki-node-shortcuts -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

🧹 Nitpick comments (1)
shortcuts/wiki/wiki_node_create_test.go (1)

114-126: ⚡ Quick win

Strengthen this test to assert the newly added commands explicitly.

Checking only len(shortcuts) == 9 won’t catch a wrong/missing command if count stays the same. Add assertions for +space-create, +node-get, and +node-delete (or assert the full expected command list).

Suggested test hardening
 func TestWikiShortcutsIncludeAllCommands(t *testing.T) {
 	t.Parallel()

 	shortcuts := Shortcuts()
 	if len(shortcuts) != 9 {
 		t.Fatalf("len(Shortcuts()) = %d, want 9", len(shortcuts))
 	}
+	got := make([]string, 0, len(shortcuts))
+	for _, sc := range shortcuts {
+		got = append(got, sc.Command)
+	}
+	want := []string{
+		"+move",
+		"+node-create",
+		"+delete-space",
+		"+space-list",
+		"+space-create",
+		"+node-list",
+		"+node-copy",
+		"+node-get",
+		"+node-delete",
+	}
+	for i := range want {
+		if got[i] != want[i] {
+			t.Fatalf("shortcuts[%d].Command = %q, want %q", i, got[i], want[i])
+		}
+	}
-	if shortcuts[0].Command != "+move" {
-		t.Fatalf("shortcuts[0].Command = %q, want %q", shortcuts[0].Command, "+move")
-	}
-	if shortcuts[1].Command != "+node-create" {
-		t.Fatalf("shortcuts[1].Command = %q, want %q", shortcuts[1].Command, "+node-create")
-	}
-	if shortcuts[2].Command != "+delete-space" {
-		t.Fatalf("shortcuts[2].Command = %q, want %q", shortcuts[2].Command, "+delete-space")
-	}
 }
🤖 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/wiki/wiki_node_create_test.go` around lines 114 - 126, The test in
wiki_node_create_test.go currently only checks len(shortcuts) and a few
commands; strengthen it by asserting the full expected command list or at
minimum add explicit checks for the newly added commands: verify that shortcuts
contains "+space-create", "+node-get", and "+node-delete" (in addition to
existing checks for "+move", "+node-create", "+delete-space"), using the same
pattern as the existing assertions against shortcuts[n].Command so the test
fails if any command is missing or out of order.
🤖 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/wiki/wiki_async_task.go`:
- Around line 165-172: The retry logic currently calls output.ErrWithHint which
rebuilds and loses structured API detail; instead, detect when lastErr is an
*output.ExitError (the existing exitErr variable) and preserve its Detail fields
(Code, ConsoleURL, Risk, nested Detail, etc.) while only appending the retry
hint to the message/hint field, then return the original or a minimally-updated
ExitError so structured fields are retained; update the branch handling
lastErr/exitErr around the existing output.ErrWithHint call to reuse
exitErr.Detail rather than reconstructing the error.
- Around line 65-73: The StatusCode method on wikiAsyncTaskStatus returns raw
non-empty statuses which can conflict with Failed(); update StatusCode() to
align with the helper's non-terminal classification by returning
wikiAsyncStatusProcessing for any status that is not explicitly ready/successful
or explicitly failed/terminal. In practice, inside StatusCode() (on
wikiAsyncTaskStatus) trim the value, then use the same readiness/terminal logic
used by Failed() (or call a shared helper) to detect non-terminal states and
coerce them to wikiAsyncStatusProcessing, otherwise return the original terminal
status.

---

Nitpick comments:
In `@shortcuts/wiki/wiki_node_create_test.go`:
- Around line 114-126: The test in wiki_node_create_test.go currently only
checks len(shortcuts) and a few commands; strengthen it by asserting the full
expected command list or at minimum add explicit checks for the newly added
commands: verify that shortcuts contains "+space-create", "+node-get", and
"+node-delete" (in addition to existing checks for "+move", "+node-create",
"+delete-space"), using the same pattern as the existing assertions against
shortcuts[n].Command so the test fails if any command is missing or out of
order.
🪄 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: 5a211eba-1323-42a1-9667-4ef59fe458ee

📥 Commits

Reviewing files that changed from the base of the PR and between 4a45e00 and f282650.

📒 Files selected for processing (10)
  • shortcuts/wiki/shortcuts.go
  • shortcuts/wiki/wiki_async_task.go
  • shortcuts/wiki/wiki_delete.go
  • shortcuts/wiki/wiki_node_create_test.go
  • shortcuts/wiki/wiki_node_delete.go
  • shortcuts/wiki/wiki_node_delete_test.go
  • shortcuts/wiki/wiki_node_get.go
  • shortcuts/wiki/wiki_node_get_test.go
  • shortcuts/wiki/wiki_space_create.go
  • shortcuts/wiki/wiki_space_create_test.go

Comment thread shortcuts/wiki/wiki_async_task.go
Comment thread shortcuts/wiki/wiki_async_task.go
@liujinkun2025
liujinkun2025 force-pushed the feat/wiki-node-shortcuts branch from f282650 to eeda447 Compare May 15, 2026 08:47

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

🧹 Nitpick comments (1)
shortcuts/wiki/wiki_space_create.go (1)

108-119: ⚡ Quick win

Reuse the shared space-record formatter here.

This open-codes the flattened space fields even though the file already references parseWikiSpaceRecord. Composing the shared parser/formatter and then overlaying description would keep +space-create aligned with the other wiki space outputs and avoid future drift.

🤖 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/wiki/wiki_space_create.go` around lines 108 - 119, Replace the
manual field extraction in wikiSpaceCreateOutput with a call to the shared
parser/formatter parseWikiSpaceRecord(raw) and then overlay or set the
"description" key from the raw map so the create output stays consistent with
other wiki space outputs; specifically, inside wikiSpaceCreateOutput call
parseWikiSpaceRecord(raw) to get the base map, copy/merge that into the returned
map, and ensure "description" is taken from common.GetString(raw, "description")
to override or preserve the caller-provided description.
🤖 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.

Nitpick comments:
In `@shortcuts/wiki/wiki_space_create.go`:
- Around line 108-119: Replace the manual field extraction in
wikiSpaceCreateOutput with a call to the shared parser/formatter
parseWikiSpaceRecord(raw) and then overlay or set the "description" key from the
raw map so the create output stays consistent with other wiki space outputs;
specifically, inside wikiSpaceCreateOutput call parseWikiSpaceRecord(raw) to get
the base map, copy/merge that into the returned map, and ensure "description" is
taken from common.GetString(raw, "description") to override or preserve the
caller-provided description.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2154a194-f9ac-466c-8175-f64a619eadf2

📥 Commits

Reviewing files that changed from the base of the PR and between f282650 and eeda447.

📒 Files selected for processing (11)
  • shortcuts/wiki/shortcuts.go
  • shortcuts/wiki/wiki_async_task.go
  • shortcuts/wiki/wiki_async_task_test.go
  • shortcuts/wiki/wiki_delete.go
  • shortcuts/wiki/wiki_node_create_test.go
  • shortcuts/wiki/wiki_node_delete.go
  • shortcuts/wiki/wiki_node_delete_test.go
  • shortcuts/wiki/wiki_node_get.go
  • shortcuts/wiki/wiki_node_get_test.go
  • shortcuts/wiki/wiki_space_create.go
  • shortcuts/wiki/wiki_space_create_test.go
✅ Files skipped from review due to trivial changes (1)
  • shortcuts/wiki/wiki_node_create_test.go
🚧 Files skipped from review as they are similar to previous changes (8)
  • shortcuts/wiki/shortcuts.go
  • shortcuts/wiki/wiki_space_create_test.go
  • shortcuts/wiki/wiki_node_get_test.go
  • shortcuts/wiki/wiki_node_get.go
  • shortcuts/wiki/wiki_delete.go
  • shortcuts/wiki/wiki_async_task.go
  • shortcuts/wiki/wiki_node_delete.go
  • shortcuts/wiki/wiki_node_delete_test.go

@liujinkun2025

Copy link
Copy Markdown
Collaborator Author

Review follow-up (force-pushed amend 2cfd336)

CodeRabbit actionables

  • 🟡 wiki_async_task.go ErrWithHint drops structured fields → fixed (see in-thread reply; hand-built ExitError + regression test).
  • 🟡 wiki_async_task.go StatusCode()/Failed() mismatch → won't-fix (see in-thread reply; coercing breaks the intentional TestWikiDeleteSpaceTaskStatusClassification contract).

CodeRabbit nitpicks

  • TestWikiShortcutsIncludeAllCommandsremoved entirely. It's a pre-existing (feat(wiki): add +delete-space shortcut with async task polling #610) circular change-detector: the count/index assertion is updated in lockstep with the code it "guards", so it can't catch the bug it claims to. TestWikiShortcutsIncludesSpaceListNodeListNodeCopy (membership-based) remains.
  • wikiSpaceCreateOutput reuse parseWikiSpaceRecordwon't-fix. There is no shared formatterparseWikiSpaceRecord returns a struct without a Description field. Composing it would add an error path and a struct→map rebuild to reproduce the same flat output; the direct raw-map read is simpler and already commented.

Two additional bugs found during review (also fixed in this amend)

  1. +node-delete async polling read the wrong field. The gateway stores the delete-node task status under the generic simple_task_result key, not delete_node_result. The old constant meant every async node-delete would poll forever and falsely report timed_out even on success. Fixed the constant + the masking test stub.
  2. +node-delete timeout next_command was a dead end. It points users at drive +task_result --scenario wiki_delete_node, but that scenario didn't exist (drive +task_result rejected it as unsupported). Added the wiki_delete_node scenario (Validate/DryRun/Execute/scope + queryWikiDeleteNodeTask reading simple_task_result) with tests.

Also added the missing skill reference docs (+node-get / +node-delete / +space-create) and SKILL.md shortcuts/permission table entries.

@liujinkun2025
liujinkun2025 force-pushed the feat/wiki-node-shortcuts branch from 2cfd336 to 6c4b979 Compare May 18, 2026 04:23

@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 `@skills/lark-wiki/SKILL.md`:
- Around line 64-65: Add the missing nodes.delete API to the "### nodes" API
Resources list (so it appears alongside copy, create, and list) and add a
corresponding row in the Permissions table for nodes.delete with the required
scope; update the API Resources section (the "### nodes" block) to include
"delete" and add a permission-table entry for "nodes.delete" specifying the
proper scope string.
🪄 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: 40b1b130-3339-4086-a3ae-b2101c51bf20

📥 Commits

Reviewing files that changed from the base of the PR and between 2cfd336 and 6c4b979.

📒 Files selected for processing (18)
  • shortcuts/drive/drive_task_result.go
  • shortcuts/drive/drive_task_result_test.go
  • shortcuts/wiki/shortcuts.go
  • shortcuts/wiki/wiki_async_task.go
  • shortcuts/wiki/wiki_async_task_test.go
  • shortcuts/wiki/wiki_delete.go
  • shortcuts/wiki/wiki_delete_test.go
  • shortcuts/wiki/wiki_node_create_test.go
  • shortcuts/wiki/wiki_node_delete.go
  • shortcuts/wiki/wiki_node_delete_test.go
  • shortcuts/wiki/wiki_node_get.go
  • shortcuts/wiki/wiki_node_get_test.go
  • shortcuts/wiki/wiki_space_create.go
  • shortcuts/wiki/wiki_space_create_test.go
  • skills/lark-wiki/SKILL.md
  • skills/lark-wiki/references/lark-wiki-node-delete.md
  • skills/lark-wiki/references/lark-wiki-node-get.md
  • skills/lark-wiki/references/lark-wiki-space-create.md
💤 Files with no reviewable changes (1)
  • shortcuts/wiki/wiki_node_create_test.go
✅ Files skipped from review due to trivial changes (2)
  • skills/lark-wiki/references/lark-wiki-node-get.md
  • skills/lark-wiki/references/lark-wiki-node-delete.md
🚧 Files skipped from review as they are similar to previous changes (12)
  • shortcuts/wiki/wiki_space_create.go
  • shortcuts/wiki/wiki_delete_test.go
  • shortcuts/drive/drive_task_result_test.go
  • shortcuts/wiki/wiki_async_task_test.go
  • shortcuts/wiki/wiki_delete.go
  • shortcuts/wiki/wiki_space_create_test.go
  • shortcuts/wiki/wiki_node_get.go
  • shortcuts/wiki/wiki_async_task.go
  • shortcuts/wiki/wiki_node_delete_test.go
  • shortcuts/wiki/wiki_node_get_test.go
  • shortcuts/drive/drive_task_result.go
  • shortcuts/wiki/wiki_node_delete.go

Comment thread skills/lark-wiki/SKILL.md
@liujinkun2025
liujinkun2025 force-pushed the feat/wiki-node-shortcuts branch 2 times, most recently from 0f0d894 to 56328d3 Compare May 18, 2026 06:30
@liujinkun2025

Copy link
Copy Markdown
Collaborator Author

Proactive convergence (not a CodeRabbit ask): dropped the synthesized url field from +node-get output. wiki/v2/spaces/get_node returns no URL, and the BuildResourceURL fallback (www.feishu.cn/wiki/<node_token>) is a non-canonical link that is misleading in a read/confirm command. Sibling read shortcuts (+node-list, +node-copy) likewise emit no url; node_token/obj_token remain as the precise identifiers. Updated the shortcut output, pretty renderer, test assertion, and reference doc accordingly. +node-create's url (a legitimate created-resource fallback) is unchanged.

@liujinkun2025
liujinkun2025 force-pushed the feat/wiki-node-shortcuts branch from 56328d3 to 69752e0 Compare May 18, 2026 07:08

@fangshuyu-768 fangshuyu-768 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the PR — solid work overall. Left a few comments on things worth considering before merge. Summary of findings:

  1. [Medium] wikiNodeGetURLObjTypes map iteration — Go map order is non-deterministic; consider an ordered slice or a runtime prefix-conflict check.
  2. [Low] queryWikiDeleteNodeTask vs parseWikiAsyncTaskStatus — duplicated logic; add a sync-maintenance note.
  3. [Needs confirmation] +space-create Risk levelwrite vs high-risk-write for an irreversible operation.
  4. [Low] looksLikeWikiNodeToken heuristic — only checks wik prefix; worth documenting the assumption.
  5. [Nitpick] wikiSpaceCreateOutput not reusing parseWikiSpaceRecord — risk of field drift.
  6. [Low] formatWikiTimestamp uses local timezone — output varies by server timezone.

Comment thread shortcuts/wiki/wiki_node_get.go
Comment thread shortcuts/drive/drive_task_result.go
Comment thread shortcuts/wiki/wiki_space_create.go
Comment thread shortcuts/wiki/wiki_node_get.go
Comment thread shortcuts/wiki/wiki_space_create.go
Comment thread shortcuts/wiki/wiki_node_get.go
- +node-get: wrap wiki.spaces.get_node; accepts node_token, obj_token,
  or a Lark URL (URL path auto-infers obj_type); formatted output with
  creator / updated_at. No synthesized url — get_node returns none and a
  BuildResourceURL fallback is a non-canonical link that misleads in a
  read/confirm command (sibling read shortcuts omit it too)
- +node-delete: wrap space.node delete; high-risk-write (--yes gated),
  async delete-node task polling, auto-resolves space_id via get_node
  when --space-id omitted, actionable hints for codes 131011 / 131003.
  The delete-node task result lives under the gateway's generic
  `simple_task_result` key (NOT `delete_node_result`)
- +space-create: wrap spaces.create; user-only identity, --name
  required (no empty-name spaces), flattened space output, no url
- factor the shared wiki async-task poll loop into wiki_async_task.go;
  preserve upstream Lark Detail.Code on poll exhaustion (no longer
  rebuilt via lossy ErrWithHint)
- drive +task_result: add wiki_delete_node scenario so +node-delete's
  async-timeout next_command actually resolves
- skill docs: reference pages for the 3 new shortcuts + SKILL.md
  shortcuts table (no raw nodes.delete API exists — it's shortcut-only,
  so it is intentionally absent from API Resources / permission table);
  drop the circular TestWikiShortcutsIncludeAllCommands change-detector

Change-Id: I316f78290cec5bc50f80d629173e3bf2a35dd005
@liujinkun2025
liujinkun2025 force-pushed the feat/wiki-node-shortcuts branch from 69752e0 to 7d8071f Compare May 19, 2026 03:08
@fangshuyu-768
fangshuyu-768 merged commit c4fb700 into main May 19, 2026
21 checks passed
@fangshuyu-768
fangshuyu-768 deleted the feat/wiki-node-shortcuts branch May 19, 2026 03:21
@liangshuo-1 liangshuo-1 mentioned this pull request May 19, 2026
2 tasks
tuxedomm pushed a commit to zhumiaoxin/cli that referenced this pull request Jun 6, 2026
…arksuite#904)

- +node-get: wrap wiki.spaces.get_node; accepts node_token, obj_token,
  or a Lark URL (URL path auto-infers obj_type); formatted output with
  creator / updated_at. No synthesized url — get_node returns none and a
  BuildResourceURL fallback is a non-canonical link that misleads in a
  read/confirm command (sibling read shortcuts omit it too)
- +node-delete: wrap space.node delete; high-risk-write (--yes gated),
  async delete-node task polling, auto-resolves space_id via get_node
  when --space-id omitted, actionable hints for codes 131011 / 131003.
  The delete-node task result lives under the gateway's generic
  `simple_task_result` key (NOT `delete_node_result`)
- +space-create: wrap spaces.create; user-only identity, --name
  required (no empty-name spaces), flattened space output, no url
- factor the shared wiki async-task poll loop into wiki_async_task.go;
  preserve upstream Lark Detail.Code on poll exhaustion (no longer
  rebuilt via lossy ErrWithHint)
- drive +task_result: add wiki_delete_node scenario so +node-delete's
  async-timeout next_command actually resolves
- skill docs: reference pages for the 3 new shortcuts + SKILL.md
  shortcuts table (no raw nodes.delete API exists — it's shortcut-only,
  so it is intentionally absent from API Resources / permission table);
  drop the circular TestWikiShortcutsIncludeAllCommands change-detector

Change-Id: I316f78290cec5bc50f80d629173e3bf2a35dd005
@coderabbitai coderabbitai Bot mentioned this pull request Jul 8, 2026
2 tasks
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