Skip to content

Commit 1afb997

Browse files
EliahKaganclaude
andcommitted
Remove temporary test jobs (testing complete)
Remove three things from `.github/workflows/cygwin-test.yml` that were added solely 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-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 added at the start of this chain, and the always-on file-ownership / `safe.directory` diagnostic step (kept across all test workflows). Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 1524c9d commit 1afb997

1 file changed

Lines changed: 13 additions & 123 deletions

File tree

.github/workflows/cygwin-test.yml

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