Skip to content

feat(wiki): improve wiki node creation and terminal errors - #2266

Merged
liujinkun2025 merged 1 commit into
mainfrom
feat/wiki-node-improvements
Aug 11, 2026
Merged

feat(wiki): improve wiki node creation and terminal errors#2266
liujinkun2025 merged 1 commit into
mainfrom
feat/wiki-node-improvements

Conversation

@liujinkun2025

@liujinkun2025 liujinkun2025 commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • allow wiki +node-create to create file shortcuts while rejecting unsupported origin file nodes locally
  • classify wiki +node-get business errors 131012, 131013, and 131014 as terminal, non-retryable failures with actionable hints
  • update the Wiki skill guidance and shortcut references

Testing

  • go test ./shortcuts/wiki -count=1
  • go test ./internal/qualitygate/skillscan -count=1
  • git diff --check

Summary by CodeRabbit

  • New Features
    • Added support for creating Wiki shortcut nodes that point to files.
    • Added clear validation and usage guidance when file objects are used with unsupported node types.
  • Bug Fixes
    • Improved handling of Wiki node retrieval errors, including deleted nodes, invalid resources, and documents not mounted in Wiki.
    • Added actionable recovery guidance and preserved request log details.
  • Documentation
    • Updated Wiki node creation and retrieval documentation with supported combinations, examples, and error-handling guidance.

@github-actions github-actions Bot added domain/ccm PR touches the ccm domain size/M Single-domain feat or fix with limited business impact labels Aug 10, 2026
@coderabbitai

coderabbitai Bot commented Aug 10, 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

The CLI now supports Wiki file shortcut creation, rejects invalid origin/file combinations, and classifies terminal get_node business errors. Unit, dry-run, workflow, and reference documentation coverage was added.

Changes

Wiki node handling

Layer / File(s) Summary
File shortcut creation and validation
shortcuts/wiki/wiki_node_create.go, shortcuts/wiki/wiki_node_create_test.go, tests/cli_e2e/wiki/*, skills/lark-wiki/references/lark-wiki-node-create.md
file is supported for shortcut nodes. Origin nodes using file are rejected with structured validation details. Tests verify payloads, CLI flags, dry-run behavior, and the end-to-end workflow.
Wiki node-get error classification
shortcuts/wiki/wiki_node_get.go, shortcuts/wiki/wiki_node_get_test.go, skills/lark-wiki/references/lark-wiki-node-get.md
Error codes 131012131014 are mapped to typed, non-retryable problems with recovery hints. Tests verify log IDs and suppressed success output.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • larksuite/cli#2203: Both PRs modify Wiki node-get error handling, but cover different error cases.
  • larksuite/cli#2220: This PR enables and validates Wiki file shortcuts used by the related change.

Suggested reviewers: fangshuyu-768

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 Wiki node creation improvements and terminal error handling changes.
Description check ✅ Passed The description explains the main changes and lists verification commands, but it omits the template's Changes, Related Issues, and checklist sections.
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 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/wiki-node-improvements

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@shortcuts/wiki/wiki_node_get_test.go`:
- Around line 466-471: Update the typed-error assertions in the test around
errs.ProblemOf to also require p.Category == errs.CategoryAPI, alongside the
existing code and subtype checks, so non-API problems with matching values fail
the test.
🪄 Autofix

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 Plus

Run ID: c8fe66c0-eb17-454b-b623-ede789a04823

📥 Commits

Reviewing files that changed from the base of the PR and between 2016120 and 8745e04.

📒 Files selected for processing (7)
  • shortcuts/wiki/wiki_node_create.go
  • shortcuts/wiki/wiki_node_create_test.go
  • shortcuts/wiki/wiki_node_get.go
  • shortcuts/wiki/wiki_node_get_test.go
  • skills/lark-wiki/SKILL.md
  • skills/lark-wiki/references/lark-wiki-node-create.md
  • skills/lark-wiki/references/lark-wiki-node-get.md

Comment thread shortcuts/wiki/wiki_node_get_test.go Outdated
@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#feat/wiki-node-improvements -y -g

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.30769% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.40%. Comparing base (2016120) to head (c70e3d7).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
shortcuts/wiki/wiki_node_get.go 89.47% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2266      +/-   ##
==========================================
+ Coverage   76.36%   76.40%   +0.03%     
==========================================
  Files        1011     1013       +2     
  Lines      111269   111813     +544     
==========================================
+ Hits        84970    85427     +457     
- Misses      19815    19877      +62     
- Partials     6484     6509      +25     

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

@liujinkun2025
liujinkun2025 force-pushed the feat/wiki-node-improvements branch 2 times, most recently from 979d037 to 04d638f Compare August 10, 2026 12:16
Comment thread shortcuts/wiki/wiki_node_create.go
@liujinkun2025
liujinkun2025 force-pushed the feat/wiki-node-improvements branch from 04d638f to 6eda0cd Compare August 10, 2026 12:37

@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 `@tests/cli_e2e/wiki/wiki_node_create_dryrun_test.go`:
- Around line 147-151: Extend the validation failure assertions in the wiki node
create dry-run test to verify the expected error.param value and assert that
result.Stdout is empty. Keep the existing exit code, error.type, error.subtype,
error.message, and error.hint assertions unchanged while enforcing the
stderr-only typed validation envelope.
🪄 Autofix

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 Plus

Run ID: 7e0fdb5a-1575-4381-944a-a9efb5a56914

📥 Commits

Reviewing files that changed from the base of the PR and between 979d037 and 6eda0cd.

📒 Files selected for processing (2)
  • tests/cli_e2e/wiki/wiki_node_create_dryrun_test.go
  • tests/cli_e2e/wiki/wiki_node_create_file_shortcut_workflow_test.go

Comment thread tests/cli_e2e/wiki/wiki_node_create_dryrun_test.go
@liujinkun2025
liujinkun2025 force-pushed the feat/wiki-node-improvements branch 2 times, most recently from 71d13e1 to c665266 Compare August 10, 2026 13:11
@liujinkun2025
liujinkun2025 force-pushed the feat/wiki-node-improvements branch from c665266 to c70e3d7 Compare August 10, 2026 14:07

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

The requested dry-run and live E2E coverage is now present, the cleanup path correctly addresses shortcut nodes by wiki node token, targeted local verification passes, and all CI checks are green.

@liujinkun2025
liujinkun2025 merged commit a18ccd6 into main Aug 11, 2026
27 checks passed
@liujinkun2025
liujinkun2025 deleted the feat/wiki-node-improvements branch August 11, 2026 02:05
@liangshuo-1 liangshuo-1 mentioned this pull request Aug 11, 2026
3 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/M Single-domain feat or fix with limited business impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants