You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
adk deploy ignores .gitignore patterns that start with **/ #8295
Describe the Bug: adk deploy reads .gitignore, .gcloudignore and .ae_ignore from the agent folder, but patterns with a leading **/ never match anything. Paths such as **/node_modules or **/__pycache__/ are common in these files, and the matching files and folders are still copied into the deployment.
_get_ignore_patterns_func in cli/cli_deploy.py passes the patterns to shutil.ignore_patterns, which compares them with file and folder names, not paths. **/node_modules contains a /, so it never equals a name. Root-anchored patterns such as /.venv already have their leading / stripped for the same reason.
Steps to Reproduce:
In an agent folder, create node_modules/pkg/index.js, sub/__pycache__/x.pyc and a .gitignore with:
**/node_modules
**/__pycache__/
Run adk deploy cloud_run (or agent_engine / gke), or copy the folder the way the deploy commands do:
Additional Context:
In .gitignore syntax, a leading **/ means "in any directory", which is what a plain name already matches, so stripping it gives the same result. Patterns with a / in the middle (like docs/build) also never match today, but I'd leave those alone, since approximating them could drop files the agent needs.
Activity
AshfaqueAhbab commentedon Nov 22, 2026
Duplicate of #8294, opened by mistake.