Skip to content

Commit de69197

Browse files
EliahKaganclaude
andcommitted
DIAG v6: pre-drop replication with submodules: recursive on actions/checkout
Tests the pre-drop scenario empirically. With `submodules: recursive` on `actions/checkout`, all the submodule directories should theoretically be created by Windows git (and thus, per my v4/v5 model, all be `BUILTIN\\Administrators`-owned). But pre-drop CI runs (`ab71d659`/`d3c26139`/`d6c07d78`/`45e4d76a` and `89c1104b`/`4cb1c741`/`cb28fae5`/`59b541c7`) consistently showed `[gitdb]` failing the trust check while `[smmap]` passes -- the same pattern as post-drop. That's inconsistent with my model. This diag dumps Owner SIDs in TWO snapshots: 1. Immediately after `actions/checkout` (with `submodules: recursive`), before Cygwin runs: shows what Windows git's recursive submodule clone produced for each path. 2. After `init-tests-after-clone.sh` (the actual chain script): shows whether Cygwin's reset/update sequence changes any of the owners. Then runs the trust check on each fixture to confirm the pre-drop behavior reproduces here. This branch should be deleted once the data is captured. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 982447d commit de69197

1 file changed

Lines changed: 101 additions & 103 deletions

File tree

.github/workflows/cygwin-test.yml

Lines changed: 101 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -6,131 +6,129 @@ 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-recursive:
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
29+
submodules: recursive # KEY DIFFERENCE: actions/checkout does the recursive clone (pre-drop scenario)
4230

43-
- &install-cygwin
44-
name: Install Cygwin
31+
- name: Install Cygwin
4532
uses: cygwin/cygwin-install-action@v6
4633
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.
34+
packages: git
35+
add-to-path: false
4936

50-
- &verbose-output
51-
name: Arrange for verbose output
37+
- name: PRE-Cygwin-update — what does actions/checkout's recursive clone produce?
38+
shell: pwsh
5239
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
40+
$repo = "D:\a\GitPython\GitPython"
41+
$paths = @(
42+
"$repo\git\ext\gitdb",
43+
"$repo\git\ext\gitdb\.git",
44+
"$repo\.git\modules\gitdb",
45+
"$repo\git\ext\gitdb\gitdb",
46+
"$repo\git\ext\gitdb\gitdb\ext",
47+
"$repo\git\ext\gitdb\gitdb\ext\smmap",
48+
"$repo\git\ext\gitdb\gitdb\ext\smmap\.git",
49+
"$repo\.git\modules\gitdb\modules",
50+
"$repo\.git\modules\gitdb\modules\smmap"
51+
)
52+
Write-Host "==================== POST-CHECKOUT (with submodules: recursive), PRE-CYGWIN ===================="
53+
foreach ($p in $paths) {
54+
Write-Host "==== $p"
55+
if (Test-Path -LiteralPath $p) {
56+
$item = Get-Item -LiteralPath $p -Force
57+
$acl = Get-Acl -LiteralPath $p
58+
Write-Host " Type: $(if ($item.PSIsContainer) {'Directory'} else {'File'})"
59+
Write-Host " Owner: $($acl.Owner)"
60+
if ($item.PSIsContainer) {
61+
$count = (Get-ChildItem -LiteralPath $p -Force).Count
62+
Write-Host " Total entries: $count"
63+
}
64+
} else {
65+
Write-Host " (does not exist)"
66+
}
67+
Write-Host ""
68+
}
69+
70+
- name: Cygwin-side stat (PRE-Cygwin-update)
71+
run: |
72+
set +e
73+
echo "==================================================================="
74+
echo "Cygwin uid: $(id -u) ($(id -un))"
75+
echo "==================================================================="
76+
for path in \
77+
"$(pwd)/git/ext/gitdb" \
78+
"$(pwd)/git/ext/gitdb/.git" \
79+
"$(pwd)/.git/modules/gitdb" \
80+
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap" \
81+
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap/.git" \
82+
"$(pwd)/.git/modules/gitdb/modules/smmap"; do
83+
if [ -e "$path" ]; then
84+
echo "$(stat -c '%u(%U) %F mode=%a' "$path") $path"
85+
else
86+
echo "(does not exist) $path"
87+
fi
88+
done
89+
90+
- name: Run init-tests-after-clone.sh (the actual chain script)
5891
run: |
5992
git config --global --add safe.directory "$(pwd)"
6093
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"
63-
git config --global core.autocrlf false
64-
65-
- &prepare-repo
66-
name: Prepare this repo for tests
67-
run: |
6894
./init-tests-after-clone.sh
6995
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
81-
run: |
82-
python3.9 -m venv .venv
83-
echo 'BASH_ENV=.venv/bin/activate' >>"$GITHUB_ENV"
84-
85-
- &update-pypa
86-
name: Update PyPA packages
87-
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+
- name: POST-init-tests state
97+
shell: pwsh
9698
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
99+
$repo = "D:\a\GitPython\GitPython"
100+
$paths = @(
101+
"$repo\git\ext\gitdb",
102+
"$repo\git\ext\gitdb\.git",
103+
"$repo\.git\modules\gitdb",
104+
"$repo\git\ext\gitdb\gitdb\ext\smmap",
105+
"$repo\git\ext\gitdb\gitdb\ext\smmap\.git",
106+
"$repo\.git\modules\gitdb\modules\smmap"
107+
)
108+
Write-Host "==================== POST-INIT-TESTS (Cygwin script ran) ===================="
109+
foreach ($p in $paths) {
110+
Write-Host "==== $p"
111+
if (Test-Path -LiteralPath $p) {
112+
$acl = Get-Acl -LiteralPath $p
113+
Write-Host " Owner: $($acl.Owner)"
114+
} else {
115+
Write-Host " (does not exist)"
116+
}
117+
}
118+
119+
- name: Run trust check on each fixture (post-init-tests, pre-fix safe.directory)
132120
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
121+
set +e -x
122+
echo "Effective safe.directory:"
123+
git config --global --get-all safe.directory
124+
echo
125+
for fixture in \
126+
"$(pwd)" \
127+
"$(pwd)/git/ext/gitdb" \
128+
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap"; do
129+
echo "--- git -C $fixture rev-parse --show-toplevel"
130+
git -C "$fixture" rev-parse --show-toplevel 2>&1
131+
echo "(rc=$?)"
132+
echo
133+
done
134+
true

0 commit comments

Comments
 (0)