Fix(cli): validate agent folder name for dashes in agent_engine deploy - #6760
Fix(cli): validate agent folder name for dashes in agent_engine deploy#6760Ahmed-Ali-313 wants to merge 8 commits into
Conversation
|
Hi @wyf7107, I have submitted this PR to resolve #2902 by adding pre-deployment validation for agent folder names in cli_deploy.py. It validates that the agent directory name is a valid Python identifier, preventing runtime syntax errors on Agent Engine caused by dashes, and provides a clear, actionable error message suggesting an underscore-based alternative. All unit tests have been added and verified. Whenever you have a moment, please review the changes. Thank you |
|
Hi @wyf7107, Whenever you have a chance, I’d appreciate your feedback or review on these validation changes. Thank you! |
|
Hi @wyf7107, I hope you're doing well. I wanted to gently follow up on this PR to see if you've had a chance to review the validation changes. Please let me know if you have any feedback or if anything needs to be adjusted. Thanks again for your time! |
|
Hi @wyf7107, I have resolved all merge conflicts and updated the branch with the latest All unit tests and lint checks are passing cleanly (30/30 passed). The PR is clean and ready for review whenever you have a chance. Thank you for your time! |
Description
Fixes #2902
When deploying an agent using
adk deploy agent_enginewhere the agent folder name contains dashes (e.g.,my-agent-folder), Vertex AI Agent Engine fails at deployment runtime with a Python syntax error (invalid syntax (agent_engine_app.py)) because module names in Python cannot contain dashes.Changes
_validate_agent_folder_nameincli_deploy.pyto validate that the agent directory name is a valid Python identifier before deployment begins.my_agent_folder).test_cli_deploy.pyverifying validation behavior for valid and invalid names.Test Plan
pytest tests/unittests/cli/utils/test_cli_deploy.py(54 passed).