Skip to content

fix: accept opaque wiki node tokens#1789

Merged
fangshuyu-768 merged 1 commit into
mainfrom
fix/wiki-opaque-node-token
Jul 8, 2026
Merged

fix: accept opaque wiki node tokens#1789
fangshuyu-768 merged 1 commit into
mainfrom
fix/wiki-opaque-node-token

Conversation

@liujinkun2025

@liujinkun2025 liujinkun2025 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fix wiki shortcuts that treated the historical wik prefix as a hard requirement for wiki node tokens. Newer or opaque wiki node tokens can now be passed through without being blocked by client-side validation.

Changes

  • Update wiki +node-get so raw tokens without --obj-type are treated as node tokens and --obj-type is ignored for obvious wiki node tokens.
  • Update wiki +node-list --parent-node-token to validate raw token syntax only, while preserving URL type checks for non-wiki URLs.
  • Add regression coverage for opaque wiki node tokens in +node-get and +node-list.

Test Plan

  • Unit tests pass: go test ./shortcuts/wiki
  • Manual local verification confirms the lark-cli wiki +node-list and lark-cli wiki +node-get dry-run flows work as expected

Related Issues

  • None

Summary by CodeRabbit

  • Bug Fixes
    • Improved wiki token handling across node lookup and list flows, consistently accepting opaque raw node tokens.
    • Updated --parent-node-token normalization to avoid incorrectly rejecting valid opaque values.
    • Relaxed --obj-type parsing: raw node token mode now defaults when omitted, and --obj-type cleanly switches lookup behavior.
  • Documentation
    • Refreshed WikiNodeGet --node-token and --obj-type help/usage wording for clearer URL inference and raw token behavior.
  • Tests
    • Updated and added coverage for opaque parent/node tokens and the revised obj_type behavior.

@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 Jul 8, 2026
@coderabbitai

coderabbitai Bot commented Jul 8, 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

Wiki node-list parent tokens now accept opaque values, and wiki node-get raw token parsing now uses --obj-type presence instead of token shape. Related tests and the +node-get reference text were updated to match the new behavior.

Changes

Wiki Token Validation Relaxation

Layer / File(s) Summary
WikiNodeList parent token normalization
shortcuts/wiki/wiki_node_list.go, shortcuts/wiki/wiki_list_copy_test.go
Removed the looksLikeWikiNodeToken check from parent token normalization; tests now pass opaque parent tokens through the request/response flow and drop the document-token rejection case.
WikiNodeGet raw token classification
shortcuts/wiki/wiki_node_get.go, shortcuts/wiki/wiki_node_get_test.go, skills/lark-wiki/references/lark-wiki-node-get.md
Reworded --node-token tips, changed raw-token parsing to select raw-node or raw-obj from ObjType presence, removed the shape-based helper, and updated tests and reference text to reflect the new parsing behavior.

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

Possibly related PRs

  • larksuite/cli#392: Shares the normalizeWikiNodeListParentToken and node-list parent-token test path.
  • larksuite/cli#904: Touches parseWikiNodeGetSpec and related wiki node-get token handling.
  • larksuite/cli#1779: Overlaps with wiki node-list parent-node-token parsing and validation updates.

Suggested reviewers: fangshuyu-768

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: accepting opaque wiki node tokens.
Description check ✅ Passed The description matches the required template and covers summary, changes, test plan, and related issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/wiki-opaque-node-token

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.

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.39%. Comparing base (f495cbb) to head (3416c1d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1789      +/-   ##
==========================================
- Coverage   74.40%   74.39%   -0.01%     
==========================================
  Files         860      860              
  Lines       89215    89432     +217     
==========================================
+ Hits        66384    66537     +153     
- Misses      17701    17745      +44     
- Partials     5130     5150      +20     

☔ 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 Jul 8, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#fix/wiki-opaque-node-token -y -g

@liujinkun2025
liujinkun2025 force-pushed the fix/wiki-opaque-node-token branch 3 times, most recently from 09843eb to f091b98 Compare July 8, 2026 03:11
@liujinkun2025
liujinkun2025 force-pushed the fix/wiki-opaque-node-token branch from f091b98 to 3416c1d Compare July 8, 2026 03:21
@fangshuyu-768
fangshuyu-768 merged commit 34c4ba5 into main Jul 8, 2026
25 checks passed
@fangshuyu-768
fangshuyu-768 deleted the fix/wiki-opaque-node-token branch July 8, 2026 03:41
This was referenced Jul 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/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