Scripts: validate GDK table GUIDs before generation #2724
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2724
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2724"
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?
@luckyteagirl on GitHub · 2026-11-26 08:52 UTC · original
luckyteagirl:codex/gdk-table-validate-guids→main· +48 −1 · 2 files · 2 commits · draftgen_gdk_table.pypreviously trusted any 36-character mixture of hex digits and hyphens as a GUID and silently skipped a malformed shorter row. A bad source table could therefore generate an out-of-range Rust integer or omit an API entry without naming the bad row. Validate both identifiers before replacing the generated table.What is in it
scripts/gen_gdk_table.py: capture quoted class and interface fields, then require the canonical8-4-4-4-12hexadecimal GUID form for each row before opening the Rust output. A failure names the row and field.scripts/test_gdk_table_guids.py: exercise oversized, short, misplaced-hyphen, and quoted//inputs and confirm that a rejected row leaves the previous output intact.Tested
b49be183, the original three malformed-row cases failed the new fixture because the generator exited successfully instead of rejecting the input. The expanded fixture passes on headaae8e433.python -B -m unittest discover -s scripts -p 'test_*.py': 26 passed, 0 failed, exit 0.bad//guidrow was rejected without overwriting the output.git diff b49be183 HEAD --check: passed.Regression run
Not tested
AI use
//, and tested the combined branches.@RavenCurseBurg on GitHub · 2026-11-26 09:45 UTC · original · edited 2026-11-26 09:57 UTC
I tested
aae8e43308dad4df7c9fefd00c4250cd637e2f72alongside #2681 at499738640791. This head reports an invalid GUID from a disabled row. Integration candidate a6dd26db4ea5 applies luckyteagirl’s comment handling from #2681 before this PR’s active-row validation. Onpython -B scripts/gen_gdk_table.py <synthetic-table>, the candidate preserved the source URL, slot order and exact generated bytes after I inserted disabled entries. A malformed active class and a malformed active interface each produced a field-specific diagnostic and left the output unchanged.python -B -m unittest discover -s scripts -p "test_*.py"passed all 27 tests on the integration commit. Windows build 26100, Core i7-13700, Python 3.14.3. OpenAI Codex (GPT-6) wrote and ran the synthetic tests. Codex prepared the integration and added the interface fixture. The Windows GDK library and Rust runtime were outside this run.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.