mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:30:52 +01:00
[PR #1801] scripts: harden meta_to_xml.ps1 null head, limit guard and atomic XML write #1814
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#1814
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/1801
Author: @kirigayakazima
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/meta-to-xml-safety📝 Commits (1)
4ef1614scripts: harden meta_to_xml.ps1 null head, limit guard and atomic XML write📊 Changes
2 files changed (+74 additions, -3 deletions)
View changed files
📝
scripts/meta_to_xml.ps1(+20 -3)📝
tests/test_meta_to_xml_paths.py(+54 -0)📄 Description
Claimed in the coordination issue as: META-TO-XML-NULL-HEAD-CASE-AND-LIMIT-GUARD (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7162168340)
What and why
scripts/meta_to_xml.ps1againstbink2or malformedindex.jsonentries whoseheadis null/absent ($_.head -is [string]) instead of throwingInvokeMethodOnNullon.StartsWith(...).5053494e/52424630hex prefixes case-insensitively (OrdinalIgnoreCase) in both filtering and$kindclassification.-Limitvalues upfront (throw "-Limit must be 0 or greater.") instead of writing an emptyfailures.txtand exiting0..tmpfile beside the destination and publish viaMove-Item -LiteralPath ... -Forcewithfinallycleanup.tests/test_meta_to_xml_paths.py.Tested
python -I tests/test_meta_to_xml_paths.py -v(live Windows PowerShell 5.1) ->Ran 3 tests in 4.548s,OK(verified in a detachedupstream/mainworktree that both new tests fail before the fix:FAILED (failures=2)).python -I tests/test_ci_registration.py->Ran 16 tests in 4.507s,OK.python -I tests/test_text_write_line_endings.py->Ran 3 tests in 12.931s,OK.python -I scripts/check_no_game_data.py scripts/meta_to_xml.ps1 tests/test_meta_to_xml_paths.py-> exit0.python -I -m compileall -q tests/test_meta_to_xml_paths.pyandgit diff --check-> clean.GPUs tested: n/a (Windows PowerShell 5.1 + stdlib Python tests on Windows 11 x64)
AI-assisted: yes
Checklist
needs rebase).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.