Skip to content

Commit de3a950

Browse files
EliahKaganclaude
andcommitted
Remove temporary test jobs (testing complete)
Remove three things from the `cygwin-test` workflow that were added to demonstrate the `safe.directory` bug and its fix: - The `reproduce-safe-dir` matrix (256 jobs running three submodule tests). Added to give a high-confidence reproduction of the failure pattern across runner-instance variation. - The `diag-token` job. Added to empirically establish the TokenOwner rewrite mechanism behind the gitdb-worktree Owner asymmetry. - The YAML anchors that only those temporary jobs needed (`&force-lf`, `&checkout`, `&install-cygwin`, `&verbose-output`, `&safe-directory`, `&prepare-repo`, `&git-identity`, `&setup-venv`, `&update-pypa`, `&install-deps`, `&ownership-posix-display`, `&ownership-ntfs-display`, `&safe-directory-display`, `&cygwin-env`, `&cygwin-defaults`). The `test` job still has all those steps; it just no longer needs to anchor them for reuse. What stays: the `test` job (the actual Cygwin test suite), the fixture-health and required-submodule checks, and the always-on file-ownership / `safe.directory` diagnostic steps (kept across all test workflows). Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 650eaaf commit de3a950

1 file changed

Lines changed: 15 additions & 129 deletions

File tree

.github/workflows/cygwin-test.yml

Lines changed: 15 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -20,80 +20,69 @@ jobs:
2020

2121
runs-on: windows-latest
2222

23-
env: &cygwin-env
23+
env:
2424
CHERE_INVOKING: "1"
2525
CYGWIN_NOWINPATH: "1"
2626

27-
defaults: &cygwin-defaults
27+
defaults:
2828
run:
2929
shell: C:\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr "{0}"
3030

3131
steps:
32-
- &force-lf
33-
name: Force LF line endings
32+
- name: Force LF line endings
3433
run: |
3534
git config --global core.autocrlf false # Affects the non-Cygwin git.
3635
shell: pwsh # Do this outside Cygwin, to affect actions/checkout.
3736

38-
- &checkout
39-
uses: actions/checkout@v6
37+
- uses: actions/checkout@v6
4038
with:
4139
fetch-depth: 0
4240

43-
- &install-cygwin
44-
name: Install Cygwin
41+
- name: Install Cygwin
4542
uses: cygwin/cygwin-install-action@v6
4643
with:
4744
packages: git python39 python-pip-wheel python-setuptools-wheel python-wheel-wheel
4845
add-to-path: false # No need to change $PATH outside the Cygwin environment.
4946

50-
- &verbose-output
51-
name: Arrange for verbose output
47+
- name: Arrange for verbose output
5248
run: |
5349
# Arrange for verbose output but without shell environment setup details.
5450
echo 'set -x' >~/.bash_profile
5551
56-
- &safe-directory
57-
name: Special configuration for Cygwin git
52+
- name: Special configuration for Cygwin git
5853
run: |
5954
git config --global --add safe.directory "$(pwd)"
6055
git config --global --add safe.directory "$(pwd)/.git"
6156
git config --global --add safe.directory "$(pwd)/git/ext/gitdb"
6257
git config --global --add safe.directory "$(pwd)/git/ext/gitdb/gitdb/ext/smmap"
6358
git config --global core.autocrlf false
6459
65-
- &prepare-repo
66-
name: Prepare this repo for tests
60+
- name: Prepare this repo for tests
6761
run: |
6862
./init-tests-after-clone.sh
6963
70-
- &git-identity
71-
name: Set git user identity and command aliases for the tests
64+
- name: Set git user identity and command aliases for the tests
7265
run: |
7366
git config --global user.email "travis@ci.com"
7467
git config --global user.name "Travis Runner"
7568
# If we rewrite the user's config by accident, we will mess it up
7669
# and cause subsequent tests to fail
7770
cat test/fixtures/.gitconfig >> ~/.gitconfig
7871
79-
- &setup-venv
80-
name: Set up virtual environment
72+
- name: Set up virtual environment
8173
run: |
8274
python3.9 -m venv .venv
8375
echo 'BASH_ENV=.venv/bin/activate' >>"$GITHUB_ENV"
8476
85-
- &update-pypa
86-
name: Update PyPA packages
77+
- name: Update PyPA packages
8778
run: |
8879
python -m pip install -U pip 'setuptools; python_version<"3.12"' wheel
8980
90-
- &install-deps
91-
name: Install project and test dependencies
81+
- name: Install project and test dependencies
9282
run: |
9383
pip install '.[test]'
9484
95-
- &ownership-posix-display
96-
name: Show POSIX file ownership
85+
- name: Show POSIX file ownership
9786
# Cygwin's `ls -ld` reports the NTFS Owner SID via Cygwin's SID-to-uid
9887
# mapping (well-known SIDs by their RID, machine-local accounts by
9988
# 0x30000+RID). That mapping is what Cygwin git's
@@ -114,8 +103,7 @@ jobs:
114103
ls -ld -- "$p" 2>/dev/null || echo "(missing: $p)"
115104
done
116105
117-
- &ownership-ntfs-display
118-
name: Show NTFS file ownership
106+
- name: Show NTFS file ownership
119107
# Authoritative NTFS Owner via Get-Acl, with no Cygwin SID-to-uid layer
120108
# in between -- useful for confirming what the Cygwin view reports as
121109
# "Administrators" is the BUILTIN\Administrators SID (S-1-5-32-544).
@@ -145,8 +133,7 @@ jobs:
145133
}
146134
}
147135
148-
- &safe-directory-display
149-
name: Show safe.directory entries
136+
- name: Show safe.directory entries
150137
run: git config --global --get-all safe.directory
151138

152139
- name: Show version and platform information
@@ -160,104 +147,3 @@ jobs:
160147
- name: Test with pytest (${{ matrix.additional-pytest-args }})
161148
run: |
162149
pytest --color=yes -p no:sugar --instafail -vv ${{ matrix.additional-pytest-args }}
163-
164-
diag-token:
165-
runs-on: windows-latest
166-
167-
env: *cygwin-env
168-
169-
defaults: *cygwin-defaults
170-
171-
steps:
172-
- *force-lf
173-
- *checkout
174-
- *install-cygwin
175-
176-
- name: PowerShell-side token state and file-creation tests
177-
shell: pwsh
178-
run: |
179-
$repo = "D:\a\GitPython\GitPython"
180-
Write-Host "==================== whoami /all (PowerShell) ===================="
181-
whoami /all
182-
Write-Host ""
183-
Write-Host "==================== Test A: PowerShell New-Item directory ===================="
184-
$td = "$repo\test-pwsh-mkdir"
185-
New-Item -ItemType Directory -Path $td -Force | Out-Null
186-
$acl = Get-Acl -LiteralPath $td
187-
Write-Host "Owner of $td : $($acl.Owner)"
188-
Remove-Item $td -Force
189-
Write-Host ""
190-
Write-Host "==================== Test D: PowerShell -> Git Bash -> PowerShell New-Item ===================="
191-
$td4 = "$repo\test-pwsh-bash-pwsh-mkdir"
192-
$scriptPath = "$repo\inner-mkdir.ps1"
193-
"New-Item -ItemType Directory -Path '$td4' -Force | Out-Null" |
194-
Set-Content -Path $scriptPath -Encoding utf8
195-
$env:MSYS2_ARG_CONV_EXCL = '*'
196-
try {
197-
& "C:\Program Files\Git\bin\bash.exe" -c "powershell.exe -NoProfile -ExecutionPolicy Bypass -File '$scriptPath'" 2>&1 | Out-Null
198-
} finally {
199-
Remove-Item Env:MSYS2_ARG_CONV_EXCL -ErrorAction SilentlyContinue
200-
}
201-
if (Test-Path -LiteralPath $td4) {
202-
$acl = Get-Acl -LiteralPath $td4
203-
Write-Host "Owner of $td4 (PowerShell -> bash -> PowerShell New-Item) : $($acl.Owner)"
204-
Remove-Item $td4 -Force
205-
} else {
206-
Write-Host "Owner of $td4 (PowerShell -> bash -> PowerShell New-Item) : (directory not created)"
207-
}
208-
Remove-Item $scriptPath -Force -ErrorAction SilentlyContinue
209-
210-
- name: Cygwin-side token state and file-creation tests
211-
run: |
212-
set +e
213-
echo "==================== id (Cygwin) ===================="
214-
id
215-
echo
216-
echo "==================== Test B: Cygwin mkdir ===================="
217-
td="$(pwd)/test-cygwin-mkdir"
218-
mkdir "$td"
219-
echo "Owner: $(stat -c '%U(%u)' "$td")"
220-
rmdir "$td"
221-
echo
222-
echo "==================== Test C: Cygwin-spawned Git for Windows git init ===================="
223-
td3="$(pwd)/test-cygwin-spawns-wingit"
224-
mkdir "$td3"
225-
( cd "$td3" && /cygdrive/c/Program\ Files/Git/bin/git.exe init -q )
226-
echo "Owner of $td3 (Cygwin-mkdir) : $(stat -c '%U(%u)' "$td3")"
227-
echo "Owner of $td3/.git (Cygwin->Win git init): $(stat -c '%U(%u)' "$td3/.git")"
228-
rm -rf "$td3"
229-
true
230-
231-
reproduce-safe-dir:
232-
strategy:
233-
matrix:
234-
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]
235-
fail-fast: false
236-
237-
runs-on: windows-latest
238-
239-
env: *cygwin-env
240-
241-
defaults: *cygwin-defaults
242-
243-
steps:
244-
- *force-lf
245-
- *checkout
246-
- *install-cygwin
247-
- *verbose-output
248-
- *safe-directory
249-
- *prepare-repo
250-
- *git-identity
251-
- *setup-venv
252-
- *update-pypa
253-
- *install-deps
254-
- *ownership-posix-display
255-
- *ownership-ntfs-display
256-
- *safe-directory-display
257-
258-
- name: Run submodule tests
259-
run: |
260-
python -m pytest -vv \
261-
test/test_docs.py::Tutorials::test_submodules \
262-
test/test_repo.py::TestRepo::test_submodules \
263-
test/test_submodule.py::TestSubmodule::test_root_module

0 commit comments

Comments
 (0)