awc_manifest: publish mode on Windows (AWC-MANIFEST-STAGE-CLEANUP) #779

Open
github-bot wants to merge 1 commit from github-bot/gh-779 into main AGit
Owner

@⁠trigger337 on GitHub · 2026-11-24 13:43 UTC · original
trigger337:fix/awc-manifest-stage-cleanup → main · +36 −2 · 2 files · 1 commits · open

In tools/awc_manifest.py, write_manifest already restored 0o600 before unlinking on failure in its finally block, but previously skipped applying published_mode on Windows via if os.name != "nt":.

Remove the Windows skip so Windows outputs inherit published permissions consistently across platforms, and add synthetic regression tests for cleanup on replace failure and Windows published_mode application.

Tests pass (25/25 in test_awc_manifest.py), scripts/check_no_game_data.py passes cleanly.

agent: yes
AI-assisted: yes

**@⁠trigger337** on GitHub · 2026-11-24 13:43 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/779) `trigger337:fix/awc-manifest-stage-cleanup` → `main` · +36 −2 · 2 files · 1 commits · open In `tools/awc_manifest.py`, `write_manifest` already restored `0o600` before unlinking on failure in its `finally` block, but previously skipped applying `published_mode` on Windows via `if os.name != "nt":`. Remove the Windows skip so Windows outputs inherit published permissions consistently across platforms, and add synthetic regression tests for cleanup on replace failure and Windows `published_mode` application. Tests pass (25/25 in `test_awc_manifest.py`), `scripts/check_no_game_data.py` passes cleanly. agent: yes AI-assisted: yes
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:21:00 +00:00
Author
Owner

@⁠tiguan26 on GitHub · 2026-11-25 04:01 UTC · original · approved these changes

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: the published mode now also applies on Windows (the os.name guard is gone), using file_mode.published_mode. Only the staging/permission lines change.

AI-assisted (Claude).

**@⁠tiguan26** on GitHub · 2026-11-25 04:01 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/779#pullrequestreview-6051678687) · **approved these changes** 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: the published mode now also applies on Windows (the os.name guard is gone), using file_mode.published_mode. Only the staging/permission lines change. AI-assisted (Claude).
Author
Owner

@⁠DeadlyChirp on GitHub · 2026-11-25 15:23 UTC · original

Tested on Windows 11, Python 3.12.10, with this PR merged onto upstream main b0f3d3998 (merge commit 1ed165078).

python -I tests/test_awc_manifest.py:

  • PR: 25 tests OK (2 skipped). main: 23 tests OK (2 skipped).
  • The skips are the existing symlink tests (WinError 1314, no symlink privilege). The 2 new tests run and pass.

(AI-assisted test run; output checked by hand.)

**@⁠DeadlyChirp** on GitHub · 2026-11-25 15:23 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/779#issuecomment-7166778925) Tested on Windows 11, Python 3.12.10, with this PR merged onto upstream main b0f3d3998 (merge commit 1ed165078). `python -I tests/test_awc_manifest.py`: - PR: 25 tests OK (2 skipped). main: 23 tests OK (2 skipped). - The skips are the existing symlink tests (`WinError 1314`, no symlink privilege). The 2 new tests run and pass. (AI-assisted test run; output checked by hand.)
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 20:09 UTC · original

Reviewed ff7a65d: I ran python3 -I tests/test_awc_manifest.py (25/25 on the PR), test_csv_line_endings.py, test_file_mode.py, test_report_paths.py and check_no_game_data.py (all clean) on Linux, plus a probe against origin/main. No product bug or behavioral difference in any reachable scenario - and on main with this PR's test file all 25 tests pass, so neither new test pins the diff: the cleanup test raises at the pre-stage os.open check before anything is staged (probe: staged file created: False on both trees) and cannot fail on main in any environment, the cleanup it names being already covered by test_failed_replace_removes_the_staging_file_and_keeps_the_manifest; the os.name="nt" test passes on main because the finally: chmod(0o600) still fires on the renamed-away staged name and the patched mock counts that call before its FileNotFoundError is swallowed. Suggested: drop the cleanup test and assert the published mode instead - over a 0o640 destination with os.name="nt", main republishes at 0o600 while this branch preserves 0o640. The guard drop itself is fine and consistent with bvh_index/anim_glb/awc_opus. AI-assisted review.

Recommendation: Fix first

**@⁠PierreEbele** on GitHub · 2026-11-25 20:09 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/779#issuecomment-7173262521) Reviewed ff7a65d: I ran `python3 -I tests/test_awc_manifest.py` (25/25 on the PR), `test_csv_line_endings.py`, `test_file_mode.py`, `test_report_paths.py` and `check_no_game_data.py` (all clean) on Linux, plus a probe against `origin/main`. No product bug or behavioral difference in any reachable scenario - and on main with this PR's test file all 25 tests pass, so neither new test pins the diff: the cleanup test raises at the pre-stage `os.open` check before anything is staged (probe: `staged file created: False` on both trees) and cannot fail on main in any environment, the cleanup it names being already covered by `test_failed_replace_removes_the_staging_file_and_keeps_the_manifest`; the os.name="nt" test passes on main because the `finally:` chmod(0o600) still fires on the renamed-away staged name and the patched mock counts that call before its FileNotFoundError is swallowed. Suggested: drop the cleanup test and assert the published mode instead - over a 0o640 destination with `os.name="nt"`, main republishes at 0o600 while this branch preserves 0o640. The guard drop itself is fine and consistent with bvh_index/anim_glb/awc_opus. AI-assisted review. **Recommendation:** Fix first
Author
Owner

@⁠tiguan26 on GitHub · 2026-11-26 06:59 UTC · original

Confirming @⁠PierreEbele's finding: with this PR's test file against main's tool, every test passes here too (Linux, run as root), so neither new test pins the change. My approval was for the guard removal, which is right and matches the other writers; I didn't check that the tests fail without it. Asserting the published mode over a non-default destination mode with os.name patched to nt, as the review suggests, would pin it. AI-assisted (Claude).

**@⁠tiguan26** on GitHub · 2026-11-26 06:59 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/779#issuecomment-7184976894) Confirming @⁠PierreEbele's finding: with this PR's test file against main's tool, every test passes here too (Linux, run as root), so neither new test pins the change. My approval was for the guard removal, which is right and matches the other writers; I didn't check that the tests fail without it. Asserting the published mode over a non-default destination mode with `os.name` patched to `nt`, as the review suggests, would pin it. AI-assisted (Claude).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/779/head:github-bot/gh-779'
git switch 'github-bot/gh-779'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-779'
git switch 'github-bot/gh-779'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-779'
git switch 'github-bot/gh-779'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-779'
git switch 'main'
git merge --squash 'github-bot/gh-779'
git switch 'main'
git merge --ff-only 'github-bot/gh-779'
git switch 'main'
git merge 'github-bot/gh-779'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.