Skip to content

ci: scrub the hook's git env from the selftest; pin the Python stage to 3.11 - #5

Merged
LoopyLuci merged 2 commits into
mainfrom
ci/scrub-git-env
Nov 30, 2026
Merged

LoopyLuci merged 2 commits into
mainfrom
ci/scrub-git-env

Conversation

@LoopyLuci

Copy link
Copy Markdown
Owner

Summary

Two small fixes to the local pipeline in ci/. No product code changes.

  1. Scrub the hook's git environment from the selftest. Inside a git hook, git sets GIT_DIR to the repository the hook runs for. The selftest's temporary repositories ran git init and git add with that variable set, so they acted on the real repository. On a push from a worktree, this rewrote the shared config to core.bare = true, and every worktree then failed with "must be run in a work tree". clean_git_env() drops the repository-location variables. checks.git() and the tests use it. This is a backport of f178fec from chore/rsa-0.10.
  2. Build the Python stage's venv with Python 3.11, the version CI pins. The stage looks for py -3.11 or python3.11, fails with a clear message if neither exists, and rebuilds an existing venv that was made with another Python.

Known issue

On Windows, the Python suite hangs on Python 3.13. python/tests/test_overlay.py::test_a_session_runs_over_real_sockets_after_the_handshake never finishes. On Python 3.11 the suite passes (168 passed, 16 skipped). The cause is not diagnosed yet. This PR avoids 3.13 for the local stage instead of fixing the hang.

Testing

  • python ci/ci.py run --only selftest passes.
  • The checks tests pass with GIT_DIR pointed at a scratch repository, and that repository's config is unchanged.
  • The rebuild path of ensure_venv was run with a stub context: the 3.13 venv was removed and recreated with py -3.11.
  • CI does not run ci/, so the local pre-push hook is the check for this change.

🤖 Generated with Claude Code

LoopyLuci and others added 2 commits November 30, 2026 14:58
Inside a git hook, git sets GIT_DIR to the repository the hook runs for. The
selftest's temporary repositories ran git init and git add with that variable
set, so they acted on the real repository. On a push from a worktree, that
rewrote the shared config to core.bare = true, and every worktree then failed
with "must be run in a work tree".

clean_git_env drops the repository-location variables. The checks' git()
helper and the selftest use it, so temporary repositories find only their own
.git.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
CI pins Python 3.11 for the Python tests. The local python stage used whichever
python ran ci.py, and on Windows Python 3.13 hangs in
tests/test_overlay.py::test_a_session_runs_over_real_sockets_after_the_handshake
(a known issue, not diagnosed yet). The stage now finds a 3.11 (py -3.11 or
python3.11) and fails with a clear message if there is none. It also rebuilds
an existing venv that was made with another Python.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
@LoopyLuci
LoopyLuci merged commit 6d3bf45 into main Nov 30, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant