feat(evals): add reliability harvester and 500/503 retry support#23626
feat(evals): add reliability harvester and 500/503 retry support#23626alisa-alisa merged 6 commits intomainfrom
Conversation
Summary of ChangesHello, 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 significantly enhances the robustness and observability of evaluation runs by introducing an automatic retry mechanism for transient API errors and a system to collect and analyze these reliability events. It also improves the security of test file handling, ensuring that evaluation tests are more resilient to external API instability and better protected against malicious path manipulations. Highlights
Ignored Files
Using Gemini Code AssistThe 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
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 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a valuable retry mechanism for transient API errors and a script for harvesting reliability data. The implementation is solid, but I've identified a few areas for improvement concerning asynchronous programming best practices in test-helper.ts and robustness in the harvest_api_reliability.sh script. Specifically, there's a mix of synchronous and asynchronous code that should be made consistent, and the shell script has some potential concurrency issues and misleading documentation.
d3e48f2 to
20004fb
Compare
|
Size Change: -4 B (0%) Total Size: 26.3 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request introduces a retry mechanism for transient API errors (500/503) in evaluation tests and adds a script to harvest reliability data. A security audit found no high or critical severity vulnerabilities, and the security enhancements to prevent path traversal in test file setup are a positive improvement. The changes are well-implemented with good test coverage, and the suggestion to improve error handling in the new harvester script to make it more robust against failures like authentication issues is valid.
Summary
This PR implements a robust retry mechanism for transient API errors (500 and 503) encountered during evaluation runs. It also introduces an automated harvester script to gather and analyze these reliability events from GitHub Actions artifacts, helping us track and reduce developer friction caused by API instability.
Details
evals/test-helper.tsto automatically retry tests up to 3 times when the Gemini API returnsINTERNAL(500) orUNAVAILABLE(503) errors.evals/logs/api-reliability.jsonlwith timestamps, test names, model info, and error codes.scripts/harvest_api_reliability.shwhich uses the GitHub CLI (gh) to download artifacts from recent E2E and Nightly eval runs and generate a summary report of API reliability.VITEST_RETRY: 0) to ensure our custom logging-aware retry logic takes precedence.Related Issues
Resolves #23168.
How to Validate
npx vitest evals/test-helper.test.tsto verify the retry logic, logging, and security checks.evals/logs/api-reliability.jsonlis created.ghauth) Run./scripts/harvest_api_reliability.shto see it querying GitHub for recent runs.Validation results of the workflow
Results of the harvester script
Pre-Merge Checklist