Skip to content

Feat: Internal updates and cleanup#12

Merged
adivate2021 merged 14 commits into
mainfrom
ahh/0.2.1
Oct 3, 2025
Merged

Feat: Internal updates and cleanup#12
adivate2021 merged 14 commits into
mainfrom
ahh/0.2.1

Conversation

@abhishekg999

Copy link
Copy Markdown
Collaborator

No description provided.

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @abhishekg999, 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 primarily focuses on internal maintenance and code quality improvements. It includes a minor version bump, refactors certain code constructs for conciseness, renames a core method across scorer classes for better semantics, and significantly streamlines the OpenTelemetry span exporter by removing redundant logic and unused components. These changes aim to enhance the codebase's readability, maintainability, and efficiency.

Highlights

  • Version Update: The project version in pom.xml has been updated from 0.2.0 to 0.2.1.
  • Code Style Refinement: The equals method and a private constructor in TraceEvaluationRun.java have been refactored for improved conciseness, converting multi-line if statements and empty blocks into single-line expressions.
  • Method Renaming: The toTransport() method in BaseScorer and its implementations (APIScorer, PromptScorer, TracePromptScorer) has been renamed to getScorerConfig() for better clarity and consistency.
  • Tracer Integration Update: The Tracer class has been updated to reflect the toTransport() to getScorerConfig() method rename, ensuring correct scorer configuration retrieval.
  • Span Exporter Simplification: The JudgmentSpanExporter has undergone significant cleanup, removing unused imports, eliminating the projectId field, and simplifying the export method by removing custom OpenTelemetry resource merging logic and direct logging, now directly delegating to the underlying exporter.
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.

@delve-auditor

delve-auditor Bot commented Sep 23, 2025

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to d99bf7a.

Security Overview
  • 🔎 Scanned files: 18 changed file(s)
Detected Code Changes
Change Type Relevant files
Configuration changes ► pom.xml
    Bump project version; add test dependencies (mockito, wiremock, awaitility, opentelemetry testing) and add maven-jar-plugin to include Implementation-Version manifest entry
Enhancement ► src/main/java/com/judgmentlabs/judgeval/Env.java
    Add JUDGMENT_LOG_LEVEL environment variable support
► src/main/java/com/judgmentlabs/judgeval/Version.java
    Add Version utility to read Implementation-Version from manifest
► src/main/java/com/judgmentlabs/judgeval/tracer/BaseTracer.java
    Introduce BaseTracer with evaluation, span helpers, and exporter creation logic
► src/main/java/com/judgmentlabs/judgeval/tracer/Tracer.java
    Refactor Tracer to extend BaseTracer and initialize OpenTelemetry SDK with batch processor and resource attributes
► src/main/java/com/judgmentlabs/judgeval/utils/Logger.java
    Use Env values, add configurable log level loading and default level change
Refactor ► src/main/java/com/judgmentlabs/judgeval/scorers/BaseScorer.java
    Replace large concrete helper class with minimal BaseScorer interface (essential methods only)
► src/main/java/com/judgmentlabs/judgeval/scorers/APIScorer.java
    Update inheritance to implement new BaseScorer interface; add getters/defaults and change transport method to use getScorerConfig/getStrictMode
► src/main/java/com/judgmentlabs/judgeval/data/Example.java
    Remove ExampleParams enum and many builder convenience methods; simplify property handling
► src/main/java/com/judgmentlabs/judgeval/data/TraceEvaluationRun.java
    Minor equals/constructor formatting and style cleanup
► src/main/java/com/judgmentlabs/judgeval/scorers/api_scorers/AnswerCorrectnessScorer.java
    Replace ExampleParams references with literal required param keys
► src/main/java/com/judgmentlabs/judgeval/scorers/api_scorers/AnswerRelevancyScorer.java
    Replace ExampleParams references with literal required param keys
► src/main/java/com/judgmentlabs/judgeval/scorers/api_scorers/FaithfulnessScorer.java
    Replace ExampleParams references with literal required param keys
► src/main/java/com/judgmentlabs/judgeval/scorers/api_scorers/InstructionAdherenceScorer.java
    Replace ExampleParams references with literal required param keys
► src/main/java/com/judgmentlabs/judgeval/scorers/api_scorers/prompt_scorer/PromptScorer.java
    Rename to getScorerConfig and use getStrictMode; adapt to new scorer interface
► src/main/java/com/judgmentlabs/judgeval/scorers/api_scorers/prompt_scorer/TracePromptScorer.java
    Rename to getScorerConfig and use getStrictMode; adapt to new scorer interface
► src/main/java/com/judgmentlabs/judgeval/tracer/exporters/JudgmentSpanExporter.java
    Simplify exporter: add project header to HTTP exporter, remove resource-wrapping of spans and complex attribute handling
Other ► src/main/java/com/judgmentlabs/judgeval/scorers/ExampleScorer.java
    Delete ExampleScorer abstract class (removed)

Reply to this PR with @delve-auditor followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

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

Copy link
Copy Markdown

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 contains internal updates and cleanup. The main changes include renaming the toTransport() method to getScorerConfig() across various scorer classes for better naming consistency, which has been applied throughout the codebase. Additionally, the JudgmentSpanExporter has been significantly refactored to simplify its implementation by removing the manual modification of span resources and instead passing the project ID via an HTTP header. This is a great improvement for both code clarity and performance. Other changes include minor code formatting adjustments and a version bump. Overall, the changes are positive and improve the quality of the codebase.

@abhishekg999

Copy link
Copy Markdown
Collaborator Author

/gemini review

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

Copy link
Copy Markdown

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 introduces several internal updates and cleanups. Key changes include refactoring the Tracer class by extracting a BaseTracer, adding support for configurable log levels, and including the SDK version in the JAR manifest. Test dependencies have been added, and the JudgmentSpanExporter has been simplified. The method toTransport() has been consistently renamed to getScorerConfig() across scorer classes for better clarity.

My review focuses on improving debuggability and fixing a potential issue with service identification in OpenTelemetry traces. I've identified a hardcoded service name that should be made dynamic and a silent exception catch that could be improved with logging. Overall, the changes are positive and improve the structure and functionality of the SDK.

Comment on lines +270 to +272
} catch (Exception e) {
return null;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The exception in resolveProjectId is caught silently, only returning null. This makes it difficult to diagnose why resolving the project ID might fail (e.g., network issues, authentication problems). It would be beneficial to log the exception here to provide more context for debugging when the project resolution fails.

        } catch (Exception e) {
            Logger.error("Failed to resolve project ID for project '" + name + "': " + e.getMessage());
            return null;
        }

@JudgmentLabs JudgmentLabs deleted a comment from gemini-code-assist Bot Oct 1, 2025

@adivate2021 adivate2021 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.

lgtm

@adivate2021 adivate2021 merged commit 6f11e62 into main Oct 3, 2025
2 checks passed
@adivate2021 adivate2021 deleted the ahh/0.2.1 branch October 3, 2025 01:34
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