Skip to content

Conversation

@rishi763
Copy link
Contributor

πŸ“ Summary

  • 1. ...

βœ… Checklist

@rishi763 rishi763 requested a review from alanzhang25 October 29, 2025 23:59
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @rishi763, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the user experience for the judgeval command-line interface, specifically improving how it handles the upload of custom scorers. It introduces more precise error handling for situations where a user tries to upload a scorer that already exists, providing clear instructions. Additionally, it refines the application's error logging strategy by centralizing it within the CLI and includes a minor update to an internal tracing constant.

Highlights

  • Improved Duplicate Scorer Handling: The CLI now provides a specific and user-friendly error message when a user attempts to upload a custom scorer that already exists, guiding them to use an --overwrite flag to resolve the conflict.
  • Centralized Error Logging: Error logging for custom scorer upload failures has been shifted from the core judgeval library to the CLI, ensuring a consistent and user-facing error display.
  • Tracer Module Name Refinement: The internal constant JUDGEVAL_TRACER_INSTRUMENTING_MODULE_NAME has been updated to a simpler value, streamlining internal tracing configuration.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with πŸ‘ and πŸ‘Ž on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request significantly improves the user experience for the upload_scorer CLI command by adding a specific error message for duplicate scorers, guiding the user to use the --overwrite flag. The refactoring of error handling to move logging from the library to the CLI layer is a solid design choice that improves separation of concerns. The changes are logical and enhance the tool's usability.

Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The new exception handling correctly identifies the 409 Conflict error and provides a helpful message. However, it only handles this specific API error. Other API errors (like 401 Unauthorized or 403 Forbidden) will be re-raised, resulting in a full traceback being shown to the user, which isn't ideal for a CLI tool. It would be more robust to handle all JudgmentAPIError exceptions gracefully and provide the user with the specific error detail from the API response, while letting other unexpected exceptions show a full traceback.

Suggested change
except Exception as e:
if isinstance(e, JudgmentAPIError) and e.status_code == 409:
judgeval_logger.error("Duplicate scorer detected. Use --overwrite flag to replace the existing scorer")
raise typer.Exit(1)
# Re-raise other exceptions
raise
except JudgmentAPIError as e:
if e.status_code == 409:
judgeval_logger.error("Duplicate scorer detected. Use --overwrite flag to replace the existing scorer")
else:
judgeval_logger.error(f"Failed to upload custom scorer. API Error: {e.detail}")
raise typer.Exit(1)
except Exception:
# Re-raise other exceptions for Typer to handle (e.g., ValueError from parsing)
raise

Copy link
Collaborator

Choose a reason for hiding this comment

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

did you mean to change this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Abhi made this change

raise typer.Exit(0)
except Exception:
except Exception as e:
if isinstance(e, JudgmentAPIError) and e.status_code == 409:
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this right? i dont think backend throws this kind of error?

@rishi763 rishi763 changed the base branch from main to staging November 1, 2025 01:10
Copy link
Collaborator

@alanzhang25 alanzhang25 left a comment

Choose a reason for hiding this comment

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

lgmt

@propel-code-bot
Copy link

βœ”οΈ Propel has finished reviewing this change.

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