Skip to content

ROB-1767 use correct date - #794

Merged
aantn merged 10 commits into
masterfrom
rob-1767_use_correct_date
Aug 12, 2025
Merged

aantn merged 10 commits into
masterfrom
rob-1767_use_correct_date

Conversation

@nherment

@nherment nherment commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@coderabbitai

coderabbitai Bot commented Aug 6, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

This update enhances the prompt rendering system by adding the current year to the context available in Jinja2 templates. It updates an existing template to clarify how to interpret dates lacking explicit years and introduces new test fixtures and cases to verify log and event retrieval based on date disambiguation, particularly for scenarios involving year inference.

Changes

Cohort / File(s) Change Summary
Prompt Context Enhancement
holmes/plugins/prompts/__init__.py
Adds "current_year" to the context dictionary passed to Jinja2 templates for prompt rendering, alongside existing date/time variables.
Prompt Template Update
holmes/plugins/prompts/_current_date_time.jinja2
Updates the prompt template to instruct that dates without explicit years should default to the current year unless otherwise indicated.
Existing Test Case Adjustment
tests/llm/fixtures/test_ask_holmes/50_logs_since_specific_date/test_case.yaml
Modifies expected output by removing two log entries, focusing on logs from specific dates.
New Log Retrieval Test Fixtures
tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/*
Adds multiple log and metadata fixture files, a new test case YAML, and a toolsets configuration to test log retrieval and date disambiguation for December logs and error events.
New Event Retrieval Test Fixtures
tests/llm/fixtures/test_ask_holmes/93_events_since_specific_date/*
Adds event log and metadata fixtures, a new test case YAML, and a toolsets configuration to test event retrieval and date interpretation for a specific day.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant PromptEngine
    participant Jinja2Template
    participant SystemClock

    User->>PromptEngine: Submit prompt with date (possibly without year)
    PromptEngine->>SystemClock: Get current datetime
    SystemClock-->>PromptEngine: Return current datetime
    PromptEngine->>Jinja2Template: Render template with context (now, now_timestamp_seconds, current_year)
    Jinja2Template-->>PromptEngine: Rendered prompt with date disambiguation
    PromptEngine-->>User: Return processed prompt/response
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • robusta-dev/holmesgpt#552: Adds "now" and "now_timestamp_seconds" to the context in load_and_render_prompt, which is directly extended in this PR by adding "current_year".
  • robusta-dev/holmesgpt#555: Modifies datetime handling in prompts, related to date context injection and mocking for prompt rendering.

Suggested labels

enhancement

Suggested reviewers

  • moshemorad
  • arikalon1

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e0edd3b and 61adc67.

📒 Files selected for processing (8)
  • tests/llm/fixtures/test_ask_holmes/50_logs_since_specific_date/fetch_pod_logsERROR_default_robusta-holmes-fdf65b49-c7pb7_2023-06-12T00_00_00Z.txt (1 hunks)
  • tests/llm/fixtures/test_ask_holmes/50_logs_since_specific_date/fetch_pod_logsERROR_default_robusta-holmes_2023-06-12T00_00_00Z.txt (1 hunks)
  • tests/llm/fixtures/test_ask_holmes/50_logs_since_specific_date/fetch_pod_logsERROR_default_robusta-holmes_2025-06-12T00_00_00Z.txt (1 hunks)
  • tests/llm/fixtures/test_ask_holmes/50_logs_since_specific_date/fetch_pod_logsError_default_robusta-holmes-fdf65b49-c7pb7_2023-06-12T00_00_00Z.txt (1 hunks)
  • tests/llm/fixtures/test_ask_holmes/50_logs_since_specific_date/fetch_pod_logsError_default_robusta-holmes_2025-06-12T00_00_00Z.txt (1 hunks)
  • tests/llm/fixtures/test_ask_holmes/50_logs_since_specific_date/fetch_pod_logsdefault_robusta-holmes-fdf65b49-c7pb7_2023-06-12T00_00_00Z.txt (1 hunks)
  • tests/llm/fixtures/test_ask_holmes/50_logs_since_specific_date/fetch_pod_logserror_default_robusta-holmes_2025-06-12T00_00_00Z.txt (1 hunks)
  • tests/llm/fixtures/test_ask_holmes/50_logs_since_specific_date/kubectl_find_resourcerobusta-holmes_pod.txt (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • tests/llm/fixtures/test_ask_holmes/50_logs_since_specific_date/fetch_pod_logsError_default_robusta-holmes_2025-06-12T00_00_00Z.txt
  • tests/llm/fixtures/test_ask_holmes/50_logs_since_specific_date/fetch_pod_logsERROR_default_robusta-holmes_2025-06-12T00_00_00Z.txt
  • tests/llm/fixtures/test_ask_holmes/50_logs_since_specific_date/fetch_pod_logserror_default_robusta-holmes_2025-06-12T00_00_00Z.txt
🚧 Files skipped from review as they are similar to previous changes (5)
  • tests/llm/fixtures/test_ask_holmes/50_logs_since_specific_date/fetch_pod_logsERROR_default_robusta-holmes_2023-06-12T00_00_00Z.txt
  • tests/llm/fixtures/test_ask_holmes/50_logs_since_specific_date/kubectl_find_resourcerobusta-holmes_pod.txt
  • tests/llm/fixtures/test_ask_holmes/50_logs_since_specific_date/fetch_pod_logsERROR_default_robusta-holmes-fdf65b49-c7pb7_2023-06-12T00_00_00Z.txt
  • tests/llm/fixtures/test_ask_holmes/50_logs_since_specific_date/fetch_pod_logsError_default_robusta-holmes-fdf65b49-c7pb7_2023-06-12T00_00_00Z.txt
  • tests/llm/fixtures/test_ask_holmes/50_logs_since_specific_date/fetch_pod_logsdefault_robusta-holmes-fdf65b49-c7pb7_2023-06-12T00_00_00Z.txt
⏰ 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: llm_evals
  • GitHub Check: Pre-commit checks
  • GitHub Check: Pre-commit checks
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch rob-1767_use_correct_date

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

♻️ Duplicate comments (2)
tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/fetch_pod_logs2024-12-31T23_59_59Z_default_robusta-holmes-6bbcd9f6f5-2q4jc_2024-12-01T00_00_00Z.txt (1)

1-9: Same date/window mismatch as previous fixture

This “default” log snapshot still embeds 2025-06 timestamps while the file name & match_params claim Dec 2024. Please reconcile the data or adjust the naming/parameters.

tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/fetch_pod_logs2024-12-31T23_59_59Z_Error_default_robusta-holmes-6bbcd9f6f5-2q4jc_2024-12-01T00_00_00Z.txt (1)

1-9: Capital-“Error” variant inherits the same inconsistencies

The issues called out for the lowercase-error fixture (wrong year, mismatching JSON params, inclusion of non-error severities) apply here as well.

🧹 Nitpick comments (6)
holmes/plugins/prompts/__init__.py (2)

24-24: Use a context-manager when opening files

open(path, …).read() leaves the file descriptor open until garbage collection.
Wrap it in a with block to close immediately and avoid FD leaks (especially relevant when many prompts are rendered in long-lived processes).

-    return open(path, encoding="utf-8").read()
+    with open(path, encoding="utf-8") as f:
+        return f.read()

46-52: Do not silently overwrite caller-supplied context keys

dict.update() will override keys provided by the caller (e.g. a custom "current_year" for back-dated prompts).
Protect user intent with setdefault or a new dict instead of in-place mutation:

-    context.update(
-        {
-            "now": f"{now}",
-            "now_timestamp_seconds": int(now.timestamp()),
-            "current_year": now.year,
-        }
-    )
+    safe_defaults = {
+        "now": f"{now}",
+        "now_timestamp_seconds": int(now.timestamp()),
+        "current_year": now.year,
+    }
+    for k, v in safe_defaults.items():
+        context.setdefault(k, v)
holmes/plugins/prompts/_current_date_time.jinja2 (1)

2-2: Minor wording tweak

The word “either” is left hanging without a matching “or”.

-When users mention dates without years (e.g., 'March 25th', 'last May', etc.), assume they either mean the current year ({{ current_year }}) unless context suggests otherwise.
+When users mention dates without years (e.g., 'March 25th', 'last May', etc.), assume they mean the current year ({{ current_year }}) unless context suggests otherwise.
tests/llm/fixtures/test_ask_holmes/93_events_since_specific_date/fetch_configuration_changes2025-06-12T23_59_59Z_2025-06-12T00_00_00Z.txt (1)

1-10: Filename ‑vs-content date order is reversed

The filename encodes end_datetime → start_datetime, while the JSON in Line 1 uses the conventional start_datetime first. This inversion makes it harder to locate fixtures by lexical ordering and invites future confusion.

Consider renaming the file (or swapping the two ISO strings) so that both filename and payload list the start date first.

tests/llm/fixtures/test_ask_holmes/93_events_since_specific_date/get_current_time_.txt (1)

1-8: Trailing “_” in filename looks accidental

get_current_time_.txt ends with an underscore before the extension. Unless this is intentional (e.g., to avoid a clash), dropping the underscore will keep naming consistent with other fixtures.

tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/test_case.yaml (1)

6-9: Over-prescriptive assertions risk brittle tests

Listing the full log line strings (including exact wording and date prefix) forces the LLM to echo them verbatim. Per past guidance, use descriptive assertions (e.g., regexes or contains-clauses) so alternative yet correct phrasings don’t fail the test.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c9314b3 and cdd2842.

📒 Files selected for processing (15)
  • holmes/plugins/prompts/__init__.py (1 hunks)
  • holmes/plugins/prompts/_current_date_time.jinja2 (1 hunks)
  • tests/llm/fixtures/test_ask_holmes/50_logs_since_specific_date/test_case.yaml (0 hunks)
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/fetch_pod_logs2024-12-31T23_59_59Z_Error_default_robusta-holmes-6bbcd9f6f5-2q4jc_2024-12-01T00_00_00Z.txt (1 hunks)
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/fetch_pod_logs2024-12-31T23_59_59Z_default_robusta-holmes-6bbcd9f6f5-2q4jc_2024-12-01T00_00_00Z.txt (1 hunks)
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/fetch_pod_logs2024-12-31T23_59_59Z_error_default_robusta-holmes-6bbcd9f6f5-2q4jc_2024-12-01T00_00_00Z.txt (1 hunks)
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/fetch_pod_logs_default.txt (1 hunks)
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/get_current_time_.txt (1 hunks)
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/kubectl_find_resource_robusta-holmes_pod.txt (1 hunks)
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/test_case.yaml (1 hunks)
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/toolsets.yaml (1 hunks)
  • tests/llm/fixtures/test_ask_holmes/93_events_since_specific_date/fetch_configuration_changes2025-06-12T23_59_59Z_2025-06-12T00_00_00Z.txt (1 hunks)
  • tests/llm/fixtures/test_ask_holmes/93_events_since_specific_date/get_current_time_.txt (1 hunks)
  • tests/llm/fixtures/test_ask_holmes/93_events_since_specific_date/test_case.yaml (1 hunks)
  • tests/llm/fixtures/test_ask_holmes/93_events_since_specific_date/toolsets.yaml (1 hunks)
💤 Files with no reviewable changes (1)
  • tests/llm/fixtures/test_ask_holmes/50_logs_since_specific_date/test_case.yaml
🧰 Additional context used
📓 Path-based instructions (3)
holmes/plugins/prompts/**/*.jinja2

📄 CodeRabbit Inference Engine (CLAUDE.md)

Prompts must be located in holmes/plugins/prompts/{name}.jinja2

Files:

  • holmes/plugins/prompts/_current_date_time.jinja2
tests/llm/fixtures/**

📄 CodeRabbit Inference Engine (CLAUDE.md)

Mock data must be located in tests/llm/fixtures/{test_name}/

Files:

  • tests/llm/fixtures/test_ask_holmes/93_events_since_specific_date/toolsets.yaml
  • tests/llm/fixtures/test_ask_holmes/93_events_since_specific_date/fetch_configuration_changes2025-06-12T23_59_59Z_2025-06-12T00_00_00Z.txt
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/toolsets.yaml
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/get_current_time_.txt
  • tests/llm/fixtures/test_ask_holmes/93_events_since_specific_date/test_case.yaml
  • tests/llm/fixtures/test_ask_holmes/93_events_since_specific_date/get_current_time_.txt
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/test_case.yaml
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/fetch_pod_logs2024-12-31T23_59_59Z_default_robusta-holmes-6bbcd9f6f5-2q4jc_2024-12-01T00_00_00Z.txt
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/kubectl_find_resource_robusta-holmes_pod.txt
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/fetch_pod_logs_default.txt
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/fetch_pod_logs2024-12-31T23_59_59Z_error_default_robusta-holmes-6bbcd9f6f5-2q4jc_2024-12-01T00_00_00Z.txt
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/fetch_pod_logs2024-12-31T23_59_59Z_Error_default_robusta-holmes-6bbcd9f6f5-2q4jc_2024-12-01T00_00_00Z.txt
**/*.py

📄 CodeRabbit Inference Engine (CLAUDE.md)

**/*.py: ALWAYS place Python imports at the top of the file, not inside functions or methods
Use Ruff for formatting and linting (configured in pyproject.toml)
Type hints required (mypy configuration in pyproject.toml)

Files:

  • holmes/plugins/prompts/__init__.py
🧠 Learnings (11)
📓 Common learnings
Learnt from: nherment
PR: robusta-dev/holmesgpt#436
File: tests/llm/fixtures/test_ask_holmes/42_dns_issues_result_new_tools/toolsets.yaml:6-20
Timestamp: 2025-06-05T06:14:11.571Z
Learning: nherment prefers to keep test fixtures simple rather than adding complex security restrictions, even when potential security issues are identified.
📚 Learning: applies to holmes/plugins/prompts/**/*.jinja2 : prompts must be located in holmes/plugins/prompts/{n...
Learnt from: CR
PR: robusta-dev/holmesgpt#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-06T08:36:24.917Z
Learning: Applies to holmes/plugins/prompts/**/*.jinja2 : Prompts must be located in holmes/plugins/prompts/{name}.jinja2

Applied to files:

  • holmes/plugins/prompts/_current_date_time.jinja2
  • holmes/plugins/prompts/__init__.py
📚 Learning: applies to holmes/plugins/toolsets/**/*.yaml : toolsets must be located in holmes/plugins/toolsets/{...
Learnt from: CR
PR: robusta-dev/holmesgpt#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-06T08:36:24.917Z
Learning: Applies to holmes/plugins/toolsets/**/*.yaml : Toolsets must be located in holmes/plugins/toolsets/{name}.yaml or {name}/

Applied to files:

  • tests/llm/fixtures/test_ask_holmes/93_events_since_specific_date/toolsets.yaml
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/toolsets.yaml
📚 Learning: in robusta-dev/holmesgpt config.example.yaml, the azuremonitorlogs toolset configuration shows "enab...
Learnt from: vishiy
PR: robusta-dev/holmesgpt#782
File: config.example.yaml:31-49
Timestamp: 2025-08-05T00:42:23.792Z
Learning: In robusta-dev/holmesgpt config.example.yaml, the azuremonitorlogs toolset configuration shows "enabled: true" as an example of how to enable the toolset, not as a default setting. The toolset is disabled by default and requires explicit enablement in user configurations.

Applied to files:

  • tests/llm/fixtures/test_ask_holmes/93_events_since_specific_date/toolsets.yaml
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/toolsets.yaml
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/kubectl_find_resource_robusta-holmes_pod.txt
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/fetch_pod_logs2024-12-31T23_59_59Z_error_default_robusta-holmes-6bbcd9f6f5-2q4jc_2024-12-01T00_00_00Z.txt
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/fetch_pod_logs2024-12-31T23_59_59Z_Error_default_robusta-holmes-6bbcd9f6f5-2q4jc_2024-12-01T00_00_00Z.txt
📚 Learning: new toolsets require integration tests with mocks...
Learnt from: CR
PR: robusta-dev/holmesgpt#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-06T08:36:24.917Z
Learning: New toolsets require integration tests with mocks

Applied to files:

  • tests/llm/fixtures/test_ask_holmes/93_events_since_specific_date/toolsets.yaml
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/toolsets.yaml
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/get_current_time_.txt
  • tests/llm/fixtures/test_ask_holmes/93_events_since_specific_date/get_current_time_.txt
📚 Learning: in the kubernetes logs toolset for holmes, both current and previous logs are intentionally fetched ...
Learnt from: nherment
PR: robusta-dev/holmesgpt#408
File: holmes/plugins/toolsets/kubernetes_logs.py:90-97
Timestamp: 2025-05-15T05:13:43.169Z
Learning: In the Kubernetes logs toolset for Holmes, both current and previous logs are intentionally fetched and combined for each pod, even though this requires more API calls. This design ensures all logs are captured even when pods restart but retain their name, providing complete diagnostic information.

Applied to files:

  • tests/llm/fixtures/test_ask_holmes/93_events_since_specific_date/toolsets.yaml
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/toolsets.yaml
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/fetch_pod_logs2024-12-31T23_59_59Z_default_robusta-holmes-6bbcd9f6f5-2q4jc_2024-12-01T00_00_00Z.txt
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/kubectl_find_resource_robusta-holmes_pod.txt
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/fetch_pod_logs_default.txt
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/fetch_pod_logs2024-12-31T23_59_59Z_error_default_robusta-holmes-6bbcd9f6f5-2q4jc_2024-12-01T00_00_00Z.txt
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/fetch_pod_logs2024-12-31T23_59_59Z_Error_default_robusta-holmes-6bbcd9f6f5-2q4jc_2024-12-01T00_00_00Z.txt
📚 Learning: in llm-as-judge test cases for holmesgpt, expected outputs should be descriptive rather than prescri...
Learnt from: Sheeproid
PR: robusta-dev/holmesgpt#586
File: tests/llm/fixtures/test_ask_holmes/03_what_is_the_command_to_port_forward/test_case.yaml:4-4
Timestamp: 2025-07-02T10:27:17.231Z
Learning: In LLM-as-judge test cases for HolmesGPT, expected outputs should be descriptive rather than prescriptive when testing for flexible responses like port numbers. Using specific values in expected outputs can cause unnecessary test failures when the AI generates different but equally valid responses.

Applied to files:

  • tests/llm/fixtures/test_ask_holmes/93_events_since_specific_date/test_case.yaml
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/test_case.yaml
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/fetch_pod_logs2024-12-31T23_59_59Z_default_robusta-holmes-6bbcd9f6f5-2q4jc_2024-12-01T00_00_00Z.txt
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/kubectl_find_resource_robusta-holmes_pod.txt
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/fetch_pod_logs_default.txt
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/fetch_pod_logs2024-12-31T23_59_59Z_error_default_robusta-holmes-6bbcd9f6f5-2q4jc_2024-12-01T00_00_00Z.txt
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/fetch_pod_logs2024-12-31T23_59_59Z_Error_default_robusta-holmes-6bbcd9f6f5-2q4jc_2024-12-01T00_00_00Z.txt
📚 Learning: applies to tests/llm/fixtures/** : mock data must be located in tests/llm/fixtures/{test_name}/...
Learnt from: CR
PR: robusta-dev/holmesgpt#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-06T08:36:24.917Z
Learning: Applies to tests/llm/fixtures/** : Mock data must be located in tests/llm/fixtures/{test_name}/

Applied to files:

  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/test_case.yaml
📚 Learning: all new features require unit tests...
Learnt from: CR
PR: robusta-dev/holmesgpt#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-06T08:36:24.917Z
Learning: All new features require unit tests

Applied to files:

  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/test_case.yaml
📚 Learning: resource naming in evals: never use names that hint at the problem or expected behavior (e.g., avoid...
Learnt from: CR
PR: robusta-dev/holmesgpt#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-06T08:36:24.917Z
Learning: Resource naming in evals: Never use names that hint at the problem or expected behavior (e.g., avoid broken-pod, test-project-that-does-not-exist, crashloop-app). Use neutral names that don't give away what the LLM should discover

Applied to files:

  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/test_case.yaml
  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/kubectl_find_resource_robusta-holmes_pod.txt
📚 Learning: for evaluation test fixtures in the holmesgpt project, security contexts and security hardening are ...
Learnt from: aantn
PR: robusta-dev/holmesgpt#783
File: tests/llm/fixtures/test_ask_holmes/100_historical_logs/payment-api.yaml:49-70
Timestamp: 2025-08-05T06:14:39.523Z
Learning: For evaluation test fixtures in the holmesgpt project, security contexts and security hardening are not priorities. The focus should be on functionality and test reliability rather than adding security configurations to Kubernetes manifests used in evals.

Applied to files:

  • tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/kubectl_find_resource_robusta-holmes_pod.txt
⏰ 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). (2)
  • GitHub Check: llm_evals
  • GitHub Check: Pre-commit checks
🔇 Additional comments (6)
tests/llm/fixtures/test_ask_holmes/93_events_since_specific_date/toolsets.yaml (1)

1-5: Fixture configuration looks good

Toolsets are enabled explicitly and the file sits under the correct fixture path.
No issues spotted.

tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/toolsets.yaml (1)

1-5: Fixture configuration looks good

Same comment as above – everything is in the expected place and format.

tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/get_current_time_.txt (1)

1-7: Static time fixture accepted

The captured output is well-formed and follows existing fixture style.
Just remember to refresh if the reference “now” ever changes in related tests.

tests/llm/fixtures/test_ask_holmes/93_events_since_specific_date/fetch_configuration_changes2025-06-12T23_59_59Z_2025-06-12T00_00_00Z.txt (1)

1-10: Double-nesting may violate fixture-location guideline

Org guideline: “Mock data must be located in tests/llm/fixtures/{test_name}/”.

This file sits under
tests/llm/fixtures/test_ask_holmes/93_events_since_specific_date/…,
adding an extra level (93_events_since_specific_date).
Please confirm that the additional sub-directory is acceptable for the test harness; if not, flatten it one level up.

tests/llm/fixtures/test_ask_holmes/50a_logs_since_last_specific_month/kubectl_find_resource_robusta-holmes_pod.txt (1)

1-3: Confirm that embedded resource name doesn’t leak intent

A learning notes that fixture resource names should not hint at the underlying issue (e.g., broken-pod).
robusta-holmes appears benign, but double-check that it’s not steering the LLM toward a specific answer.

tests/llm/fixtures/test_ask_holmes/93_events_since_specific_date/test_case.yaml (1)

1-11: LGTM – test case is concise and uses descriptive expected output

No issues spotted. Matches the best-practice of descriptive, not prescriptive, assertions.

@nherment
nherment requested review from aantn and moshemorad August 6, 2025 13:48
@aantn
aantn enabled auto-merge (squash) August 12, 2025 07:21
@github-actions

Copy link
Copy Markdown
Contributor

Results of HolmesGPT evals

  • ask_holmes: 21/46 test cases were successful, 2 regressions, 1 skipped, 22 mock failures
Test suite Test case Status
ask 01_how_many_pods ✅
ask 02_what_is_wrong_with_pod 🔧
ask 03_what_is_the_command_to_port_forward 🔧
ask 04_related_k8s_events ↪️
ask 05_image_version 🔧
ask 09_crashpod ✅
ask 10_image_pull_backoff 🔧
ask 11_init_containers ✅
ask 14_pending_resources ✅
ask 15_failed_readiness_probe 🔧
ask 17_oom_kill ✅
ask 18_crash_looping_v2 ✅
ask 19_detect_missing_app_details 🔧
ask 20_long_log_file_search 🔧
ask 24_misconfigured_pvc 🔧
ask 28_permissions_error ✅
ask 29_events_from_alert_manager 🔧
ask 39_failed_toolset 🔧
ask 41_setup_argo ✅
ask 42_dns_issues_steps_new_tools 🔧
ask 43_current_datetime_from_prompt ✅
ask 45_fetch_deployment_logs_simple ✅
ask 51_logs_summarize_errors 🔧
ask 52_logs_login_issues ❌
ask 53_logs_find_term ✅
ask 54_not_truncated_when_getting_pods 🔧
ask 59_label_based_counting ✅
ask 60_count_less_than 🔧
ask 61_exact_match_counting ✅
ask 63_fetch_error_logs_no_errors ✅
ask 77_liveness_probe_misconfiguration 🔧
ask 79_configmap_mount_issue 🔧
ask 83_secret_not_found 🔧
ask 86_configmap_like_but_secret 🔧
ask 88_affinity_like_but_taints 🔧
ask 89_runbook_missing_cloudwatch ❌
ask 90_runbook_basic_selection 🔧
ask 93_calling_datadog ✅
ask 93_calling_datadog ✅
ask 93_calling_datadog ✅
ask 97_logs_clarification_needed ✅
ask 100_historical_logs 🔧
ask 110_k8s_events_image_pull 🔧
ask 24a_misconfigured_pvc_basic 🔧
ask 13a_pending_node_selector_basic 🔧
ask 73a_time_window_anomaly 🔧

Legend

  • ✅ the test was successful
  • ↪️ the test was skipped
  • ⚠️ the test failed but is known to be flaky or known to fail
  • 🔧 the test failed due to mock data issues (not a code regression)
  • ❌ the test failed and should be fixed before merging the PR

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.

2 participants