tester-report: scrub a value that follows a colour escape #591
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/591"
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?
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by xarvel-temp on 2026-11-28T10:41:11Z.
tools/macos/tester-report.shleaves a tester's Mac name (and would leave a user name) in the log it calls scrubbed, whenever the value sits straight after a colour escape.Why
The scrubber keeps a value when the character before it is alphanumeric, so that a short user name like
leedoes not turnreleaseinto<user>release. A colour escape ends in the letterm(ESC[0m), andtracingwrites field values immediately after one —ESC[2m=ESC[0m<value>. Thatmlooks like a word character, so the value is never replaced.What it looked like here
Running the script on a normal windowed run, the gzipped "scrubbed" log still carried my Mac's name twice:
The home path and user name happened to survive the same guard only because they start with
/or appear after=in uncoloured text. Any value that begins with a letter or digit right after a colour reset is exposed.The fix
Treat a trailing colour escape as no character at all, so the word-boundary guard does not see its
m. Nine lines, no behaviour change anywhere else: a short name still leavesreleasealone, because the guard is unchanged for ordinary text.Test
tools/macos/tests/tester-report.shdid not catch this: its synthetic log writeshost=@HOST@with an uncoloured=, which is not the shape the logger produces. This adds one log line in the real shape and one assertion. Without the fix the suite fails withand passes with it. Verified both ways on this branch, and on my own run the line now reads
name=<host>.Found while preparing a tester report on an M5 Max; I have not claimed an issue for it, as it is a one-commit fix to the reporting tool rather than work on the port.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T16:54:14Z.
Review: APPROVED
Read the diff and ran the test locally on the head
fb0389cf:bash tools/macos/tests/tester-report.sh→PASS: tester-report, including the new case (a value straight afterESC[2m…ESC[0mnow scrubs). The awk change is minimal and the boundary rule (a colour escape's trailingmis not a word char before the value) matches how tracing writes field values. Approving from my side; CI green on main-side checks.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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.