Skip to content

Fix get robusta api key check - #688

Merged
moshemorad merged 3 commits into
masterfrom
remove_check
Jul 22, 2025
Merged

moshemorad merged 3 commits into
masterfrom
remove_check

Conversation

@moshemorad

Copy link
Copy Markdown
Collaborator

No description provided.

@moshemorad
moshemorad requested a review from arikalon1 July 22, 2025 18:41
@coderabbitai

coderabbitai Bot commented Jul 22, 2025 •

Copy link
Copy Markdown
Contributor

"""

Walkthrough

A new constant, ROBUSTA_AI_MODEL_NAME, was introduced in the configuration module to replace the hardcoded string "Robusta" in both the configuration and utility logic. Related logic in the Robusta utility now checks for the model's presence in the config rather than using an environment variable. Additionally, a test was updated to mock the load_robusta_api_key import path correctly.

Changes

File(s) Change Summary
holmes/config.py Added ROBUSTA_AI_MODEL_NAME constant and used it in place of the literal "Robusta" string.
holmes/utils/robusta.py Replaced environment variable check with a config model list check using the new constant; updated import.
tests/test_server_endpoints.py Changed patch decorator target from "holmes.utils.robusta.load_robusta_api_key" to "server.load_robusta_api_key" in multiple tests.

Estimated code review effort

2 (~20 minutes)

Possibly related PRs

  • Try load robusta ai #650: Introduces a constant for the Robusta AI model name and updates usage to rely on this constant; related to model loading configuration in holmes/config.py.

Suggested reviewers

  • aantn
  • arikalon1
    """

📜 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 050bab6 and ed681ec.

📒 Files selected for processing (1)
  • tests/test_server_endpoints.py (4 hunks)
✅ Files skipped from review due to trivial changes (1)
  • tests/test_server_endpoints.py
⏰ 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 Docstrings

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.
    • @coderabbitai modularize this function.
  • 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.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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 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: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 52285cf and 050bab6.

📒 Files selected for processing (1)
  • tests/test_server_endpoints.py (1 hunks)
🧠 Learnings (1)
📓 Common learnings
Learnt from: nherment
PR: robusta-dev/holmesgpt#610
File: .github/workflows/llm-evaluation.yaml:39-42
Timestamp: 2025-07-08T08:45:41.069Z
Learning: The robusta-dev/holmesgpt codebase has comprehensive existing validation for Azure environment variables (AZURE_API_BASE, AZURE_API_KEY, AZURE_API_VERSION) and MODEL in tests/llm/utils/classifiers.py, tests/llm/conftest.py, and holmes/core/llm.py. Don't suggest adding redundant validation logic.
Learnt from: nherment
PR: robusta-dev/holmesgpt#610
File: .github/workflows/llm-evaluation.yaml:39-42
Timestamp: 2025-07-08T08:45:41.069Z
Learning: When suggesting improvements to environment variable handling in robusta-dev/holmesgpt, check first if validation logic already exists rather than reimplementing it.
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: nherment
PR: robusta-dev/holmesgpt#610
File: .github/workflows/llm-evaluation.yaml:39-42
Timestamp: 2025-07-08T08:45:41.069Z
Learning: The robusta-dev/holmesgpt codebase has comprehensive existing validation for Azure environment variables (AZURE_API_BASE, AZURE_API_KEY, AZURE_API_VERSION) and MODEL in tests/llm/utils/classifiers.py, tests/llm/conftest.py, and holmes/core/llm.py. Don't suggest adding redundant validation logic.
Learnt from: nherment
PR: robusta-dev/holmesgpt#610
File: .github/workflows/llm-evaluation.yaml:39-42
Timestamp: 2025-07-08T08:45:41.069Z
Learning: When suggesting improvements to environment variable handling in robusta-dev/holmesgpt, check first if validation logic already exists rather than reimplementing it.
⏰ 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

Comment thread tests/test_server_endpoints.py

@arikalon1 arikalon1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@github-actions

Copy link
Copy Markdown
Contributor

Results of HolmesGPT evals

  • ask_holmes: 46/66 test cases were successful, 0 regressions
  • investigate: 14/16 test cases were successful, 0 regressions
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 06: explain_issue ✅
ask 07: high_latency ✅
ask 08: sock_shop_frontend ⚠️
ask 09: crashpod ✅
ask 10: image_pull_backoff ✅
ask 11: init_containers ✅
ask 12: job_crashing ✅
ask 13: pending_node_selector ✅
ask 14: pending_resources ✅
ask 15: failed_readiness_probe ✅
ask 16: failed_no_toolset_found ✅
ask 17: oom_kill ✅
ask 18: crash_looping_v2 ✅
ask 19: detect_missing_app_details ✅
ask 20: long_log_file_search ✅
ask 21: job_fail_curl_no_svc_account ⚠️
ask 22: high_latency_dbi_down ⚠️
ask 23: app_error_in_current_logs ✅
ask 24: misconfigured_pvc ✅
ask 25: misconfigured_ingress_class ✅
ask 26: multi_container_logs ✅
ask 27: permissions_error_no_helm_tools ✅
ask 28: permissions_error_helm_tools_enabled ⚠️
ask 29: events_from_alert_manager ✅
ask 30: basic_promql_graph_cluster_memory ✅
ask 31: basic_promql_graph_pod_memory ✅
ask 32: basic_promql_graph_pod_cpu ✅
ask 33: http_latency_graph ✅
ask 34: memory_graph ✅
ask 35: tempo ✅
ask 36: argocd_find_resource ✅
ask 37: argocd_wrong_namespace ⚠️
ask 38: rabbitmq_split_head ✅
ask 39: failed_toolset ✅
ask 40: disabled_toolset ✅
ask 41: setup_argo ✅
ask 42: dns_issues_result_all_tools ⚠️
ask 42: dns_issues_result_new_tools ⚠️
ask 42: dns_issues_result_old_tools ⚠️
ask 42: dns_issues_steps_new_all_tools ⚠️
ask 42: dns_issues_steps_new_tools ⚠️
ask 42: dns_issues_steps_old_tools ⚠️
ask 43: current_datetime_from_prompt ✅
ask 43: slack_deployment_logs ✅
ask 44: slack_statefulset_logs ⚠️
ask 45: fetch_deployment_logs_simple ✅
ask 46: job_crashing_no_longer_exists ⚠️
ask 47: truncated_logs_context_window ⚠️
ask 48: logs_since_thursday ⚠️
ask 49: logs_since_last_week ⚠️
ask 50: logs_since_specific_date ⚠️
ask 51: logs_summarize_errors ✅
ask 52: logs_login_issues ✅
ask 53: logs_find_term ✅
ask 54: not_truncated_when_getting_pods ✅
ask 55: kafka_runbook ⚠️
ask 56: kafka_runbook_no_tool ⚠️
ask 58: counting_pods_by_status ⚠️
ask 59: label_based_counting ✅
ask 60: time_based_filtering ✅
ask 61: exact_match_counting ✅
investigate 01: oom_kill ✅
investigate 02: crashloop_backoff ✅
investigate 03: cpu_throttling ✅
investigate 04: image_pull_backoff ✅
investigate 05: crashpod ✅
investigate 06: job_failure ✅
investigate 07: job_syntax_error ✅
investigate 08: memory_pressure ✅
investigate 09: high_latency ✅
investigate 10: KubeDeploymentReplicasMismatch ✅
investigate 11: KubePodCrashLooping ✅
investigate 12: KubePodNotReady ✅
investigate 13: Watchdog ✅
investigate 14: tempo ✅
investigate 15: dns_resolution ⚠️
investigate 16: dns_resolution_no_tool ⚠️

Legend

  • ✅ the test was successful
  • ⚠️ the test failed but is known to be flaky or known to fail
  • ❌ 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