Skip to content

feat: align im feed shortcut commands with latest oapi#1437

Closed
zhangheng023 wants to merge 1 commit into
mainfrom
feat/feed-shortcut-oapi-align
Closed

feat: align im feed shortcut commands with latest oapi#1437
zhangheng023 wants to merge 1 commit into
mainfrom
feat/feed-shortcut-oapi-align

Conversation

@zhangheng023

@zhangheng023 zhangheng023 commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Align the existing im feed shortcut commands with the latest im/v2/feed_shortcuts OAPI contract. This removes outdated list pagination/detail behavior, tightens local write validation to a 30-item CLI limit, and keeps the shortcut docs plus existing E2E coverage consistent with the shipped behavior.

Changes

  • Align im +feed-shortcut-create and im +feed-shortcut-remove with the latest contract while enforcing a local 30-item batch limit.
  • Simplify im +feed-shortcut-list into a direct full-list wrapper and remove legacy --page-token, --no-detail, and detail enrichment behavior.
  • Update unit tests, existing feed shortcut E2E tests, and the three lark-im feed shortcut reference docs to match the new behavior.

Test Plan

  • Unit tests pass
  • Manual local verification confirms the lark-cli <domain> <command> flow works as expected
  • go test ./shortcuts/im
  • go test ./tests/cli_e2e/im -run 'TestIM_FeedShortcut' -count=1 -v
  • bash /Users/bytedance/.codex/plugins/cache/lark-cli-harness-codex-marketplace/lark-cli-harness/0.6.6/skills/dev-verify/scripts/validate.sh
  • Acceptance review passed via harness (docs/superpowers/verify_results/acceptance_review.md)
  • Security code review passed via harness (docs/superpowers/verify_results/security-code-review.md)

Related Issues

  • None

Summary by CodeRabbit

  • Changes

    • Increased feed shortcut batch limit from 10 to 30 chat IDs per call for create and remove operations
    • Simplified feed shortcut list to return complete results directly without pagination support
  • Documentation

    • Updated documentation to reflect new batch limits and streamlined list behavior

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

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 04d4b3d3-0aba-41ed-aca2-85cb22e77bc6

📥 Commits

Reviewing files that changed from the base of the PR and between 8e60f01 and a7ccd4e.

📒 Files selected for processing (9)
  • shortcuts/im/helpers.go
  • shortcuts/im/im_feed_shortcut_create.go
  • shortcuts/im/im_feed_shortcut_list.go
  • shortcuts/im/im_feed_shortcut_remove.go
  • shortcuts/im/im_feed_shortcut_test.go
  • skills/lark-im/references/lark-im-feed-shortcut-create.md
  • skills/lark-im/references/lark-im-feed-shortcut-list.md
  • skills/lark-im/references/lark-im-feed-shortcut-remove.md
  • tests/cli_e2e/im/feed_shortcut_workflow_test.go

📝 Walkthrough

Walkthrough

This PR increases the IM feed shortcut batch limit from 10 to 30 chat IDs per call and simplifies the list command by removing pagination and detail-enrichment features. All command metadata, tests, and documentation are updated to reflect these changes.

Changes

IM Feed Shortcut Updates

Layer / File(s) Summary
Batch limit increase (10 → 30)
shortcuts/im/helpers.go, shortcuts/im/im_feed_shortcut_create.go, shortcuts/im/im_feed_shortcut_remove.go, skills/lark-im/references/lark-im-feed-shortcut-create.md, skills/lark-im/references/lark-im-feed-shortcut-remove.md
Update the feedShortcutBatchLimit constant from 10 to 30 and reflect this new limit in command Description and flag help text for both create and remove operations, with corresponding documentation updates.
List command refactoring
shortcuts/im/im_feed_shortcut_list.go, skills/lark-im/references/lark-im-feed-shortcut-list.md
Simplify list to return the full user feed shortcut list via GET /open-apis/im/v2/feed_shortcuts with no pagination flags, no enrichment flags, and no detail lookup; remove --page-token and --no-detail flag handling and all enrichment logic.
Test updates
shortcuts/im/im_feed_shortcut_test.go, tests/cli_e2e/im/feed_shortcut_workflow_test.go
Add batch limit boundary test case, add list-command flag/help assertions, replace list execution tests to verify the simplified single-call contract, and update E2E workflow tests to verify both batch limit and list simplifications.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant ImFeedShortcutList
  participant API as GET /open-apis/im/v2/feed_shortcuts
  Client->>ImFeedShortcutList: +feed-shortcut-list
  ImFeedShortcutList->>API: Single GET request
  API-->>ImFeedShortcutList: {data.shortcuts: [{feed_card_id, type}]}
  ImFeedShortcutList-->>Client: Full shortcut list (no pagination, no detail enrichment)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • larksuite/cli#1273: The main PR is directly related to #1273: it updates the same IM feed-shortcut implementation added there (helpers' chat ID batching limit, create/remove metadata, and list command behavior by removing pagination/detail-enrichment), along with corresponding unit/e2e test and docs adjustments.

Suggested reviewers

  • YangJunzhou-01

Poem

🐰 Batch limits grow from ten to thirty,
Lists simplify, no pagination messy,
Remove the flags, keep code so clean,
The wisest feedbacks now are seen!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 27.27% 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 'feat: align im feed shortcut commands with latest oapi' clearly and specifically summarizes the main change: aligning feed shortcut commands with the latest OAPI contract.
Description check ✅ Passed The description covers all required template sections with substantive content: Summary explains the motivation (aligning with latest OAPI), Changes lists the three main modifications, Test Plan includes checkboxes with specific test commands executed, and Related Issues is addressed.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/feed-shortcut-oapi-align

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 Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.81%. Comparing base (e53f9d9) to head (a7ccd4e).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1437      +/-   ##
==========================================
- Coverage   72.83%   72.81%   -0.02%     
==========================================
  Files         731      733       +2     
  Lines       69111    69190      +79     
==========================================
+ Hits        50335    50380      +45     
- Misses      14999    15028      +29     
- Partials     3777     3782       +5     

☔ 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

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#feat/feed-shortcut-oapi-align -y -g

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/im PR touches the im 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.

1 participant