glb_writer: cover failed replacement of a read-only GLB on Windows #719

Merged
leonida/mandy
kirigayakazima merged 2 commits from fix/glb-writer-ro-cleanup into main 2026-11-29 14:53:15 +00:00

Pull request successfully merged and closed

kirigayakazima commented 2026-11-24 12:51:05 +00:00

GLB-WRITER-RO-CLEANUP. Main already restores writable permissions before removing staging files. This PR retains regression coverage for failed replacement of a read-only output. It checks that the old GLB survives, the temporary file is removed, and the original error propagates. Covers a forced replacement failure and a real read-only destination on Windows.

Windows verification on c8bf0e7b6 plus this branch: python -I tests/test_glb_writer.py passed 76 tests. No game data; no dependencies. GPUs tested: n/a. Refresh AI-assisted with OpenAI Codex (GPT-6).

GLB-WRITER-RO-CLEANUP. Main already restores writable permissions before removing staging files. This PR retains regression coverage for failed replacement of a read-only output. It checks that the old GLB survives, the temporary file is removed, and the original error propagates. Covers a forced replacement failure and a real read-only destination on Windows. Windows verification on c8bf0e7b6 plus this branch: python -I tests/test_glb_writer.py passed 76 tests. No game data; no dependencies. GPUs tested: n/a. Refresh AI-assisted with OpenAI Codex (GPT-6).
abnalstlll-byte approved these changes 2026-11-24 13:25:25 +00:00
abnalstlll-byte left a comment

Audited and verified. Clean-room compliant.

  • Restores 0o600 writable mode before deleting staging file in tools/glb_writer.py.
  • Unit tests in tests/test_glb_writer.py PASS.
Audited and verified. Clean-room compliant. - Restores 0o600 writable mode before deleting staging file in tools/glb_writer.py. - Unit tests in tests/test_glb_writer.py PASS.
tiguan26 approved these changes 2026-11-25 04:02:41 +00:00
tiguan26 left a comment

Approving. Merged into current main with no conflicts; the PR's tests pass (Linux, Python 3.13). Same pattern as the rest of the *-STAGE-CLEANUP series: on a failed replace the staged file gets 0o600 back before os.unlink, so a staged copy left read-only (the published mode on Windows) is still removed. Only the staging/permission lines change.

AI-assisted (Claude).

Approving. Merged into current main with no conflicts; the PR's tests pass (Linux, Python 3.13). Same pattern as the rest of the *-STAGE-CLEANUP series: on a failed replace the staged file gets 0o600 back before os.unlink, so a staged copy left read-only (the published mode on Windows) is still removed. Only the staging/permission lines change. AI-assisted (Claude).
MoonEyes commented 2026-11-28 18:01:10 +00:00

Hi @kirigayakazima, thanks for this pull request. It currently conflicts with main (conflicting file(s): tools/glb_writer.py), so it carries the needs rebase label. CONTRIBUTING.md asks authors to rebase their branch on main; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here.

AI-assisted (Claude Code, Claude Opus 5.5).

Hi @kirigayakazima, thanks for this pull request. It currently conflicts with `main` (conflicting file(s): `tools/glb_writer.py`), so it carries the `needs rebase` label. CONTRIBUTING.md asks authors to rebase their branch on `main`; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here. AI-assisted (Claude Code, Claude Opus 5.5).
TheGeogeo commented 2026-11-29 14:46:34 +00:00

Tested 85b87608f merged (no commit) with main bd643e46e: Windows 11 10.0.26300, Python 3.12.4, CPU only. The PR is test-only, and the fix it covers is already in main.

  • Green: python -I tests/test_glb_writer.py gives 76 tests OK.
  • Red: since the fix is in main, I removed main's own cleanup, the os.chmod(tmp_path, 0o600) before os.remove in the failure path of tools/glb_writer.py (from 39d3dc489). Both new tests then fail, each leaving a .glb-*.tmp staging file behind: test_failed_replace_over_readonly_glb_cleans_staging_file and test_windows_readonly_glb_failure_cleans_staging_file. So the PR's tests catch that regression.
  • Merges cleanly. check_no_game_data.py is clean.

AI-assisted (Claude Code).

Tested `85b87608f` merged (no commit) with `main` `bd643e46e`: Windows 11 10.0.26300, Python 3.12.4, CPU only. The PR is test-only, and the fix it covers is already in `main`. - Green: `python -I tests/test_glb_writer.py` gives 76 tests OK. - Red: since the fix is in `main`, I removed `main`'s own cleanup, the `os.chmod(tmp_path, 0o600)` before `os.remove` in the failure path of `tools/glb_writer.py` (from `39d3dc489`). Both new tests then fail, each leaving a `.glb-*.tmp` staging file behind: `test_failed_replace_over_readonly_glb_cleans_staging_file` and `test_windows_readonly_glb_failure_cleans_staging_file`. So the PR's tests catch that regression. - Merges cleanly. `check_no_game_data.py` is clean. AI-assisted (Claude Code).
MoonEyes commented 2026-11-29 14:53:18 +00:00

Merged. Tested by @TheGeogeo on head 85b87608f merged with main bd643e46e (Windows 11, Python 3.12.4, CPU only, no GPU needed): tests/test_glb_writer.py 76 OK; with main's own cleanup (os.chmod before os.remove, 39d3dc489) removed, both new tests fail and leave a .glb-*.tmp file, so they guard that fix. The 4 red CI jobs of 03:00 (check, stdlib-tests-linux, macos-python, semantic-tests) were red on main at the same time. Thanks @kirigayakazima!

AI-assisted: yes

Merged. Tested by @TheGeogeo on head 85b87608f merged with main bd643e46e (Windows 11, Python 3.12.4, CPU only, no GPU needed): `tests/test_glb_writer.py` 76 OK; with main's own cleanup (`os.chmod` before `os.remove`, 39d3dc489) removed, both new tests fail and leave a `.glb-*.tmp` file, so they guard that fix. The 4 red CI jobs of 03:00 (check, stdlib-tests-linux, macos-python, semantic-tests) were red on main at the same time. Thanks @kirigayakazima! AI-assisted: yes
Sign in to join this conversation.
No description provided.