feat(approval): support approval event consumption#1924
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (13)
🚧 Files skipped from review as they are similar to previous changes (12)
📝 WalkthroughWalkthroughApproval instance and task status-change events are added with typed flattened outputs, user-specific pre-consume subscriptions, global registration, validation tests, event discovery coverage, and CLI documentation updates. ChangesApproval event consumption
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant event.consume
participant approvalSubscriptionPreConsume
participant event.APIClient
participant ApprovalSubscriptionAPI
event.consume->>approvalSubscriptionPreConsume: provide subscription_type
approvalSubscriptionPreConsume->>event.APIClient: POST relation registration
event.APIClient->>ApprovalSubscriptionAPI: create approval subscription
ApprovalSubscriptionAPI-->>event.APIClient: return registration result
event.APIClient-->>approvalSubscriptionPreConsume: keep registration without unsubscribe
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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 `@cmd/event/list_test.go`:
- Around line 41-42: Isolate configuration state in both cmd/event/list_test.go
sites: in TestRunList_TextOutput (lines 41-42) and TestRunList_JSONOutput (lines
97-98), set LARKSUITE_CLI_CONFIG_DIR to t.TempDir() immediately before each
cmdutil.TestFactory call so local configuration cannot affect either test’s
output.
🪄 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: 81cf8151-1eed-4c90-bd83-3f53e4b9e883
📒 Files selected for processing (13)
cmd/event/list_test.gocmd/event/schema_test.goevents/approval/preconsume.goevents/approval/register.goevents/approval/register_test.goevents/approval/types.goevents/register.goskills/lark-approval/references/lark-approval-initiate.mdskills/lark-approval/references/lark-approval-instances-initiated.mdskills/lark-approval/references/lark-approval-tasks-query.mdskills/lark-approval/references/lark-approval-tasks-rollback.mdskills/lark-event/SKILL.mdskills/lark-event/references/lark-event-approval.md
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@e876befa54940f34194f30fcb153f7915c2ec1a2🧩 Skill updatenpx skills add larksuite/cli#feat/approval-event-consume -y -g |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1924 +/- ##
==========================================
+ Coverage 74.96% 75.02% +0.05%
==========================================
Files 892 894 +2
Lines 94077 94294 +217
==========================================
+ Hits 70529 70746 +217
Misses 18137 18137
Partials 5411 5411 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
64ac8c7 to
624fba7
Compare
Register approval.instance.status_changed_v4 and approval.task.status_changed_v4 with custom flattened schemas and user-auth pre-consume subscription setup. Handle approval subscription_type as optional multi-value pre-registration metadata: omitted values register both involved and managed relations, explicit values can be single, comma-separated, or JSON array, and consumers do not unsubscribe on exit. Report partial approval subscription registration failures with registered and failed relation context while preserving the underlying typed error classification. Document approval event output fields and subscription semantics, and refresh approval skill references from API metadata.
624fba7 to
e876bef
Compare
Summary
Add support for consuming Approval instance and task status change events through lark-cli event consume, including user-auth pre-consume subscription setup, flattened output schemas, and agent-facing documentation.
Changes
Test Plan
Related Issues
Summary by CodeRabbit
New Features
approval.instance.status_changed_v4,approval.task.status_changed_v4).subscription_typefiltering for Approval subscriptions (empty/omitted, comma-separated, or JSON array).Documentation
Tests