-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(workflows): add sample 'pass_data...' and update 'conftest.py' #13290
base: main
Are you sure you want to change the base?
Conversation
…ts so they work well together
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @eapl-gemugami, 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!
Summary of Changes
This pull request introduces a new sample, workflows_api_quickstart_pass_data_in_execution_request
, which demonstrates how to pass arguments to a Cloud Workflow execution. It also updates the Workflow YAML definition to accept optional arguments while maintaining compatibility with previous samples. Additionally, the PR refactors existing tests and the conftest.py
file to accommodate the new functionality.
Highlights
- Feature: Introduces a new sample,
pass_data_in_execution_request.py
, showcasing how to pass data to a workflow execution via an argument. - Enhancement: Updates the Workflow YAML definition (
myFirstWorkflow.workflows.yaml
) to accept optional arguments, ensuring backward compatibility. - Refactor: Refactors existing tests and
conftest.py
to support the new sample and argument passing functionality.
Changelog
Click here to see the changelog
- workflows/cloud-client/README.md
- Updates the README to reflect the correct location of the workflow YAML file and adjusts the expected output description.
- Changes the compatible Python version to 3.9+.
- workflows/cloud-client/conftest.py
- Modifies
workflow_id
fixture scope tofunction
to ensure unique workflow IDs for each test. - Updates the workflow creation logic to use a base workflow ID and append a UUID for uniqueness.
- Updates
workflow_exists
function to accept a workflow_id parameter.
- Modifies
- workflows/cloud-client/main_test.py
- Changes
max_time
tomax_tries
in thebackoff
decorator for thetest_workflow_execution
function.
- Changes
- workflows/cloud-client/myFirstWorkflow.workflows.yaml
- Updates the copyright year to 2025.
- Modifies the workflow definition to accept an optional
searchTerm
argument, defaulting to the day of the week in Amsterdam if not provided.
- workflows/cloud-client/pass_data_in_execution_request.py
- Adds a new file containing the
execute_workflow_with_argument
function, which demonstrates how to pass arguments to a workflow execution.
- Adds a new file containing the
- workflows/cloud-client/pass_data_in_execution_request_test.py
- Adds a new test file for the
execute_workflow_with_argument
function, verifying the successful execution and argument passing.
- Adds a new test file for the
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
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 issue 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 is currently in preview and 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 to provide feedback.
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.
A workflow's gentle stream,
Data flows, a waking dream,
Arguments passed on,
Execution begun,
A digital paradigm.
Footnotes
-
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. ↩
There was a problem hiding this 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 introduces a new sample for passing data in execution requests, updates the workflow YAML definition, and refactors existing tests. The changes look good overall, but there are a few areas that could be improved for clarity and maintainability.
Summary of Findings
- Workflow ID Generation: The workflow ID generation in
conftest.py
could be simplified by directly incorporating the base name into the UUID string, improving readability. - README Update: The README update includes a change to the expected output, which is good. However, it could be more explicit about the dependency on the weekday in Amsterdam.
- Copyright Year: The copyright year in
myFirstWorkflow.workflows.yaml
andpass_data_in_execution_request.py
has been updated to 2025. Ensure this is the correct and intended year.
Merge Readiness
The pull request is almost ready for merging. Please address the comments regarding workflow ID generation and copyright year. I am unable to directly approve the pull request, and other reviewers should review and approve this code before merging.
Here is the summary of changes. You are about to add 2 region tags.
This comment is generated by snippet-bot.
|
Description
Fixes b/391200147
workflows_api_quickstart_pass_data_in_execution_request
conftest.py
Checklist
nox -s py-3.9
(see Test Environment Setup)nox -s lint
(see Test Environment Setup)