Skip to content

Conversation

@tony
Copy link
Member

@tony tony commented Jan 25, 2026

Summary

  • Add [protocol "file"] allow = always to gitconfig fixture to fix submodule tests in strict build environments
  • Add regression test that reproduces the issue

Root Cause

Git submodule operations spawn child processes that don't inherit local repo config. The child git clone needs protocol.file.allow=always in global config ($HOME/.gitconfig), not just local repo config.

Test Plan

  • Regression test test_gitconfig_submodule_file_protocol reproduces the error without fix
  • All 564 tests pass with fix applied
  • Verified fix works in isolated git environment (no system/global config interference)

Fixes #509

tony added 3 commits January 25, 2026 08:15
…rotocol (#509)

why: Reproduce the "transport 'file' not allowed" error that occurs in
strict build environments when git submodule operations spawn child
processes that don't inherit local repo config
what:
- Add test_gitconfig_submodule_file_protocol test
- Uses monkeypatch to simulate isolated git environment
- Marked xfail until gitconfig fixture is fixed
…ests

why: git submodule operations spawn child processes that don't inherit
local repo config, causing "transport 'file' not allowed" errors in
strict build environments (#509)
what:
- Add [protocol "file"] allow = always to gitconfig fixture
why: The gitconfig fixture now includes protocol.file.allow=always
what:
- Remove xfail marker from test_gitconfig_submodule_file_protocol
@codecov
Copy link

codecov bot commented Jan 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.38%. Comparing base (25dc853) to head (f2ef0fb).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #510      +/-   ##
==========================================
+ Coverage   53.22%   53.38%   +0.16%     
==========================================
  Files          38       38              
  Lines        5676     5696      +20     
  Branches     1063     1063              
==========================================
+ Hits         3021     3041      +20     
  Misses       2144     2144              
  Partials      511      511              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tony tony marked this pull request as ready for review January 25, 2026 14:20
@tony tony changed the title Fix git submodule file:// protocol in test fixture Fix git submodule file:// protocol in test fixture Jan 25, 2026
@tony
Copy link
Member Author

tony commented Jan 25, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

If this code review was useful, please react with 👍. Otherwise, react with 👎.

tony added a commit that referenced this pull request Jan 25, 2026
why: Document the pytest plugin fix for strict build environments
what:
- Add Tests section for 0.39.x release
- Note the protocol.file.allow=always addition to gitconfig fixture
tony added a commit that referenced this pull request Jan 25, 2026
why: Document the pytest plugin fix for strict build environments
what:
- Add Tests section for 0.39.x release
- Note the protocol.file.allow=always addition to gitconfig fixture
@tony tony force-pushed the libvcs-0.38.2-fix branch from 8fa3ac1 to 67d7791 Compare January 25, 2026 14:41
tony added a commit that referenced this pull request Jan 25, 2026
why: Document the pytest plugin fix for strict build environments
what:
- Add Tests section for 0.39.x release
- Note the protocol.file.allow=always addition to gitconfig fixture
@tony tony force-pushed the libvcs-0.38.2-fix branch from 67d7791 to c5d4172 Compare January 25, 2026 14:42
why: Document the pytest plugin fix for strict build environments
what:
- Add Tests section for 0.39.x release
- Note the protocol.file.allow=always addition to gitconfig fixture
@tony tony force-pushed the libvcs-0.38.2-fix branch from c5d4172 to f2ef0fb Compare January 25, 2026 14:43
@tony tony merged commit a627ca8 into master Jan 25, 2026
8 checks passed
@tony tony deleted the libvcs-0.38.2-fix branch January 25, 2026 14:46
tony added a commit that referenced this pull request Jan 25, 2026
why: The fixture was returning early if .gitconfig already existed,
even if the file was empty or missing protocol.file.allow=always.
This caused failures on Arch Linux build where git/container setup
creates an incomplete .gitconfig before the fixture runs.

what:
- Remove early return that skipped writing when file exists
- Fixture now always writes the full config with protocol.file.allow
- Follow-up to #510, #511 for #509
tony added a commit that referenced this pull request Jan 25, 2026
why: The fixture was returning early if .gitconfig already existed,
even if the file was empty or missing protocol.file.allow=always.
This caused failures on Arch Linux build where git/container setup
creates an incomplete .gitconfig before the fixture runs.

what:
- Remove early return that skipped writing when file exists
- Fixture now always writes the full config with protocol.file.allow
- Follow-up to #510, #511 for #509
tony added a commit that referenced this pull request Jan 25, 2026
## Summary

- Fix `gitconfig` fixture to always write config - removes early return that skipped writing when file exists
- Follow-up to #510, #511 for #509

## Problem

The `gitconfig` fixture had an early return at lines 157-158:

```python
if gitconfig.exists():
    return gitconfig
```

If ANYTHING creates `.gitconfig` first (empty or incomplete) - git itself during `git init`, the nspawn container setup, another fixture - the fixture returns early WITHOUT writing `protocol.file.allow=always`.

Confirmed by reporter running debug script: empty `.gitconfig` was created by container/git before the fixture could write the proper config.

## Solution

Remove the early return. The fixture now always writes the complete config with `protocol.file.allow=always`.
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.

test failure against python 3.14

2 participants