Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

eapl-gemugami
Copy link
Contributor

@eapl-gemugami eapl-gemugami commented Apr 4, 2025

Description

Fixes b/391200147

  • Update the Workflow YAML definition to receive optional arguments, and keep compatibility with previous samples.
  • Create a sample workflows_api_quickstart_pass_data_in_execution_request
  • Refactor previous tests and conftest.py
  • Update README.py

Checklist

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.

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 to function 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.
  • workflows/cloud-client/main_test.py
    • Changes max_time to max_tries in the backoff decorator for the test_workflow_execution function.
  • 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.
  • 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.
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

  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.

@product-auto-label product-auto-label bot added samples Issues that are directly related to samples. api: workflows Issues related to the Workflows API. labels Apr 4, 2025
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 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 and pass_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.

@eapl-gemugami eapl-gemugami changed the title Paradalicea/feat/workflows/create sample/execution pass data/b 391200147 feat(workflow): add sample 'pass_data...' and update 'conftest.py' Apr 4, 2025
@eapl-gemugami eapl-gemugami added the snippet-bot:force-run Force snippet-bot runs its logic label Apr 4, 2025
@snippet-bot snippet-bot bot removed the snippet-bot:force-run Force snippet-bot runs its logic label Apr 4, 2025
Copy link

snippet-bot bot commented Apr 4, 2025

Here is the summary of changes.

You are about to add 2 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@eapl-gemugami eapl-gemugami marked this pull request as ready for review April 4, 2025 17:15
@eapl-gemugami eapl-gemugami requested review from a team as code owners April 4, 2025 17:15
@eapl-gemugami eapl-gemugami changed the title feat(workflow): add sample 'pass_data...' and update 'conftest.py' feat(workflows): add sample 'pass_data...' and update 'conftest.py' Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: workflows Issues related to the Workflows API. samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants