feat: support note generated event#1159
Conversation
|
|
📝 WalkthroughWalkthroughAdds a new vc.note.generated_v1 event processor that flattens envelope metadata, optionally enriches outputs via a retried note-detail API call to extract note/verbatim tokens and source, registers the event with subscribe/unsubscribe PreConsume wiring, adds tests for success and failure/retry paths, and updates documentation. ChangesVC Note Generated Event
Sequence Diagram(s)sequenceDiagram
participant RawEvent
participant Processor as processVCNoteGenerated
participant APIClient as event.APIClient
participant NoteAPI as Note Detail API
RawEvent->>Processor: incoming envelope payload
Processor->>Processor: unmarshal envelope, build VCNoteGeneratedOutput
alt note_id present and APIClient provided
Processor->>APIClient: CallAPI GET /note/{note_id}
APIClient->>NoteAPI: HTTP GET note detail
NoteAPI-->>APIClient: JSON response or error
APIClient-->>Processor: response/error
Processor->>Processor: parse artifacts, extract tokens and note_source
end
Processor->>RawEvent: return marshaled flat output (or passthrough bytes on malformed payload)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1159 +/- ##
==========================================
+ Coverage 68.74% 68.77% +0.03%
==========================================
Files 627 628 +1
Lines 58579 58670 +91
==========================================
+ Hits 40269 40353 +84
- Misses 15018 15021 +3
- Partials 3292 3296 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@6fbdf241426f1820f58fb74246a6f5fef2a7b933🧩 Skill updatenpx skills add larksuite/cli#feat/vc_event -y -g |
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 `@events/vc/note_generated.go`:
- Around line 130-146: The code currently returns/continues early when both
noteToken and verbatimToken are empty, which skips assigning NoteSource; to fix,
check and assign resp.Data.Note.NoteSource into out.NoteSource (using
VCNoteSourceOutput with SourceType and SourceEntityID) before the early
continue/return so source metadata is preserved even if tokens are not ready
yet; specifically, in the block handling noteToken/verbatimToken (variables
noteToken, verbatimToken, out, resp.Data.Note.NoteSource, VCNoteSourceOutput)
move or duplicate the src check/assignment to run whether or not tokens are
present, then still continue/return when tokens are empty.
🪄 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: fcb9f404-b4a4-4057-a548-a128d87064fa
📒 Files selected for processing (5)
events/vc/note_generated.goevents/vc/note_generated_test.goevents/vc/register.goskills/lark-event/SKILL.mdskills/lark-event/references/lark-event-vc.md
edd84e9 to
6fbdf24
Compare
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 `@skills/lark-event/references/lark-event-vc.md`:
- Around line 70-72: The doc incorrectly states note_source is "only present
when source is a meeting"; update the wording to match the implementation in
fillVCNoteGeneratedDetails by saying note_source is present whenever
resp.Data.Note.NoteSource contains a non-empty source_type or source_entity_id
(i.e., when either field is set), or alternatively change the implementation to
enforce source_type == "meeting" before populating out.NoteSource; reference
fillVCNoteGeneratedDetails, resp.Data.Note.NoteSource and out.NoteSource to
locate the code to align docs with behavior.
🪄 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: 29b3207f-3909-47b7-a874-ffcb735c18e7
📒 Files selected for processing (5)
events/vc/note_generated.goevents/vc/note_generated_test.goevents/vc/register.goskills/lark-event/SKILL.mdskills/lark-event/references/lark-event-vc.md
🚧 Files skipped from review as they are similar to previous changes (4)
- events/vc/register.go
- skills/lark-event/SKILL.md
- events/vc/note_generated_test.go
- events/vc/note_generated.go
Summary
Add
vc.note.generated_v1event listener in the VC domain. The event fires when a note is generated (meeting, recording, or local file upload). The Process hook enrichesnote_token,verbatim_token, andnote_sourcevia the note detail API.Changes
vc.note.generated_v1event: flatten payload, enrichnote_token/verbatim_token/note_sourcevia detail API.vc.note.generated_v1field reference, source type semantics, and examplesTest Plan
lark-cli event listshowsvc.note.generated_v1lark-cli event consume vc.note.generated_v1 --as user --max-events 1 --timeout 30sstreams enriched note eventsRelated Issues
Summary by CodeRabbit
New Features
Documentation
Tests