scripts/check_new_py_files.py misses added files on Windows under jj and hg
@llalitkumarrr ci sta già lavorando.
Dal 7/9/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
get_vcs_added_files() in scripts/check_new_py_files.py builds absolute paths for the jj and hg backends with os.path.join, which inserts os.sep. On Windows that yields a mixed-separator path:
/workspace\src/google/adk/agents/_jj_agent.py
Every downstream comparison in the module uses forward slashes. The module already normalises at three other sites — lines 144, 151, 321 and 409 all call .replace(os.sep, '/'). The jj (line 215) and hg (line 225) branches are the two that missed it.
The git backend is unaffected because git emits forward slashes natively, which is why this is invisible in the common case.
Consequence: on Windows under jj or hg, newly added .py files are not matched, so the script reports nothing to check and silently passes.
Steps to Reproduce
Clone the repo on Windows and install dev dependencies.
Run the script's own test suite:
pytest tests/unittests/tools/... -k check_new_py_files
(the suite is test_check_new_py_files.py)
Observe the jj and hg cases fail on path-separator mismatch in the mock assertions.
Expected Behavior
Paths returned by get_vcs_added_files() use forward slashes for every VCS backend, so the downstream comparisons match — the same normalisation the module already applies elsewhere.
Observed Behavior
jj and hg return -separated paths on Windows, which never match, so added files go undetected.
test_check_new_py_files.py on Windows: 6 failed / 23 passed
Two of those six are this bug. The other four are separate problems and are not part of this report: one is symlink-privilege (WinError 1314) and two shell out to a POSIX sh forwarder.
Environment Details
ADK Library Version (pip show google-adk): N/A — the defect is in scripts/, not the
installed package; reproduced from a source checkout of main
Desktop OS: Windows 11 (Windows-11-10.0.26200-SP0)
Python Version (python -V): Python 3.13.15
Model Information
Are you using LiteLLM: N/A
Which model is being used: N/A
This is a repository tooling bug; no model is involved.
🟡 Optional Information
Regression
Unknown — the normalisation is present at the other four sites, so the jj/hg branches look like they were added later without it rather than having regressed.
Logs
Nothing is logged. The script exits successfully having found no added files, which is the failure mode: it does not error, it under-reports.
Additional Context
No workflow runs this suite on Windows, so nothing upstream could have caught it. This matches two Windows path bugs already fixed here — #6415 and #6419 (adk eval mis-handling Windows paths).
Minimal Reproduction Code
import os
what the jj branch does today, on Windows:
jj_root = "/workspace"
p = "src/google/adk/agents/_jj_agent.py"
print(os.path.join(jj_root, p))
-> /workspace\src/google/adk/agents/_jj_agent.py (mixed separators)
what every other site in the module does:
print(os.path.join(jj_root, p).replace(os.sep, "/"))
-> /workspace/src/google/adk/agents/_jj_agent.py
How often has this issue occurred?
Always (100%) — on Windows with jj or hg.
Suggested fix
Apply the module's existing normalisation to the two branches that lack it:
jj branch (line 215)
p = os.path.join(jj_root, p).replace(os.sep, '/')
hg branch (line 225)
os.path.join(hg_root, f.strip()).replace(os.sep, '/')
Five lines changed, two of them comments. Verified on Windows: 6 failed / 23 passed → 4 failed / 25 passed, with the remaining four being the unrelated problems noted above.
Patch: patches/adk-python/0001-fix-scripts-normalize-VCS-reported-paths-to-forward-.patch (applies cleanly to main as of 2026-09-06).
Happy to open a PR once the CLA is signed.
- Lingua principale
- Python
- Stelle
- 21.6k
- Fork
- 4k
- Merge medio
- 13h 49m
- PR unite (30g)
- 10
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di google/adk-python
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
google/adk-python#7217 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
google/adk-python#7206 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
google/adk-python#7205 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
google/adk-python#7196 · 1 commento ·
-
eval request clarification
Difficoltà 1/5 1-3 ore Idoneità per principianti 86/100
google/adk-python#7146 · 2 commenti · 1 assegnatario ·
Tutte le issue di google/adk-python
Issue simili
-
link-check link-check:sphinx-theme
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
OpenHands/extensions#626 · 1 commento ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
CSCfi/sd-search-api#39 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100