adk deploy ignores .gitignore patterns that start with **/
Maintainer antworten meist innerhalb von 3 Tagen
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 25/100
Rechercherichtung
Start with _get_ignore_patterns_func in cli/cli_deploy.py, which passes the ignore patterns to shutil.ignore_patterns. Leading **/ patterns contain a slash and never match a bare file or folder name, so the stripping logic there needs to handle them. Check the gitignore-style cases listed in the issue, including the trailing slash in **/__pycache__/. Done means copying an agent folder with that function leaves out node_modules and __pycache__ directories. A linked pull request (#8296) is already open, so check it before starting.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
🔴 Required Information
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.pycand a.gitignorewith:**/node_modules **/__pycache__/ - Run
adk deploy cloud_run(oragent_engine/gke), or copy the folder the way the deploy commands do:import shutil from google.adk.cli.cli_deploy import _get_ignore_patterns_func shutil.copytree("agent", "out", ignore=_get_ignore_patterns_func("agent")) - Look at what was copied.
Expected Behavior:
node_modules and __pycache__ are left out, as they are by git and gcloud.
Observed Behavior:
Both are copied: out/node_modules/pkg/index.js and out/sub/__pycache__/x.pyc exist.
Environment Details:
- ADK Library Version: 2.15.0 (
mainat 2b90353) - Desktop OS: Linux
- Python Version: 3.12.13
Model Information:
- Are you using LiteLLM: No
- Which model is being used: N/A
🟡 Optional Information
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.
How often has this issue occurred?:
- Always (100%)
- Vorherrschende Sprache
- Python
- Sterne
- 22.3k
- Forks
- 4.4k
- Ø Merge
- 1 T. 2 Std.
- Gemergte PRs (30 T.)
- 6
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus google/adk-python
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
google/adk-python#8360 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
google/adk-python#8359 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Can pin to litellm version be changed?Evtl. vergeben @llalitkumarrr hat das vor 10 Tagen übernommen. Offenmodels
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 65/100
google/adk-python#8129 · 2 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 3 Tagen
-
OpenAPI tools ignore operation- and path-level server overridesEvtl. vergeben @sanketpatil06 hat das vor 14 Tagen übernommen. Offentools
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
google/adk-python#8064 · 4 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Two docstrings in openapi_tool document parameters the signatures do not acceptEvtl. vergeben @surajksharma07 hat das vor 17 Tagen übernommen. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
google/adk-python#8024 · 1 Kommentar · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 3 Tagen
Alle Issues in google/adk-python
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
vllm-project/vllm#70030 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
TigreGotico/tugaphone#408 ·
Maintainer antworten meist innerhalb von 1 Tag
-
needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
gke-labs/kube-agents#7308 ·
Maintainer antworten meist innerhalb von 1 Tag
-
t: bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 3 Tagen
-
chore
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100
lugassawan/swe-workbench#841 ·