fix(tools): stage web release manifests before replacement #12488
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12488"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by StoneDC on 2026-10-28T15:53:17Z.
What
Stage release manifests next to their destination and replace them only after successful JSON serialization, preserving existing files on serialization/write failures.
Resolve current-main integration conflicts while keeping the archive metadata stream context-managed and retaining main's release-layout validation and invalid-layout assertions. All current-main methods are preserved; one old test's context-manager nesting is aligned with main without removing its checks. The prior #12446 and #12788 prerequisites have both merged, so the checklist now declares no open prerequisite.
Tested
Exact tested head
ae8ca3f7786f5070b8fa91912b536805fcac4258; recorded main9f748f4d8e36ce3714f3b95f3386316e110a9b22; previous published head29a0e474d99880c7d6e532272ce5cec66c5cbd95. Recorded main and the previous published head are ancestors. All current-main and previous unique test methods are retained; the documented #12488 context nesting and #12766 identical-shadow cleanup preserve the effective assertions.Windows 11: Python 3.14.3 and 3.12.14, CMake 4.3.1 / MinGW GCC 15.2. Non-root Ubuntu 26.04 / WSL: Python 3.14.4 and isolated Python 3.12.16, CMake 4.2.3 / GCC 15.2. Linux runs exact source archives on its native filesystem; a temporary Git snapshot supplies the release tests' current-tree revision lookup.
For both interpreters on each OS, configure Ninja Release with BUILD_TESTING=ON and ANYPS5_RELINKER_ONLY=ON, then run
ctest --test-dir <build> -R '^(web_library_assets|web_release)$' -Vand the CTest skip-policy audit. All four configurations pass.Registered
web_library_assetsandweb_release: 2 CTest groups / 39 build-web methods + 33 release methods pass per configuration. Windows has one existing permissions skip in build-web; Linux has none. No CTest group skips. Existing atomic-write, malformed metadata, nested JSON, archive-layout and no-partial-publication regressions remain present.Current-main conventions with this complete description, whitespace, Python 3.9 grammar, AST test-retention and production-script registration checks pass. No timeout was raised. These are interpreter/tool tests, not native product builds. No actual Python 3.9/3.11, local macOS, PS5/title/GPU or live sampler/browser run is claimed. New-head hosted CI starts after publication; old-head approvals/checks are not fresh results for this head.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T15:59:46Z.
Review: COMMENTED
I reviewed head
ac3c05ab53caand ran the focused web release tests from a clean detached worktree on Linux/Python 3.11: relinker-only CMake configure succeeded andweb_releaseplusweb_library_assetspassed (2/2).tools/check_conventions.py --base upstream/mainandtools/check_test_registration.py --scriptsalso passed. The tests cover interrupted partial writes, failed replacement and retry, permissions, and symlink write-through; the implementation stages beside the resolved target and replaces only after the complete content has been written. The stated per-manifest atomicity and no-crash-durability limits match the implementation. I found no blocking issue in this focused review. I’m not treating the author’s Windows and Linux test report as hosted CI evidence; the hosted checks have their own status in the PR.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T16:19:35Z.
Review: COMMENTED
I reviewed the new exact head
8055acbbaa58and the one-line replacement-test adjustment. The production implementation resolves the destination beforePath.replace, so comparing the injected destination againstself.manifest.resolve()now matches the actual call and should reach the intendedOSErrorpath even when the temporary directory is accessed through an alias.I independently ran
python3 -m unittest tools.tests.test_build_webon Linux/Python 3.11: 19 tests passed, 1 platform-dependent test skipped.python3 tools/check_conventions.py --base upstream/main,python3 tools/check_test_registration.py --scripts(212 scripts), andgit diff --check upstream/main...HEADpass. Hosted relinker and conventions checks for this new head are still pending, so I am not treating them as completed or changing my review to approval yet.Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-28T17:52:13Z.
Review: APPROVED
Independent macOS run of exact head
ef9d0a4d05(prior runs here were Linux only).python -m unittest tools.tests.test_build_web: 22 OK on Python 3.13 and 3.14 (Homebrew), and on 3.9.6 (Apple; 1 skip, the existing zipfile Unicode-extra test).check_conventions --base upstream/mainandcheck_test_registration --scripts(212) pass. The branch merges cleanly with current maine4da19aff0. #12446418cd0d37eis an ancestor, matching Depends on.build_web.pyunder the new tests makes the 3 manifest tests fail (2F+1E), and the 3 deep-JSON tests still pass because they come from #12446.write_manifest: dropresolve()→ killed, dropchmod→ killed, write in place instead of replace → killed. Two survive:PermissionErrorguard. No test covers it, and without the guardreplace()quietly overwrites a 0444 manifest.TemporaryDirectory(dir=None), i.e. staging outside the destination directory. The tests still pass, but in real use the rename becomes cross-device (EXDEV), so the replace is no longer atomic or can fail.The test-only diff below kills both (re-verified on 3.13/3.14/3.9).
0o222→0o200stays equivalent, which is fine.No defects in the production change. The two gaps above are coverage only.
Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-29T06:44:37Z.
Review: APPROVED
Reviewed
f69d829d2a3ec16c76fbdb17c55260c3ccd432bcagainst52c09d567d2fa453494dd720fcf53a98149468e4. Release library manifests are staged in a temporary directory beside the resolved destination and replaced only after a successful write. Existing mode/read-only checks are retained; the three JSON depth-error entry points are included in this branch. No actionable finding in this scoped review.Windows/Python 3.11 validation: head 23 passed, 2 skipped; baseline 17 passed, 1 skipped. The write-failure controls preserve the prior manifest on the head and fail on old production. Two platform filesystem cases are skipped. This establishes manifest replacement behavior, not a transaction across all downloaded asset files. Responses/archives are fixtures; no site was published.
Pull request closed