[ROB-1738] propagating the metadata from holmes#1917
Conversation
|
Warning Rate limit exceeded@Avi-Robusta has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 9 minutes and 1 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughAdds an optional metadata field to HolmesChatResult. Updates model conversion to reuse and enrich Holmes result metadata when creating a markdown block, setting type and createdAt, potentially mutating the original metadata. No other data payload or control flow changes. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Agent as Agent/Block
participant Holmes as HolmesChatResult
participant Conv as ModelConversion
participant Sink as Sink/Markdown Block
Agent->>Holmes: holmes_result (analysis, conversation_history, metadata?)
Agent->>Conv: add_ai_chat_data(block)
Conv->>Holmes: read holmes_result.metadata
Note right of Conv: If none, use {}
Conv->>Conv: metadata["type"]="ai_investigation_result"\nmetadata["createdAt"]=now
Conv->>Sink: create markdown block\nwith analysis + mutated metadata
Note over Holmes,Sink: Original metadata may be mutated in-place
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks (1 passed, 2 warnings)❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing Touches
🧪 Generate unit tests
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: 0
🧹 Nitpick comments (2)
src/robusta/core/reporting/holmes.py (1)
76-76: Tighten typing for metadata to improve clarity and toolingPrefer Optional[Dict[str, Any]] over Optional[dict] for consistency and better type-checking across the codebase.
- metadata: Optional[dict] = None + metadata: Optional[Dict[str, Any]] = Nonesrc/robusta/core/sinks/robusta/dal/model_conversion.py (1)
117-125: Guard None, copy metadata, and handle None analysis
- Check
block.holmes_resultbefore use; return early if None.- Shallow-copy
metadata = dict(block.holmes_result.metadata or {})to avoid mutating the original, then usemetadata.setdefaultfor"type"and"createdAt".- Guard against
block.holmes_result.analysisbeing None—passblock.holmes_result.analysis or ""intoTransformer.to_github_markdown.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/robusta/core/reporting/holmes.py(1 hunks)src/robusta/core/sinks/robusta/dal/model_conversion.py(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/robusta/core/sinks/robusta/dal/model_conversion.py (1)
src/robusta/utils/parsing.py (1)
datetime_to_db_str(52-56)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: run_tests
- GitHub Check: run_tests
- GitHub Check: Deploy docs
No description provided.