feat(migrate): reuse the previous launcher's game file automatically #315

Merged
HumanBean merged 2 commits from riqmarmes/LongshotLauncher:feat/stable-game-file into main 2026-11-28 00:26:15 +00:00
Contributor

Why. Players upgrading from Longshot Launcher 1.3.x have to find and pick their 20+ GiB game file (.nup, .nx, or a dump folder) again: the launcher imports saves, mods and game options, but its preferences start fresh and file discovery only scans drive roots and one folder level down, so a game kept in a custom games folder is never found. On my PC the previous launcher's settings.json knew the .nup and the new profile had no game source at all.

What changed.

  • New src/game/stable_source.rs reads the previous launcher's settings.json read-only, validates the remembered .nup/.nx or dump folder, and links it as this launcher's source: launcher-settings.json plus the current profile's game, with a one-time stable-source-v1.json marker.
  • No prompt and no picker: the first build already has the game file selected.
  • It never overwrites a source the player chose in this launcher. A path that is gone or invalid returns to the normal picker without writing the marker, so a reconnected drive is picked up on a later start.
  • Wired into the GUI start (players::bind) and the --play shortcut path.
  • Docs: the README upgrade notes, docs/saves.md "Moving from the stable launcher", and the marker list in docs/paths.md.

Tests.

  • New unit tests in stable_source cover automatic linking of a .nup or dump folder, an empty profile source, preserving a chosen source, retrying a missing file, waiting for a profile, and resuming an interrupted migration while preserving a later choice. They also cover the absence of a stable launcher and assert that its settings.json stays byte-identical.
  • cargo fmt --all -- --check; cargo clippy --locked --all-targets -- -D warnings; cargo test --locked → on Windows 12 pre-existing environment-only failures (junction/symlink, Steam and bash tests), none in touched code; python -I scripts/translations.py; Tooling tests/test_release.py → 46 tests OK.
  • Isolated end-to-end: ran the built launcher against a copy of a real 1.3.1 launcher home; it linked the real .nup automatically and left the old files byte-identical. No game build ran, and no game files, saves or anything made from them is in the change.
  • Not run: the builder-contract half of tests/test_launcher_core.py, which needs a checkout of the pinned Longshot revision 7015105c; CI covers that.

Screenshots. None: the change is a first-start backend behaviour with no new visible screen.

**Why.** Players upgrading from Longshot Launcher 1.3.x have to find and pick their 20+ GiB game file (`.nup`, `.nx`, or a dump folder) again: the launcher imports saves, mods and game options, but its preferences start fresh and file discovery only scans drive roots and one folder level down, so a game kept in a custom games folder is never found. On my PC the previous launcher's `settings.json` knew the `.nup` and the new profile had no game source at all. **What changed.** - New `src/game/stable_source.rs` reads the previous launcher's `settings.json` **read-only**, validates the remembered `.nup`/`.nx` or dump folder, and links it as this launcher's source: `launcher-settings.json` plus the current profile's `game`, with a one-time `stable-source-v1.json` marker. - No prompt and no picker: the first build already has the game file selected. - It never overwrites a source the player chose in this launcher. A path that is gone or invalid returns to the normal picker without writing the marker, so a reconnected drive is picked up on a later start. - Wired into the GUI start (`players::bind`) and the `--play` shortcut path. - Docs: the README upgrade notes, `docs/saves.md` "Moving from the stable launcher", and the marker list in `docs/paths.md`. **Tests.** - New unit tests in `stable_source` cover automatic linking of a `.nup` or dump folder, an empty profile source, preserving a chosen source, retrying a missing file, waiting for a profile, and resuming an interrupted migration while preserving a later choice. They also cover the absence of a stable launcher and assert that its `settings.json` stays byte-identical. - `cargo fmt --all -- --check`; `cargo clippy --locked --all-targets -- -D warnings`; `cargo test --locked` → on Windows 12 pre-existing environment-only failures (junction/symlink, Steam and bash tests), none in touched code; `python -I scripts/translations.py`; Tooling `tests/test_release.py` → 46 tests OK. - Isolated end-to-end: ran the built launcher against a **copy** of a real 1.3.1 launcher home; it linked the real `.nup` automatically and left the old files byte-identical. No game build ran, and no game files, saves or anything made from them is in the change. - Not run: the builder-contract half of `tests/test_launcher_core.py`, which needs a checkout of the pinned Longshot revision `7015105c`; CI covers that. **Screenshots.** None: the change is a first-start backend behaviour with no new visible screen.
feat(migrate): reuse the previous launcher's game file automatically
Some checks failed
PR title / Conventional Commit title (pull_request) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Has been cancelled
CI / Rust formatting, lint and tests (pull_request) Has been cancelled
CI / Release packages and stable upgrades (pull_request) Has been cancelled
b01d0fee00
Member

Possibly related, for context:

  • PR #316 feat(migrate): carry the previous launcher's language and cache folder — Parallel stable-launcher settings migration, sharing the previous settings.json migration path.
Possibly related, for context: - PR #316 feat(migrate): carry the previous launcher's language and cache folder — Parallel stable-launcher settings migration, sharing the previous settings.json migration path.
Owner
@fix
BeanBot force-pushed feat/stable-game-file from b01d0fee00
Some checks failed
PR title / Conventional Commit title (pull_request) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Has been cancelled
CI / Rust formatting, lint and tests (pull_request) Has been cancelled
CI / Release packages and stable upgrades (pull_request) Has been cancelled
to 8499ecef73
Some checks failed
CI / What the change needs (pull_request) Successful in 8s
PR title / Conventional Commit title (pull_request) Has been cancelled
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Successful in 17s
CI / Rust formatting, lint and tests (pull_request) Failing after 1m4s
CI / Release packages and stable upgrades (pull_request) Failing after 1h0m3s
2026-11-28 00:25:58 +00:00
Compare
BeanBot left a comment

Recommendation: Approve. The source migration has an observed end-to-end success, and the fix retains its intended behavior. The pull request is currently reported as unmergeable, and the supplied base diff includes substantial additional work that has not been fully reviewed here. Nothing blocking is left. Recommend approval; not approved on the forge.

What @fix changed
I changed this pull request: the new head is 8499ecef73. I rebased it onto main (31e07291ab).

Conflicts resolved

  • README.md: Kept the base branch’s preference migration guidance and the pull request’s game file reuse guidance.
  • docs/paths.md: Kept both the preference and game source migration records. I edited its description to match the change.

Changed

  • Empty profile source: Replaces missing, null or empty game values under the profile edit lock and adds a regression test in src/game/stable_source.rs:114.
  • Interrupted source migration: Records the pending profile update and resumes the settings write on a later start, while preserving a changed player choice. Added failure and choice regression tests in src/game/stable_source.rs:243. Tests were not run, as requested.

Nothing was built or run: the checks run again on the new head.

The launcher reuses a valid game source from the previous launcher and retries an interrupted settings write. This saves players from locating the file again, at the cost of additional migration state.

Checks: they run again on this head; a failure shows on the pull request.

Also noticed (2; not asked for, not blocking)
  • The new interruption and empty-source tests have not yet been run.
  • The base diff includes several preceding launcher changes beyond the source migration described in the pull request.
More: does it help, other systems, switches, what was read

Does it help: Yes: the description reports an isolated end-to-end run that linked a real previous-launcher source. The new interruption cases have tests, but those tests have not yet been run on this head.

Other systems: The migration runs at GUI and shortcut startup and uses the shared profile and launcher settings. Windows and Linux use the same migration logic; the reported end-to-end run does not establish both platforms.

Switches: None added, changed or removed by the source migration.

Reviewed: 8499ecef73 against 31e07291ab: Read AGENTS.md, CONTRIBUTING.md, src/game/stable_source.rs and src/game/source.rs in full; read the fix diff, source-migration diff, and relevant profile and settings code. Skimmed the larger base diff and documentation changes; the other changed code, translations and UI files were not read in full. No review checklist or pull request template was found at the specified paths.; nothing run (a code review).

Checked and fine:

  • Empty profile game values are replaced under the profile edit lock.
  • A pending profile update can resume the settings write, and a changed profile source is preserved in the covered case.
  • The fix keeps the automatic linking path and reads the previous settings without writing them.

Testing: No code or tests were run. The description reports a successful isolated migration run; CI has not run on this head.

Overlaps and merge order: The supplied history contains preceding changes from other pull requests; their merge status is not available.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The source migration has an observed end-to-end success, and the fix retains its intended behavior. The pull request is currently reported as unmergeable, and the supplied base diff includes substantial additional work that has not been fully reviewed here. Nothing blocking is left. Recommend approval; not approved on the forge. **What `@fix` changed** I changed this pull request: the new head is 8499ecef7366. I rebased it onto `main` (31e07291ab71). **Conflicts resolved** - README.md: Kept the base branch’s preference migration guidance and the pull request’s game file reuse guidance. - docs/paths.md: Kept both the preference and game source migration records. I edited its description to match the change. **Changed** - **Empty profile source**: Replaces missing, null or empty game values under the profile edit lock and adds a regression test in src/game/stable_source.rs:114. - **Interrupted source migration**: Records the pending profile update and resumes the settings write on a later start, while preserving a changed player choice. Added failure and choice regression tests in src/game/stable_source.rs:243. Tests were not run, as requested. Nothing was built or run: the checks run again on the new head. The launcher reuses a valid game source from the previous launcher and retries an interrupted settings write. This saves players from locating the file again, at the cost of additional migration state. **Checks:** they run again on this head; a failure shows on the pull request. <details> <summary>Also noticed (2; not asked for, not blocking)</summary> - The new interruption and empty-source tests have not yet been run. - The base diff includes several preceding launcher changes beyond the source migration described in the pull request. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes: the description reports an isolated end-to-end run that linked a real previous-launcher source. The new interruption cases have tests, but those tests have not yet been run on this head. **Other systems:** The migration runs at GUI and shortcut startup and uses the shared profile and launcher settings. Windows and Linux use the same migration logic; the reported end-to-end run does not establish both platforms. **Switches:** None added, changed or removed by the source migration. **Reviewed:** 8499ecef7366 against 31e07291ab71: Read AGENTS.md, CONTRIBUTING.md, src/game/stable_source.rs and src/game/source.rs in full; read the fix diff, source-migration diff, and relevant profile and settings code. Skimmed the larger base diff and documentation changes; the other changed code, translations and UI files were not read in full. No review checklist or pull request template was found at the specified paths.; nothing run (a code review). **Checked and fine:** - Empty profile game values are replaced under the profile edit lock. - A pending profile update can resume the settings write, and a changed profile source is preserved in the covered case. - The fix keeps the automatic linking path and reads the previous settings without writing them. **Testing:** No code or tests were run. The description reports a successful isolated migration run; CI has not run on this head. **Overlaps and merge order:** The supplied history contains preceding changes from other pull requests; their merge status is not available. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
HumanBean deleted branch feat/stable-game-file 2026-11-28 00:26:16 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
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
MagicBeanDev/LongshotLauncher!315
No description provided.