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

Manually merged
github merged 1 commit from github-bot/gh-312 into main 2026-11-27 12:02:37 +00:00 AGit
Owner

@⁠m0rff on GitHub · 2026-11-27 10:58 UTC · original
m0rff:m0rff/tester-report-tool → main · +199 −2 · 6 files · 1 commits · merged 2026-11-27 11:54 UTC

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.

**@⁠m0rff** on GitHub · 2026-11-27 10:58 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/312) `m0rff:m0rff/tester-report-tool` → `main` · +199 −2 · 6 files · 1 commits · merged 2026-11-27 11:54 UTC 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.
Testers clean their logs by hand and each report is asked for the same
facts. The script copies a run log with $HOME, the user name and host
names replaced, gzips it outside the repo, prints its sha256, and prints
an issue body for the tester-report template with the Mac, commit,
console model, shader converter, VICTORY_* variables and run-summary.sh
output. It never uploads anything.

Refs #309
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 11:05:31 +00:00
github manually merged commit 92514ce1d2 into main 2026-11-27 12:02:37 +00:00
Author
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-27 11:54 UTC · original

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.

**@⁠LakshanSivakumar** on GitHub · 2026-11-27 11:54 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/312#issuecomment-7217619274) 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.
This discussion has been locked. Commenting is limited to contributors.
No description provided.