docs: re-verify the apm 0.28.0 claims in hook and test comments
Checked against apm 0.39.3 live and in its source. The apm-audit-ci description and comments now give 15 root checks and 2 plugin checks, about 70 s through uv run, manifest-parse as a named row, and the new "nothing to scan" wording. The run-bats copytree note, the #204 git-env test header and its LESSONS entry say what holds on 0.39.3. Refs #272 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
This commit is contained in:
1 parent
c2ba7f01bf
commit
7e63f22bf8
5 files changed
+45
-28
No files matched your search
+1
-1
@@ -154,4 +154,4 @@ Under the `run-tests` pre-push hook, git exported `GIT_DIR` to the hook, so a ba
|
||||
|
||||
## 2026-11-26 — A hook's GIT_DIR leaks through any tool that runs git
|
||||
|
||||
#204: pushing from a linked worktree left the shared `.git/config` with `core.bare=true` and the worktree on a detached HEAD at the lock-pinned commit. git exports an absolute `GIT_DIR` to hooks run from a linked worktree. `apm-audit-ci` ran `apm audit --ci`, and its drift replay (apm 0.28.0) runs `git init` and `git checkout` in a temp dir with an env copied from `os.environ`. The inherited `GIT_DIR` won, so both operations hit this repo instead of the temp dir. The 2026-11-13 fix did not cover this: it scrubbed the env only inside `tests/run-tests.sh`, and the apm hooks never pass through that file. Fix: `scripts/lib/clean-git-env.sh` unsets the repo-locating vars, and both `scripts/apm-audit-ci.sh` and the new `scripts/apm-pack-check-clean.sh` source it before calling apm. `tests/test-apm-hooks-git-env.sh` reproduces the leak with a stub `apm`. Rule: any hook that shells out to a tool that runs git must scrub `GIT_*` first. Scrubbing one entry point does not protect the others.
|
||||
#204: pushing from a linked worktree left the shared `.git/config` with `core.bare=true` and the worktree on a detached HEAD at the lock-pinned commit. git exports an absolute `GIT_DIR` to hooks run from a linked worktree. `apm-audit-ci` ran `apm audit --ci`, and its drift replay (apm 0.28.0) runs `git init` and `git checkout` in a temp dir with an env copied from `os.environ`. The inherited `GIT_DIR` won, so both operations hit this repo instead of the temp dir. The 2026-11-13 fix did not cover this: it scrubbed the env only inside `tests/run-tests.sh`, and the apm hooks never pass through that file. Fix: `scripts/lib/clean-git-env.sh` unsets the repo-locating vars, and both `scripts/apm-audit-ci.sh` and the new `scripts/apm-pack-check-clean.sh` source it before calling apm. `tests/test-apm-hooks-git-env.sh` reproduces the leak with a stub `apm`. Rule: any hook that shells out to a tool that runs git must scrub `GIT_*` first. Scrubbing one entry point does not protect the others. *2026-12-02 (#272):* apm 0.39.3 strips `GIT_DIR` and the other repo-locating vars from its own git calls (`git_subprocess_env` in `apm_cli/utils/git_env.py`). The leak was not reproduced again on 0.39.3, and the scrub stays, because the rule is about the hook, not about one tool version.
|
||||
Reference in new issue
Block a user