Keep renamed play logs out of automatic rotation #3627

Open
github-bot wants to merge 2 commits from github-bot/gh-3627 into main AGit
Owner

@⁠ThePerfomance on GitHub · 2026-11-30 02:09 UTC · original
ThePerfomance:fix/play-log-rotation-scope → main · +56 −2 · 1 files · 2 commits · open

What it changes

The built-in launcher rotates every file in the log directory whose name starts with victory-nvidia-play- or play-. Once the directory fills, that can delete a renamed copy such as victory-nvidia-play-20261127-042000-1-backup.log.

Rotation now considers regular files with generated play log names. It recognises the current timestamp-and-PID format and the older play- spelling. It still keeps the nine latest preceding runs before creating the next log.

How it was tested

  • Windows, with a temporary directory containing generated logs, renamed backups and user notes.
  • Before the change, the regression test failed because rotation removed a backup.
  • After the change, the same test verifies that the backups and notes survive and that the oldest generated logs are still rotated.
  • All 84 tests from cargo test --locked -p victory passed. The changed file passed the asset policy check.

Checked for overlap

  • Searched open pull requests for log rotation and retention. Related: #3091 records returned startup errors in the play log and does not change rotation.

AI-assisted contribution using OpenAI Codex.

**@⁠ThePerfomance** on GitHub · 2026-11-30 02:09 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3627) `ThePerfomance:fix/play-log-rotation-scope` → `main` · +56 −2 · 1 files · 2 commits · open ## What it changes The built-in launcher rotates every file in the log directory whose name starts with `victory-nvidia-play-` or `play-`. Once the directory fills, that can delete a renamed copy such as `victory-nvidia-play-20261127-042000-1-backup.log`. Rotation now considers regular files with generated play log names. It recognises the current timestamp-and-PID format and the older `play-` spelling. It still keeps the nine latest preceding runs before creating the next log. ## How it was tested - Windows, with a temporary directory containing generated logs, renamed backups and user notes. - Before the change, the regression test failed because rotation removed a backup. - After the change, the same test verifies that the backups and notes survive and that the oldest generated logs are still rotated. - All 84 tests from `cargo test --locked -p victory` passed. The changed file passed the asset policy check. ## Checked for overlap - [x] Searched open pull requests for log rotation and retention. Related: #3091 records returned startup errors in the play log and does not change rotation. AI-assisted contribution using OpenAI Codex.
Only count regular files with a built-in play log name so rotating old runs cannot remove renamed logs and nearby notes.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 02:10:22 +00:00
Author
Owner

@⁠Trillazill on GitHub · 2026-11-30 05:12 UTC · original

Reviewed against 41adb551, and it looks right to me.

Checked (Windows 11, cargo test --locked -p victory):

  • With this PR (6955c3b3): 84 passed (81 + 1 + 2).
  • The new test with main's filter put back: fails on reading the first kept file, because rotation removed victory-nvidia-play-20261127-042000-1-backup.log, as the description says.
  • cargo clippy --locked -p victory --all-targets -- -D warnings reports nothing in play.rs.
  • Nothing else writes into %LOCALAPPDATA%\victory\logs, and the scripts that read it (play-rig.ps1, watch-rig.ps1, play-rig.Tests.ps1) only look for victory-nvidia-play-*.log, so the narrower match changes nothing for them.

One suggestion: the None => legacy arm accepts play-<date>-<time>.log with no process id, but no launcher wrote that name. The first log_file (48ad7859, 2026-11-26) already wrote play-{stamp}-{pid}.log, and 29d8dbf7 (2026-11-27) only changed the prefix. So the legacy flag could go (a process id is always required), and the test's legacy file could use the name the old launcher really wrote:

let legacy = logs.path().join("play-20261127-042000-1.log");

As it stands, the test checks that rotation removes a name rotation never had to deal with, and the real play-…-<pid>.log case is covered only because it takes the same path as the new names.

**@⁠Trillazill** on GitHub · 2026-11-30 05:12 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3627#issuecomment-7269446232) Reviewed against 41adb551, and it looks right to me. **Checked** (Windows 11, `cargo test --locked -p victory`): - With this PR (6955c3b3): 84 passed (81 + 1 + 2). - The new test with main's filter put back: fails on reading the first kept file, because rotation removed `victory-nvidia-play-20261127-042000-1-backup.log`, as the description says. - `cargo clippy --locked -p victory --all-targets -- -D warnings` reports nothing in `play.rs`. - Nothing else writes into `%LOCALAPPDATA%\victory\logs`, and the scripts that read it (`play-rig.ps1`, `watch-rig.ps1`, `play-rig.Tests.ps1`) only look for `victory-nvidia-play-*.log`, so the narrower match changes nothing for them. **One suggestion:** the `None => legacy` arm accepts `play-<date>-<time>.log` with no process id, but no launcher wrote that name. The first `log_file` (48ad7859, 2026-11-26) already wrote `play-{stamp}-{pid}.log`, and 29d8dbf7 (2026-11-27) only changed the prefix. So the `legacy` flag could go (a process id is always required), and the test's legacy file could use the name the old launcher really wrote: ```rust let legacy = logs.path().join("play-20261127-042000-1.log"); ``` As it stands, the test checks that rotation removes a name rotation never had to deal with, and the real `play-…-<pid>.log` case is covered only because it takes the same path as the new names.
Author
Owner

@⁠ThePerfomance on GitHub · 2026-11-30 10:52 UTC · original

Thanks for checking the launcher history, @⁠Trillazill. I addressed your suggestion in be5ebb5. Rotation now requires a PID for both naming formats, and the regression test verifies that an old play-<date>-<time>-<pid>.log is rotated while files without a PID are preserved. The updated test reproduced the issue before the fix, and all 84 tests in cargo test --locked -p victory passed after it.

**@⁠ThePerfomance** on GitHub · 2026-11-30 10:52 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3627#issuecomment-7276198276) Thanks for checking the launcher history, @⁠Trillazill. I addressed your suggestion in `be5ebb5`. Rotation now requires a PID for both naming formats, and the regression test verifies that an old `play-<date>-<time>-<pid>.log` is rotated while files without a PID are preserved. The updated test reproduced the issue before the fix, and all 84 tests in `cargo test --locked -p victory` passed after it.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3627/head:github-bot/gh-3627'
git switch 'github-bot/gh-3627'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3627'
git switch 'github-bot/gh-3627'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3627'
git switch 'github-bot/gh-3627'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3627'
git switch 'main'
git merge --squash 'github-bot/gh-3627'
git switch 'main'
git merge --ff-only 'github-bot/gh-3627'
git switch 'main'
git merge 'github-bot/gh-3627'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!3627
No description provided.