Skip to content

Commit 227c859

Browse files
EliahKaganclaude
andcommitted
DIAG v4: minimal single-job diagnostic for fast turnaround
Replace the entire test-cygwin workflow with a single `diag` job that: - Runs Cygwin's `git submodule update --init --recursive` (the actual thing that creates the disputed directories) - Dumps Windows-side ACL via `Get-Acl`/`icacls` on each candidate path - Dumps Cygwin-side `stat`/`getfacl`, `mount`, `getent passwd` - Tries `git rev-parse` on each fixture, with the pre-fix `safe.directory` (only main repo and `.git`) - Runs two controlled experiments: `chown` the gitdb worktree, then also `chown` `.git/modules/gitdb`, re-running `rev-parse` after each. Confirms whether ownership is the only blocker. No pytest, no matrix, no extra setup steps. Should complete in ~2-3 minutes once a Cygwin runner picks it up, well ahead of the v1/v2/v3 diags that are still queued behind the chain's matrix. This branch should be deleted once the data is captured. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 8f1348d commit 227c859

1 file changed

Lines changed: 129 additions & 102 deletions

File tree

‎.github/workflows/cygwin-test.yml‎

Lines changed: 129 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -6,131 +6,158 @@ permissions:
66
contents: read
77

88
jobs:
9-
test:
10-
strategy:
11-
matrix:
12-
selection: [fast, perf]
13-
include:
14-
- selection: fast
15-
additional-pytest-args: --ignore=test/performance
16-
- selection: perf
17-
additional-pytest-args: test/performance
18-
19-
fail-fast: false
20-
9+
diag:
2110
runs-on: windows-latest
2211

23-
env: &cygwin-env
12+
env:
2413
CHERE_INVOKING: "1"
2514
CYGWIN_NOWINPATH: "1"
2615

27-
defaults: &cygwin-defaults
16+
defaults:
2817
run:
2918
shell: C:\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr "{0}"
3019

3120
steps:
32-
- &force-lf
33-
name: Force LF line endings
21+
- name: Force LF line endings
3422
run: |
35-
git config --global core.autocrlf false # Affects the non-Cygwin git.
36-
shell: pwsh # Do this outside Cygwin, to affect actions/checkout.
23+
git config --global core.autocrlf false
24+
shell: pwsh
3725

38-
- &checkout
39-
uses: actions/checkout@v6
26+
- uses: actions/checkout@v6
4027
with:
4128
fetch-depth: 0
4229

43-
- &install-cygwin
44-
name: Install Cygwin
30+
- name: Install Cygwin
4531
uses: cygwin/cygwin-install-action@v6
4632
with:
47-
packages: git python39 python-pip-wheel python-setuptools-wheel python-wheel-wheel
48-
add-to-path: false # No need to change $PATH outside the Cygwin environment.
33+
packages: git
34+
add-to-path: false
4935

50-
- &verbose-output
51-
name: Arrange for verbose output
52-
run: |
53-
# Arrange for verbose output but without shell environment setup details.
54-
echo 'set -x' >~/.bash_profile
55-
56-
- &safe-directory
57-
name: Special configuration for Cygwin git
36+
- name: Configure Cygwin git safe.directory (PRE-FIX state, no submodule entries)
5837
run: |
5938
git config --global --add safe.directory "$(pwd)"
6039
git config --global --add safe.directory "$(pwd)/.git"
61-
git config --global --add safe.directory "$(pwd)/git/ext/gitdb"
62-
git config --global --add safe.directory "$(pwd)/git/ext/gitdb/gitdb/ext/smmap"
6340
git config --global core.autocrlf false
6441
65-
- &prepare-repo
66-
name: Prepare this repo for tests
67-
run: |
68-
./init-tests-after-clone.sh
69-
70-
- &git-identity
71-
name: Set git user identity and command aliases for the tests
72-
run: |
73-
git config --global user.email "travis@ci.com"
74-
git config --global user.name "Travis Runner"
75-
# If we rewrite the user's config by accident, we will mess it up
76-
# and cause subsequent tests to fail
77-
cat test/fixtures/.gitconfig >> ~/.gitconfig
78-
79-
- &setup-venv
80-
name: Set up virtual environment
42+
- name: Initialize submodules (Cygwin git, recursive)
8143
run: |
82-
python3.9 -m venv .venv
83-
echo 'BASH_ENV=.venv/bin/activate' >>"$GITHUB_ENV"
44+
git submodule update --init --recursive
8445
85-
- &update-pypa
86-
name: Update PyPA packages
46+
- name: DIAG — full ownership and ACL trace
47+
shell: pwsh
8748
run: |
88-
python -m pip install -U pip 'setuptools; python_version<"3.12"' wheel
89-
90-
- &install-deps
91-
name: Install project and test dependencies
92-
run: |
93-
pip install '.[test]'
94-
95-
- name: Show version and platform information
96-
run: |
97-
uname -a
98-
command -v git python
99-
git version
100-
python --version
101-
python -c 'import os, sys; print(f"sys.platform={sys.platform!r}, os.name={os.name!r}")'
102-
103-
- name: Test with pytest (${{ matrix.additional-pytest-args }})
104-
run: |
105-
pytest --color=yes -p no:sugar --instafail -vv ${{ matrix.additional-pytest-args }}
106-
107-
reproduce-safe-dir:
108-
strategy:
109-
matrix:
110-
run: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256]
111-
fail-fast: false
112-
113-
runs-on: windows-latest
114-
115-
env: *cygwin-env
116-
117-
defaults: *cygwin-defaults
118-
119-
steps:
120-
- *force-lf
121-
- *checkout
122-
- *install-cygwin
123-
- *verbose-output
124-
- *safe-directory
125-
- *prepare-repo
126-
- *git-identity
127-
- *setup-venv
128-
- *update-pypa
129-
- *install-deps
130-
131-
- name: Run submodule tests
49+
$repo = "D:\a\GitPython\GitPython"
50+
Write-Host "==================== Windows-side ACL ===================="
51+
$paths = @(
52+
$repo,
53+
"$repo\.git",
54+
"$repo\git",
55+
"$repo\git\ext",
56+
"$repo\git\ext\gitdb",
57+
"$repo\git\ext\gitdb\.git",
58+
"$repo\.git\modules",
59+
"$repo\.git\modules\gitdb",
60+
"$repo\git\ext\gitdb\gitdb",
61+
"$repo\git\ext\gitdb\gitdb\ext",
62+
"$repo\git\ext\gitdb\gitdb\ext\smmap",
63+
"$repo\git\ext\gitdb\gitdb\ext\smmap\.git",
64+
"$repo\.git\modules\gitdb\modules",
65+
"$repo\.git\modules\gitdb\modules\smmap"
66+
)
67+
foreach ($p in $paths) {
68+
Write-Host "==== $p"
69+
if (Test-Path -LiteralPath $p) {
70+
$acl = Get-Acl -LiteralPath $p
71+
Write-Host "Owner: $($acl.Owner)"
72+
Write-Host "Group: $($acl.Group)"
73+
$acl.Access | Where-Object { -not $_.IsInherited } | Format-Table IdentityReference, AccessControlType, FileSystemRights, InheritanceFlags, PropagationFlags -AutoSize
74+
icacls $p
75+
} else {
76+
Write-Host "(does not exist)"
77+
}
78+
Write-Host ""
79+
}
80+
81+
- name: DIAG — Cygwin-side ownership and rev-parse
13282
run: |
133-
python -m pytest -vv \
134-
test/test_docs.py::Tutorials::test_submodules \
135-
test/test_repo.py::TestRepo::test_submodules \
136-
test/test_submodule.py::TestSubmodule::test_root_module
83+
set +e
84+
echo "===================================================================="
85+
echo "Cygwin user identity"
86+
echo "===================================================================="
87+
whoami
88+
id
89+
echo
90+
echo "===================================================================="
91+
echo "Cygwin: getent passwd"
92+
echo "===================================================================="
93+
getent passwd "$(whoami)" 2>&1
94+
echo
95+
echo "===================================================================="
96+
echo "Mount info (look for ntsec/acl flags)"
97+
echo "===================================================================="
98+
mount
99+
echo
100+
echo "===================================================================="
101+
echo "Per-path stat + getfacl"
102+
echo "===================================================================="
103+
for path in \
104+
"$(pwd)" \
105+
"$(pwd)/.git" \
106+
"$(pwd)/git" \
107+
"$(pwd)/git/ext" \
108+
"$(pwd)/git/ext/gitdb" \
109+
"$(pwd)/git/ext/gitdb/.git" \
110+
"$(pwd)/.git/modules" \
111+
"$(pwd)/.git/modules/gitdb" \
112+
"$(pwd)/git/ext/gitdb/gitdb" \
113+
"$(pwd)/git/ext/gitdb/gitdb/ext" \
114+
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap" \
115+
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap/.git" \
116+
"$(pwd)/.git/modules/gitdb/modules" \
117+
"$(pwd)/.git/modules/gitdb/modules/smmap"; do
118+
echo "--- $path"
119+
stat -c 'uid=%u(%U) gid=%g(%G) mode=%a type=%F' "$path" 2>&1
120+
if [ -f "$path" ]; then
121+
echo "(gitlink content):"
122+
cat "$path"
123+
echo
124+
fi
125+
getfacl --absolute-names "$path" 2>&1 | sed 's/^/ /' | head -15
126+
echo
127+
done
128+
echo
129+
echo "===================================================================="
130+
echo "git rev-parse on each fixture (PRE-FIX safe.directory)"
131+
echo "===================================================================="
132+
for fixture in "$(pwd)" "$(pwd)/git/ext/gitdb" "$(pwd)/git/ext/gitdb/gitdb/ext/smmap"; do
133+
echo "--- $fixture"
134+
git -C "$fixture" rev-parse --show-toplevel 2>&1
135+
echo "(rc=$?)"
136+
done
137+
echo
138+
echo "===================================================================="
139+
echo "Controlled experiment: chown gitdb worktree, then re-test"
140+
echo "===================================================================="
141+
chown -R "$(id -u):$(id -g)" "$(pwd)/git/ext/gitdb" 2>&1 | head -5
142+
echo "After chown of $(pwd)/git/ext/gitdb:"
143+
stat -c ' uid=%u(%U) %n' "$(pwd)/git/ext/gitdb"
144+
echo
145+
for fixture in "$(pwd)/git/ext/gitdb" "$(pwd)/git/ext/gitdb/gitdb/ext/smmap"; do
146+
echo "--- $fixture"
147+
git -C "$fixture" rev-parse --show-toplevel 2>&1
148+
echo "(rc=$?)"
149+
done
150+
echo
151+
echo "===================================================================="
152+
echo "Controlled experiment: chown .git/modules/gitdb, then re-test"
153+
echo "===================================================================="
154+
chown -R "$(id -u):$(id -g)" "$(pwd)/.git/modules/gitdb" 2>&1 | head -5
155+
echo "After chown of $(pwd)/.git/modules/gitdb:"
156+
stat -c ' uid=%u(%U) %n' "$(pwd)/.git/modules/gitdb"
157+
echo
158+
for fixture in "$(pwd)/git/ext/gitdb" "$(pwd)/git/ext/gitdb/gitdb/ext/smmap"; do
159+
echo "--- $fixture"
160+
git -C "$fixture" rev-parse --show-toplevel 2>&1
161+
echo "(rc=$?)"
162+
done
163+
true

0 commit comments

Comments
 (0)