fix: add missing run.sh for x402 scenario#185
fix: add missing run.sh for x402 scenario#185ayushozha wants to merge 2 commits intogoogle-agentic-commerce:mainfrom
Conversation
The x402 scenario directory was missing a run.sh script, which is inconsistent with the sibling cards/ directory. Add a convenience wrapper that delegates to cards/run.sh with --payment-method x402. Also update the README to reference the new run.sh directly. Fixes google-agentic-commerce#107 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
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 streamlines the execution of the x402 payment scenario by introducing a dedicated shell script. This script simplifies the process for users by abstracting away the need to manually specify the payment method, improving the developer experience and reducing potential setup errors. The accompanying documentation has also been updated to reflect this change, ensuring clarity and ease of use. 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. 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 correctly adds a convenience run.sh script for the x402 scenario and updates the documentation. My review focuses on improving the robustness of the new script. I've suggested a change to ensure the script works correctly regardless of the directory from which it's run, addressing a potential bug. Otherwise, the changes look good.
| #!/bin/bash | ||
|
|
||
| # A script to automate the execution of the x402 payment example. | ||
| # This is a convenience wrapper that runs the standard scenario with | ||
| # the x402 payment method. | ||
|
|
||
| SCRIPT_DIR="$(dirname "$0")" | ||
| exec bash "$SCRIPT_DIR/../cards/run.sh" --payment-method x402 "$@" |
There was a problem hiding this comment.
The cards/run.sh script that is being called expects to be run from the repository root. The current implementation of this wrapper script will fail if it's not executed from the repository root itself (e.g., if a user changes into this directory and runs ./run.sh). This can be fixed by changing the current directory to the repository root before executing the cards/run.sh script.
Additionally, it's good practice to add set -e to the script to ensure it exits immediately if any command fails.
| #!/bin/bash | |
| # A script to automate the execution of the x402 payment example. | |
| # This is a convenience wrapper that runs the standard scenario with | |
| # the x402 payment method. | |
| SCRIPT_DIR="$(dirname "$0")" | |
| exec bash "$SCRIPT_DIR/../cards/run.sh" --payment-method x402 "$@" | |
| #!/bin/bash | |
| set -e | |
| # A script to automate the execution of the x402 payment example. | |
| # This is a convenience wrapper that runs the standard scenario with | |
| # the x402 payment method. | |
| # The wrapped script, cards/run.sh, expects to be run from the repository root. | |
| # To make this script runnable from any directory, we first change to the repo root. | |
| cd "$(dirname "$0")/../../../../../../" | |
| exec bash "samples/python/scenarios/a2a/human-present/cards/run.sh" --payment-method x402 "$@" |
Address Gemini review feedback: add set -e, cd to repo root using dirname, and use absolute path for the wrapped script. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
run.shscript tosamples/python/scenarios/a2a/human-present/x402/that delegates to the existingcards/run.shwith--payment-method x402run.shinstead of pointing tocards/run.shFixes #107
Test plan
bash samples/python/scenarios/a2a/human-present/x402/run.shstarts the x402 scenario correctlycards/run.shwith the correct--payment-method x402flag"$@"🤖 Generated with Claude Code