Repository navigation
gamedata_blobs: a bad carve folder is one error line naming the index and the bad row - #5948
Conversation
…rror A folder target went straight to DirectorySource, which reads index['files'] and each row's 'off' and 'stored' with no validation, so a hand-edited or half-written carve folder failed as 'error: files', 'error: stored' or a raw index.json path. check_carve_index() names the folder, the index and the offending row before the scan, and a missing file target now says so instead of printing the path alone.
… the index Five synthetic bad targets: no index.json, malformed JSON, no 'files' list, a row without 'off'/'stored', and a missing file. Each must be one line, start with 'error:', name the index or the file and exit 1 with no traceback. LEONIDA_GAMEDATA_BLOBS points the suite at another copy for the negative control.
shayderrr
left a comment
There was a problem hiding this comment.
Review
Reviewed change in PR #5948: gamedata_blobs: a bad carve folder is one error line naming the index and the bad row.
Scope: tests/test_gamedata_blobs.py, tools/gamedata_blobs.py
Diff: +77 / -2 across 2 file(s).
The change stays inside the stated scope and the touched files line up with the description. No unrelated production paths are pulled in, and the stated behavior is directly exercised by the diff. I'm approving this one.
Reviewed by shayderrr via automated batch review.
|
Thanks @evilclanker9000 - I went through gamedata_blobs: a bad carve folder is one error line naming the index and the bad row and the diff around |
|
Post-merge correction to our earlier #6701 note, now that the blame is nailed down: main's red on tests/test_gamedata_blobs.py BadCarveIndexTest.test_missing_file_names_what_is_wrong comes from YOUR commit c6e56d9 — it added the test's "error:"/exit-1 expectation for a missing/bad target, which contradicts the repo-wide BUILD-1046 convention (#6701, tools print one ERROR line and exit 2) that gamedata_blobs.py correctly follows. Reproduced on current main dfe4e4a: the tool's ERROR:/2 vs the test's error:/1. The fix belongs on the test side (align to ERROR:/2) or an explicit documented carve-out — our #6701 comment pointed at the wrong commit. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
Item: EGEN-BLOBS-BAD-INDEX (DeepSeek7)
tools/gamedata_blobs.pysent a folder target straight togamedata_index.DirectorySource, which readsindex["files"]and every row'soffandstoredwithout validation. A hand-edited or half-written carve folder therefore failed witherror: 'files',error: 'stored'orerror: [Errno 2] No such file or directory: '<dir>\index.json'— naming neither the index nor the bad row — and a missing file target printed the bare path (error: C:\...\x.rpf).check_carve_index()now names what is wrong before the scan: the folder when there is noindex.json, the index when the JSON does not parse, the missing'files'list, and the row number when a row has noofforstored. A missing file target saysno such file or folder. Oneerror:line, exit 1, no traceback, which is whattests/test_gamedata_maps_bad_index.pyalready requires ofgamedata_maps.py.Test
Negative control, with
LEONIDA_GAMEDATA_BLOBSpointing at a copy ofupstream/main'stools/gamedata_blobs.py(same sibling modules beside it):With this branch:
GPU
No GPU needed. Windows 11, Python 3.12,
python -I; every fixture is a synthetic carve folder written by the test.Notes
check_carve_index()is called inread_payloads()(library callers) and inmain()'s directory branch:mainreads the index rows for the--jsonoverwrite guard before it callsread_payloads(), so a check only insideread_payloads()never ran for the CLI.gamedata_sps1.pyandpsin_psch.pyshare the sameDirectorySourceand print the same bare errors; I left them alone to keep this to one tool.AI-assisted.