Skip to content

Conversation

@asamal4
Copy link
Contributor

@asamal4 asamal4 commented Jul 23, 2025

  • Remove additional print statements (now added in LSC-Eval)
  • Update method names
  • Use summary result from lsc
  • minor refactoring

Summary by CodeRabbit

Summary by CodeRabbit

  • Refactor
    • Simplified the evaluation process and result reporting for a more streamlined experience.
    • Output now displays a concise summary of failures or a success message, instead of detailed per-evaluation results.
  • Bug Fixes
    • Updated .gitignore to exclude evaluation output directories, keeping repositories clean.
  • Documentation
    • Revised evaluation README with updated setup references and reordered supported evaluation methods.
    • Removed example output logs for a clearer, more concise guide.

@coderabbitai
Copy link

coderabbitai bot commented Jul 23, 2025

Walkthrough

The script was refactored to consolidate evaluation execution and result reporting. Manual iteration and detailed per-evaluation output were removed. Now, a single method handles all evaluations, and a summary is printed. Some argument defaults were updated, and logging configuration was slightly reformatted. The .gitignore was updated to ignore eval_output* directories. The evaluation README was revised to reorder supported evaluation types, update setup instructions, and remove an example output section.

Changes

File(s) Change Summary
test/evals/eval.py Refactored to use a single evaluation method and summary output; removed manual iteration and detailed printouts; updated some argument defaults; minor logging reformat.
.gitignore Added ignore pattern for eval_output* directories.
test/evals/README.md Updated setup instructions link; reordered supported evaluation types; removed example output section.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • readme for LSC agent e2e eval #31: Adds documentation describing the evaluation process and usage of the AgentGoalEval class, directly related to the evaluation workflow refactored in this PR.

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 9f5cd80 and 45ce631.

📒 Files selected for processing (3)
  • .gitignore (1 hunks)
  • test/evals/README.md (1 hunks)
  • test/evals/eval.py (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • .gitignore
  • test/evals/README.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/evals/eval.py
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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 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.

@openshift-ci
Copy link

openshift-ci bot commented Jul 23, 2025

Hi @asamal4. Thanks for your PR.

I'm waiting for a rh-ecosystem-edge member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@asamal4
Copy link
Contributor Author

asamal4 commented Jul 23, 2025

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Jul 23, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@asamal4
Copy link
Contributor Author

asamal4 commented Jul 23, 2025

/ok-to-test

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 (1)
test/evals/eval.py (1)

21-30: Consider making configuration more flexible.

The argument configuration is appropriate for the evaluation setup and aligns with the latest lsc logic. However, consider making these values configurable through command-line arguments or environment variables for better flexibility across different environments.

For example, you could add command-line argument parsing:

parser = argparse.ArgumentParser(description="Agent goal evaluation")
parser.add_argument("--eval-data-yaml", default="assisted_eval_data.yaml")
parser.add_argument("--agent-endpoint", default="http://localhost:8090")
parser.add_argument("--agent-provider", default="gemini")
# ... other arguments
args = parser.parse_args()
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 084f50f and 01bca47.

📒 Files selected for processing (1)
  • test/evals/eval.py (1 hunks)
🔇 Additional comments (3)
test/evals/eval.py (3)

1-6: LGTM! Clean docstring and imports.

The updated docstring clearly describes the script's purpose, and the import statements are appropriate for the functionality.


10-17: Well-configured logging setup.

The logging configuration appropriately sets a WARNING level by default to reduce noise while enabling INFO level for the specific lsc_agent_eval logger to track evaluation progress. The format includes all necessary details for debugging.


32-44: Excellent refactoring with clear result handling.

The use of run_evaluation() and get_result_summary() greatly simplifies the workflow while preserving precise success/failure reporting, and the exit codes plus emojis improve usability.

Because AgentGoalEval and its get_result_summary() method are imported from the external lsc_agent_eval library (not defined locally), please manually verify that:

  • get_result_summary() returns a dictionary.
  • The dictionary contains numeric entries for the keys "FAIL" and "ERROR".

@openshift-ci
Copy link

openshift-ci bot commented Jul 23, 2025

@asamal4: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/ok-to-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@asamal4
Copy link
Contributor Author

asamal4 commented Jul 23, 2025

/hold
waiting for lightspeed-core/lightspeed-evaluation#20 to get merged first

@asamal4 asamal4 marked this pull request as ready for review July 23, 2025 13:59
@openshift-ci openshift-ci bot requested review from eranco74 and jhernand July 23, 2025 13:59
@asamal4
Copy link
Contributor Author

asamal4 commented Jul 23, 2025

/unhold
lightspeed-core/lightspeed-evaluation#20 merged.

@asamal4
Copy link
Contributor Author

asamal4 commented Jul 23, 2025

@carbonin PTAL

@jhernand
Copy link
Collaborator

/ok-to-test

@carbonin
Copy link
Collaborator

Thanks for doing this @asamal4

I tested it out just to be sure. The output now looks like this (with some artificial failures added for examples):

(venv) 08:36:24:~/Source/assisted-chat (eval-update1 *)$ make test-eval 
Refreshing OCM token...
Running agent evaluation tests...
2025-07-24 08:36:28,014 - lsc_agent_eval.core.utils.judge - WARNING - Using generic provider format for gemini
2025-07-24 08:36:28,015 - lsc_agent_eval.core.agent_goal_eval.agent_goal_eval - INFO - Running 4 evaluations
❌ basic_introduction: FAIL                                                                                                                                                                                                                                                                                                   
   Query: Hi!                                                                                                                                                                                                                                                                                                                 
   Response: Hello! I'm an AI assistant for the Assisted Installer. I can help you create OpenShift clusters, list available versions, get cluster information, and more. What would you like to do today?                                                                                                                    
   Evaluation type: judge-llm                                                                                                                                                                                                                                                                                                 
   Expected response: Goodbye                                                                                                                                                                                                                                                                                                 
✅ basic_cluster_request: PASS                                                                                                                                                                                                                                                                                                
✅ list_versions: PASS                                                                                                                                                                                                                                                                                                        
❌ available_operators: FAIL                                                                                                                                                                                                                                                                                                  
   Query: What operators are available?                                                                                                                                                                                                                                                                                       
   Response: There are two operator bundles available:                                                                                                                                                                                                                                                                        

*   **Virtualization**: Run virtual machines alongside containers on one platform. This bundle includes operators like `kube-descheduler`, `nmstate`, `self-node-remediation`, `cnv`, `fence-agents-remediation`, `mtv`, `node-healthcheck`, and `node-maintenance`.
*   **OpenShift AI**: Train, serve, monitor and manage AI/ML models and applications using GPUs. This bundle includes operators like `pipelines`, `authorino`, `servicemesh`, `serverless`, `openshift-ai`, `amd-gpu`, `kmm`, `node-feature-discovery`, `nvidia-gpu`, and `odf`.
   Evaluation type: judge-llm                                                                                                                                                                                                                                                                                                 
   Expected response: There are no operators available                                                                                                                                                                                                                                                                        
Running evaluation for available_operators: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:19<00:00,  5.00s/it]
2025-07-24 08:36:48,007 - lsc_agent_eval.core.agent_goal_eval.results - INFO - Results saved to results/agent_goal_eval_results_20250724_083648.csv

=========================
EVALUATION SUMMARY
=========================
Total Evaluations: 4
✅ Passed: 2
❌ Failed: 2
⚠️  Errored: 0
Success Rate: 50.0%
=========================

❌ 2 evaluation(s) failed!
make: *** [Makefile:75: test-eval] Error 1

If there's no way to prevent writing the results dir can you add it to .gitignore?
Also can you update the output in the test readme (or just remove that section since I'm not sure it helps much)?

@asamal4
Copy link
Contributor Author

asamal4 commented Jul 24, 2025

If there's no way to prevent writing the results dir can you add it to .gitignore?
Also can you update the output in the test readme (or just remove that section since I'm not sure it helps much)?

@carbonin I updated the folder name, and added it to gitignore. and removed output from readme.

@carbonin
Copy link
Collaborator

/ok-to-test

@carbonin
Copy link
Collaborator

/lgtm

@carbonin
Copy link
Collaborator

/approve

@openshift-ci
Copy link

openshift-ci bot commented Jul 25, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: asamal4, carbonin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@eranco74
Copy link
Collaborator

/ok-to-test

@eranco74
Copy link
Collaborator

/retest

@asamal4
Copy link
Contributor Author

asamal4 commented Jul 27, 2025

/ok-to-test

@tsorya
Copy link
Member

tsorya commented Jul 28, 2025

/lgtm
/oc-to-test
/retest

@tsorya
Copy link
Member

tsorya commented Jul 28, 2025

/ok-to-test

@asamal4
Copy link
Contributor Author

asamal4 commented Jul 28, 2025

/close
stuck with Konflux
raised another PR #69

@openshift-ci openshift-ci bot closed this Jul 28, 2025
@openshift-ci
Copy link

openshift-ci bot commented Jul 28, 2025

@asamal4: Closed this PR.

In response to this:

/close
stuck with Konflux
raised another PR #69

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants