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

Merged
kirigayakazima merged 2 commits from upstream-pr/719 into main 2026-11-29 14:53:15 +00:00
kirigayakazima commented 2026-11-24 12:51:05 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-11-24T12:51:05Z.


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).

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5472486665 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/719). Originally posted by [kirigayakazima](https://github.com/kirigayakazima) on 2026-11-24T12:51:05Z. --- 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 commented 2026-11-24 13:25:25 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T13:25:25Z.

Review: APPROVED


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.
<!-- greyfinch-sync:ubiquitarianism/leonida:review:6039982046 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/719#pullrequestreview-6039982046). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T13:25:25Z. **Review:** APPROVED --- 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 commented 2026-11-25 04:02:41 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by tiguan26 on 2026-11-25T04:02:41Z.

Review: APPROVED


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).

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6051686410 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/719#pullrequestreview-6051686410). Originally posted by [tiguan26](https://github.com/tiguan26) on 2026-11-25T04:02:41Z. **Review:** APPROVED --- 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 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T18:01:10Z.


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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7243465388 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/719#issuecomment-7243465388). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T18:01:10Z. --- 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 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T14:46:34Z.


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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7257566455 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/719#issuecomment-7257566455). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T14:46:34Z. --- 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 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T14:53:18Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7257654253 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/719#issuecomment-7257654253). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-29T14:53:18Z. --- 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 reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!719
No description provided.