Conversation
Suite: run suites of scenarios with dynamic bindingSuite: run batches of scenarios with dynamic binding
…-with-dynamic-binding
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 flexibility and scalability of scenario execution by introducing the concept of a Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
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. 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces a Suite class for running batches of scenarios, along with dynamic target binding for Scenarios. The changes are well-structured and include corresponding documentation and tests.
I've found a couple of minor issues:
- A documentation error in
CODEMAP.mdregarding thepass_rateattribute. - A discrepancy between the implementation and documentation of the
Suite.appendmethod, which could lead to runtime errors.
My detailed feedback is in the review comments. Overall, this is a great addition to the library.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a Suite class for running batches of scenarios, along with dynamic target binding for Scenario and Interact. The changes are well-structured and include corresponding documentation and tests.
My review includes a few suggestions:
- Improving the
Suite.appendmethod to automatically handleScenarioBuilderinstances, which aligns with the intent described in the documentation. - Updating the
README.mdexample to reflect this improved usability. - Refactoring a piece of logic in the
ScenarioRunnerto avoid usingcastand private method calls, improving maintainability. - Adjusting the
pass_ratecalculation for empty suites to provide a safer default metric.
| if not self.results: | ||
| return 1.0 |
There was a problem hiding this comment.
Returning 1.0 for an empty suite can be misleading. An empty test suite should generally not be considered 100% successful. This could lead to CI gates passing incorrectly if they check for a 100% pass rate. Returning 0.0 would be a safer and more conservative default.
| if not self.results: | |
| return 1.0 | |
| if not self.results: | |
| return 0.0 |
There was a problem hiding this comment.
Well I think Gemini is not wrong here, the usual convention is that empty = failure. It's the same for pytest for example, if no test ran it will exit with non zero status code.
There was a problem hiding this comment.
it's a bit contradictory with the scenario logic
@computed_field
@property
def status(self) -> ScenarioStatus:
"""The status of the scenario."""
if not self.steps:
return ScenarioStatus.PASS
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
davidberenstein1957
left a comment
There was a problem hiding this comment.
left some comments
| The scenario to add to the suite. For scenario builders, use `scenario.build()` first. | ||
| """ | ||
|
|
||
| self.scenarios.append(scenario) |
There was a problem hiding this comment.
should we add a check to see if the scenario has be build?
There was a problem hiding this comment.
we can also implement auto-build, might be easier for users
Co-authored-by: David Berenstein <david.m.berenstein@gmail.com>
Co-authored-by: David Berenstein <david.m.berenstein@gmail.com>
mattbit
left a comment
There was a problem hiding this comment.
Looks ok to me. There's some improvements that we can plan for later:
- cleaning up the code for the binding logic
- allowing to add a list of scenarios to the
Suite - making sure we are tolerant if
ScenarioBuilderis passed instead ofScenario
Description
Interactclass to setoutputsasNOT_PROVIDEDby default, raising error if stillNotProvidedduring interaction generationScenarioandScenario.runto include atargetattribute, which will be used to replace on run time the non providedoutputsSuite(andSuiteResult) to run a batch of scenariosRelated Issue
OSS-22 (available on Linear)
Type of Change