mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:55:52 +01:00
[PR #1762] psin_names: publish --refs atomically and match .JSON case-insensitively (PSIN-NAMES-ATOMIC-REFS-AND-CASE-JSON) #1775
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1775
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1762
Author: @kirigayakazima
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/psin-names-atomic-refs-and-case-json📝 Commits (1)
8f2c0e3psin_names: publish --refs atomically and match .JSON case-insensitively📊 Changes
2 files changed (+106 additions, -6 deletions)
View changed files
📝
tests/test_psin_names.py(+76 -0)📝
tools/psin_names.py(+30 -6)📄 Description
Claimed in the coordination issue as: PSIN-NAMES-ATOMIC-REFS-AND-CASE-JSON https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7161241950
What and why
Hardens
tools/psin_names.py:.jsonextension inload_names: Usepath.lower().endswith(".json")so uppercaseNAMES.JSONis parsed as JSON rather than split line-by-line as raw JSON syntax text.inside_srcpath comparison: Applyos.path.normcaseafteros.path.realpathwhen checking whether--refsfalls insidesrcsocommonpathmatchessame_report_pathcase semantics consistently.--refsTSV publish with Windows read-only cleanup: Stage--refsintotempfile.NamedTemporaryFilein the destination directory, applypublished_mode(dest), publish viareplace_retry, and restore0o600before unlinking on failure. Mid-scan errors or failed replaces over read-only targets preserve any previous TSV intact and leave no.psin_names-*.tmpfiles.Adds 3 synthetic regression tests in
tests/test_psin_names.py.Tested
Windows 11 x64 (
10.0.26100), Python3.14.7, CPU only, synthetic PSIN inputs only (no game files). Commit8f2c0e351254c778ba8a41b32629ff89dd93fb0b.python -I tests/test_psin_names.py -v:main(bcaa13da) with all 20 tests: 2 failures (test_uppercase_json_extension_is_parsed_as_jsonandtest_refs_failure_preserves_previous_file_and_cleans_staging— truncates previousrefs.tsvon mid-run error);python -I tests/test_ci_registration.py: 16 tests, OK.python -I tests/test_text_write_line_endings.py: 3 tests, OK.python -I scripts/check_no_game_data.py tools/psin_names.py tests/test_psin_names.py,python -m compileall -q tools tests,git diff --check: exit0.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.