Skip to content

test: isolate container-gateway and symlink-lint fixtures from the host - #1608

Merged
potiuk merged 1 commit into
mainfrom
fix/test-env-isolation
Oct 13, 2026
Merged

potiuk merged 1 commit into
mainfrom
fix/test-env-isolation

Conversation

@zeroshade

Copy link
Copy Markdown
Member

Summary

  • container-gateway and symlink-lint tests fail on a developer machine with a 0002 umask and a global gitignore listing /.claude/ — the workspace pytest hook then blocks every commit, whatever it touches.
  • container-gateway: fixture .git directories inherited the group-writable umask, which the gateway (correctly) refuses. An autouse fixture in tests/test_layers.py pins the umask to 022 per test.
  • symlink-lint: _git_repo staged the fixture with the developer's global excludes file, dropping the .claude relay the archive tests need. It now runs git with GIT_CONFIG_GLOBAL=/dev/null and GIT_CONFIG_NOSYSTEM=1.

Test-only; no tool behaviour changes. The real lint is unaffected by a global gitignore, since ignore rules don't apply to tracked files.

Type of change

  • Python package (tools/*/ with pyproject.toml) — tests only
  • CI / dev loop (prek, workflows, validators)

Test plan

  • Reproduced on the host: git check-ignore -v .claude/skills/magpie-x → ~/.gitignore_global:2:/.claude/; gateway stderr .git directory … is group- or world-writable; refusing under umask 0002
  • tools/container-gateway: uv run pytest / ruff check / ruff format --check / mypy pass under the same umask
  • tools/symlink-lint: uv run pytest / ruff check / ruff format --check / mypy pass with the same global gitignore
  • Commit made with every prek hook running, workspace pytest included

Linked issues

None.

Generative AI disclosure

Drafted with Claude Code (Opus 5.5) and reviewed by the author; the commit carries a Generated-by: trailer.

Both suites failed on a developer machine with a 0002 umask and a global
gitignore listing /.claude/. container-gateway created fixture .git
directories group-writable, which the gateway correctly refuses; an
autouse fixture now pins the umask to 022. symlink-lint staged its
fixture with the global excludes file, which dropped the .claude relay
the archive test needs; _git_repo now ignores global and system git
config.

Generated-by: Claude Code (Opus 5.5)
@zeroshade
zeroshade requested review from potiuk and a balanced review from Copilot October 13, 2026 11:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@zeroshade zeroshade added family:tools tools/* family:ci .github workflows, prek, validators substrate:sandbox Tool substrate: agent isolation, egress control, settings audit substrate:framework-dev Tool substrate: build / validate / eval the framework itself labels Oct 13, 2026
@potiuk
potiuk merged commit 405b2f5 into main Oct 13, 2026
11 checks passed
@potiuk
potiuk deleted the fix/test-env-isolation branch October 13, 2026 12:08
potiuk pushed a commit to Kaap10/magpie that referenced this pull request Oct 16, 2026
…st (apache#1608)

Both suites failed on a developer machine with a 0002 umask and a global
gitignore listing /.claude/. container-gateway created fixture .git
directories group-writable, which the gateway correctly refuses; an
autouse fixture now pins the umask to 022. symlink-lint staged its
fixture with the global excludes file, which dropped the .claude relay
the archive test needs; _git_repo now ignores global and system git
config.

Generated-by: Claude Code (Opus 5.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

family:ci .github workflows, prek, validators family:tools tools/* substrate:framework-dev Tool substrate: build / validate / eval the framework itself substrate:sandbox Tool substrate: agent isolation, egress control, settings audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants