fix: #3273 validate git repo subpaths#3276
Conversation
seratch
left a comment
There was a problem hiding this comment.
The intent of validating git_repo.subpath makes sense, but this currently validates too late.
With an invalid value like subpath="../outside", the code still performs the git clone first and only raises GitSubpathError afterward. Since this is a local configuration error and can be detected without touching the network or filesystem-heavy clone path, we should fail fast before cloning.
Could we move the subpath validation ahead of the clone step so invalid config is rejected before any repository fetch work starts?
Also, the CI is failing now.
38b3a49 to
4e45c26
Compare
|
Thanks for the review. I moved the I also tightened the invalid-subpath regression test to assert that no session exec calls are made, and fixed CI. |
Summary
GitRepo.subpathbefore copying from the cloned repository.GitSubpathError.Test plan
uv run pytest tests/sandbox/test_entries.py -k "git_repo"bash .agents/skills/code-change-verification/scripts/run.shIssue number
Closes #3273
Checks
make lintandmake format