tools: tester-report.sh for scrubbed logs and report bodies #312

Merged
m0rff merged 1 commit from upstream-pr/312 into main 2026-11-27 11:54:01 +00:00
m0rff commented 2026-11-27 10:58:20 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by m0rff on 2026-11-27T10:58:20Z.


Refs #309

tools/macos/tester-report.sh [--out DIR] [log] (newest runs/*/victory.log by default):

  • copies the log with $HOME, the user name and host names (hostname, scutil ComputerName/LocalHostName/HostName) replaced by <home>, <user>, <host>. Replacement is literal and stops at word boundaries, so a short user name doesn't mangle other words. The original log is not changed.
  • gzips the copy into ~/victory-reports/ (or --out; refuses a folder inside the repo) and prints its path and sha256.
  • prints an issue body with the tester-report template's sections: Mac (chip, RAM, macOS), Commit (the log's commit, the checkout's commit if it differs, plus a local-changes flag), the dropdown options, and under What happened the console model, shader converter line (#300), VICTORY_* variables and run-summary.sh output. The body goes through the same scrubber.
  • never uploads anything, and says so in --help.

Test: tools/macos/tests/tester-report.sh, added to the macos-scripts job. It uses a synthetic log with a fake home, user and host names and stubs sysctl, sw_vers, scutil, hostname and id on PATH. It checks that none of the fake values survive in the .gz or the body, that every template label appears as a section, that the printed sha256 matches, that the original log is unchanged, and that an in-repo --out is refused. It fails when scrubbing is disabled.

Ran locally: cargo xtask policy, plus the three script tests under /bin/bash 3.2.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:5525472192 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/312). Originally posted by [m0rff](https://github.com/m0rff) on 2026-11-27T10:58:20Z. --- Refs #309 `tools/macos/tester-report.sh [--out DIR] [log]` (newest `runs/*/victory.log` by default): - copies the log with $HOME, the user name and host names (`hostname`, `scutil` ComputerName/LocalHostName/HostName) replaced by `<home>`, `<user>`, `<host>`. Replacement is literal and stops at word boundaries, so a short user name doesn't mangle other words. The original log is not changed. - gzips the copy into `~/victory-reports/` (or `--out`; refuses a folder inside the repo) and prints its path and sha256. - prints an issue body with the tester-report template's sections: Mac (chip, RAM, macOS), Commit (the log's commit, the checkout's commit if it differs, plus a local-changes flag), the dropdown options, and under What happened the console model, shader converter line (#300), VICTORY_* variables and run-summary.sh output. The body goes through the same scrubber. - never uploads anything, and says so in `--help`. Test: `tools/macos/tests/tester-report.sh`, added to the macos-scripts job. It uses a synthetic log with a fake home, user and host names and stubs `sysctl`, `sw_vers`, `scutil`, `hostname` and `id` on PATH. It checks that none of the fake values survive in the .gz or the body, that every template label appears as a section, that the printed sha256 matches, that the original log is unchanged, and that an in-repo `--out` is refused. It fails when scrubbing is disabled. Ran locally: `cargo xtask policy`, plus the three script tests under /bin/bash 3.2.
LakshanSivakumar commented 2026-11-27 11:54:49 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T11:54:49Z.


Thank you, this is useful and the test is good (the fake names must not survive, and it fails when scrubbing is off).

One thing to add in a follow-up, not before the merge: the README says what is replaced (home folder, user name, the Mac's names). Please add that paths outside the home folder (for example an external disk named after you) are not changed, so people read the file before they attach it. Merged.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7217619274 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/312#issuecomment-7217619274). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-27T11:54:49Z. --- Thank you, this is useful and the test is good (the fake names must not survive, and it fails when scrubbing is off). One thing to add in a follow-up, not before the merge: the README says what is replaced (home folder, user name, the Mac's names). Please add that paths outside the home folder (for example an external disk named after you) are not changed, so people read the file before they attach it. Merged.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
LakshanSivakumar/Native-Victory-macOS!312
No description provided.