Skip to content

fix(im): report feed group failures as typed errors#1305

Open
evandance wants to merge 2 commits into
mainfrom
fix/im-ci
Open

fix(im): report feed group failures as typed errors#1305
evandance wants to merge 2 commits into
mainfrom
fix/im-ci

Conversation

@evandance

@evandance evandance commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

The no_legacy_runtime_api_call lint guard on main rejects five runtime.DoAPIJSON call sites in the im feed group shortcuts, leaving the lint job red on every run. This switches those call sites to runtime.DoAPIJSONTyped so feed group list and query failures classify into typed errors, consistent with the rest of the im domain.

Changes

  • shortcuts/im/im_feed_group_list.go: DoAPIJSONDoAPIJSONTyped (single-page and all-pages paths)
  • shortcuts/im/im_feed_group_list_item.go: DoAPIJSONDoAPIJSONTyped (single-page and all-pages paths)
  • shortcuts/im/im_feed_group_query_item.go: DoAPIJSONDoAPIJSONTyped

DoAPIJSONTyped issues an identical request and returns the same data shape; only error classification differs.

Test Plan

  • go run -C lint . .. passes (previously 5 no_legacy_runtime_api_call rejects)
  • gofmt, go vet, go build ./... pass
  • go test ./shortcuts/im/... ./shortcuts/common/... passes

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Removed

    • Removed the feed-group CLI shortcuts: +feed-group-list, +feed-group-list-item, +feed-group-query-item.
  • Documentation

    • Deleted Feed Group reference pages and updated the lark-im skill docs to reflect removal of feed-group shortcuts.
  • Other

    • Clarified user-facing descriptions for +flag-create and +flag-cancel.

Feed group list and query commands now classify API failures into typed
errors, consistent with the rest of the im domain. This restores the
main branch lint gate to green.
@evandance evandance added bug Something isn't working domain/im PR touches the im domain size/S Low-risk docs, CI, test, or chore only changes labels Jun 6, 2026
@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown

Need an answer fast? Review this PR in Change Stack to ask focused questions about the PR or a changed range.

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: 1513323d-688b-4f13-8edf-a37f60303530

📥 Commits

Reviewing files that changed from the base of the PR and between 8bdc82e and d4f97e4.

📒 Files selected for processing (16)
  • shortcuts/im/helpers_test.go
  • shortcuts/im/im_feed_group_item_test.go
  • shortcuts/im/im_feed_group_items.go
  • shortcuts/im/im_feed_group_list.go
  • shortcuts/im/im_feed_group_list_item.go
  • shortcuts/im/im_feed_group_list_test.go
  • shortcuts/im/im_feed_group_query_item.go
  • shortcuts/im/im_flag_cancel.go
  • shortcuts/im/im_flag_create.go
  • shortcuts/im/shortcuts.go
  • skill-template/domains/im.md
  • skills/lark-im/SKILL.md
  • skills/lark-im/references/lark-im-feed-group-list-item.md
  • skills/lark-im/references/lark-im-feed-group-list.md
  • skills/lark-im/references/lark-im-feed-group-query-item.md
  • skills/lark-im/references/lark-im-feed-groups.md
💤 Files with no reviewable changes (13)
  • skills/lark-im/references/lark-im-feed-group-query-item.md
  • skills/lark-im/references/lark-im-feed-group-list.md
  • skill-template/domains/im.md
  • shortcuts/im/im_feed_group_list_test.go
  • shortcuts/im/im_feed_group_list.go
  • shortcuts/im/im_feed_group_items.go
  • shortcuts/im/im_feed_group_item_test.go
  • shortcuts/im/shortcuts.go
  • skills/lark-im/references/lark-im-feed-groups.md
  • shortcuts/im/helpers_test.go
  • shortcuts/im/im_feed_group_query_item.go
  • skills/lark-im/references/lark-im-feed-group-list-item.md
  • shortcuts/im/im_feed_group_list_item.go
✅ Files skipped from review due to trivial changes (3)
  • shortcuts/im/im_flag_create.go
  • shortcuts/im/im_flag_cancel.go
  • skills/lark-im/SKILL.md

📝 Walkthrough

Walkthrough

Three feed-group shortcuts switch untyped JSON decoding to typed decoding. The PR removes feed-group shortcuts and tests from the registry, updates two IM flag description strings, and deletes Feed Group documentation and permission entries.

Changes

Feed group shortcuts typed API migration and cleanup

Layer / File(s) Summary
Migrate shortcuts to DoAPIJSONTyped
shortcuts/im/im_feed_group_list.go, shortcuts/im/im_feed_group_list_item.go, shortcuts/im/im_feed_group_query_item.go
Replaced DoAPIJSON with DoAPIJSONTyped in single-page and pagination/auto-pagination paths for feed-group list, list-item, and query-item shortcuts. Response handling and rendering remain unchanged.
Remove shortcuts from registry & tests; update descriptions
shortcuts/im/helpers_test.go, shortcuts/im/shortcuts.go, shortcuts/im/im_flag_cancel.go, shortcuts/im/im_flag_create.go
Removed feed-group shortcut identifiers from Shortcuts() and adjusted TestShortcuts expectations; rewrote +flag-cancel and tweaked +flag-create Description strings. Deleted feed-group test files.
Remove feed-group docs and permissions
skill-template/domains/im.md, skills/lark-im/SKILL.md, skills/lark-im/references/*
Deleted Feed Group concept text, feed.groups API resource section, related reference pages, and feed.groups.* permission table entries in lark-im documentation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • larksuite/cli#1102: Prior PR touching feed-group shortcut implementations and related wiring.
  • larksuite/cli#1273: Removed +feed-group-* shortcuts and adjusted shortcut expectations to include +feed-shortcut-*.

Suggested reviewers

  • YangJunzhou-01
  • wittam-01

Poem

🐰 I hopped through docs and code today,
Typed JSON showed me the way,
Shortcuts trimmed and flags made clear,
Tests and pages quietly disappear,
A tidy hop, a carrot cheer!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the primary change: replacing DoAPIJSON with DoAPIJSONTyped to report feed group failures as typed errors and resolve lint failures.
Description check ✅ Passed The description is comprehensive and follows the template structure, including Summary, Changes, Test Plan, and Related Issues sections with sufficient detail about the motivations and verification approach.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 fix/im-ci

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.

@github-actions github-actions Bot added size/M Single-domain feat or fix with limited business impact and removed size/S Low-risk docs, CI, test, or chore only changes labels Jun 6, 2026
@codecov

codecov Bot commented Jun 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.00%. Comparing base (5788a6c) to head (d4f97e4).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1305      +/-   ##
==========================================
+ Coverage   70.95%   71.00%   +0.04%     
==========================================
  Files         685      681       -4     
  Lines       65702    65367     -335     
==========================================
- Hits        46622    46412     -210     
+ Misses      15401    15314      -87     
+ Partials     3679     3641      -38     

☔ 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 Jun 6, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#fix/im-ci -y -g

@github-actions github-actions Bot added size/XL Architecture-level or global-impact change and removed size/M Single-domain feat or fix with limited business impact labels Jun 6, 2026
Remove the feed group list/query shortcut registration, implementation, tests, and skill references so the im domain no longer exposes unsupported feed group commands.

Keep the remaining im flag validation paths on typed error envelopes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working domain/im PR touches the im domain size/XL Architecture-level or global-impact change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant