Skip to content

Conversation

@Avi-Robusta
Copy link
Contributor

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Sep 9, 2025

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between 1f0164f and 816b297.

📒 Files selected for processing (1)
  • src/robusta/core/sinks/robusta/dal/model_conversion.py (1 hunks)

Walkthrough

Adds 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

Cohort / File(s) Summary of Changes
Holmes result schema
src/robusta/core/reporting/holmes.py
Added public field metadata: Optional[dict] = None to HolmesChatResult after conversation_history.
Robusta sink model conversion
src/robusta/core/sinks/robusta/dal/model_conversion.py
In ModelConversion.add_ai_chat_data, switched from constructing a new inline metadata dict to reusing block.holmes_result.metadata (or {}), mutating it by setting type and createdAt, and attaching it to the markdown block.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks (1 passed, 2 warnings)

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request lacks a description that summarizes the changes and purpose, making it difficult to understand the intent and context of the modifications. Please add a descriptive summary that explains the purpose of propagating metadata from Holmes, the key changes made, and any relevant background or considerations.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title succinctly describes the core change of propagating metadata from Holmes and clearly identifies the context without extraneous detail.
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch propogate_holmes_metadata

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.

@Avi-Robusta Avi-Robusta changed the title [ROB-1738] propogating the metadata from holmes [ROB-1738] propagating the metadata from holmes Sep 9, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
src/robusta/core/reporting/holmes.py (1)

76-76: Tighten typing for metadata to improve clarity and tooling

Prefer 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]] = None
src/robusta/core/sinks/robusta/dal/model_conversion.py (1)

117-125: Guard None, copy metadata, and handle None analysis

  • Check block.holmes_result before use; return early if None.
  • Shallow-copy metadata = dict(block.holmes_result.metadata or {}) to avoid mutating the original, then use metadata.setdefault for "type" and "createdAt".
  • Guard against block.holmes_result.analysis being None—pass block.holmes_result.analysis or "" into Transformer.to_github_markdown.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d169b2b and 1f0164f.

📒 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

@Avi-Robusta Avi-Robusta enabled auto-merge (squash) September 10, 2025 07:26
@Avi-Robusta Avi-Robusta merged commit 43d2409 into master Sep 10, 2025
8 checks passed
@Avi-Robusta Avi-Robusta deleted the propogate_holmes_metadata branch September 10, 2025 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants