Repository navigation
Scripts: smoke blocks name the game folder by a hash, not its name - #689
Conversation
The `title:` line of an xcl-smoke block printed the game folder's name, and folder names are whatever people called their copy, so PR descriptions ended up naming specific copies of a commercial game (xcl-dev#677). It now prints the first 8 hex digits of the SHA-256 of the folder name (trimmed, UTF-8). pr_check.py only compares the main and PR blocks' titles for equality, so the check is unchanged, and two different folders still get different titles. Existing blocks can be converted with the same function (Python: hashlib.sha256(name.strip().encode()).hexdigest()[:8]). -Title <label> prints a label of your choice instead. Control, format and line/paragraph separator characters and backticks are refused: pr_check.py splits lines with str.splitlines(), so a U+2028 in a label would otherwise add keys such as `commit:` to the block. scripts/smoke-title.tests.ps1 checks hashes of ASCII, accented, CJK and emoji names against Python's, a trailing backslash, -Title, and the refused labels, with a stand-in for xcl.exe. Fixes xcl-dev#677
|
Tested I ran the old and new smoke scripts with the real
Not tested Retail titles or failure output. AI use Codex with GPT-6.2 Sol prepared the synthetic fixture, ran the checks, and drafted this report. |
|
Full-suite run on this PR's head Tested
Not tested: AMD / wave64; no retail title (this PR changes only AI-assisted (Claude Code). |
scripts/smoke.ps1printed the game folder's name on thetitle:line of everyxcl-smokeblock, so PR descriptions named people's copies of a retail game. It now prints the first 8 hex digits of the SHA-256 of the folder name (trimmed, UTF-8), the same as Python'shashlib.sha256(name.strip().encode()).hexdigest()[:8], so existing blocks can be converted and keep matching.pr_check.pyonly compares the main and PR titles for equality, so the check is unchanged.-Title <label>prints a label of your choice instead. Fixes #677What is in it
scripts/smoke.ps1: thetitle:line is the hash of the folder name, or the-Titlelabel (trimmed; empty labels, control/format/line-separator characters and backticks are refused, sincepr_check.pysplits lines withstr.splitlines()and a U+2028 would add keys likecommit:to the block)scripts/smoke-title.tests.ps1: checks the hash of ASCII, accented, CJK and emoji names against Python's values, a trailing\on-Game,-Title, and the refused labels, with a stand-in forxcl.exe(same pattern astest-native-stderr.tests.ps1)Tested
powershell.exe -File scripts/smoke-title.tests.ps1andpwsh -File scripts/smoke-title.tests.ps1:smoke-title: okon both; the test fails onmain'ssmoke.ps1(prints the name, not the hash)python -m unittest test_pr_checkinscripts/: 3 tests, OKpr_check.check()on sample descriptions: hash/hash and label/label pairs pass; a main block with the plain name against a PR block with the hash is refused as different titlesNot tested
cargo build/cargo testnot run, and no regression run: the change is only inscripts/, not the runtimexcl.exeor a real title (the tests use a stand-in that prints a log path)mainprints the hash, so the two blocks won't match: rebase, or pass the same-Titleto both runs-Titlewith a neutral label if that matters. The hash is case-sensitive, so type the folder's name with the same casing in both runsAI use