launcher: check for updates at start and update in one click (LAUNCHER-UPDATE) #3057

Merged
leonida/mandy
OreoFR merged 3 commits from feat/launcher-update into main 2026-12-02 07:35:13 +00:00

Pull request successfully merged and closed

OreoFR commented 2026-12-02 06:38:34 +00:00

Claimed in the coordination issue as LAUNCHER-UPDATE: https://github.com/ProjectLeonida/mandy/issues/2570

What and why

Players keep asking how to update. The launcher had no update path, and a zip install cannot git pull at all.

  • Check at start. A background thread runs git fetch --quiet, then git rev-list --count HEAD..@{u}. When the clone is behind, the Play page's bar shows "Update available: N new commits" and an Update button. A failed fetch, a missing git or a branch with no upstream is reported in one line, never raised.
  • Update (that button, or Tools > Update Leonida, after a confirmation) runs this file's own --update mode, so its output streams into the launcher like the other tools:
    • git pull --ff-only; with local changes or another branch in the way it stops and changes nothing;
    • then the runtime is rebuilt (d3d12\scripts\build-nvidia.ps1), only when d3d12/ changed between the old and new HEAD;
    • after it ends, the check runs again.
  • Zip install (no .git): the launcher says that updating needs a git clone.
  • Settings: a "Check for updates at start" box, on by default, turns the fetch off.
  • docs/launcher.md describes it.

It only talks to the repository's own remote (git fetch). No other service is contacted.

Tested

  • python -I tests/test_leonida_launcher.py: 23 tests, 7 of them new. They use a fake git and cover: zip copy, N commits behind, failed fetch, no upstream, a rebuild only when d3d12/ changed, a pull that cannot fast-forward (no build), the --update command line, and the setting.
  • End to end on Windows 11, with a real bare remote and a clone two commits behind:
    • the check returned behind 2 with the expected note;
    • --update fast-forwarded the clone, saw d3d12/ change and started the rebuild. The rebuild script was absent from that test repository, as expected.
  • tests/test_text_write_line_endings.py and scripts/check_no_game_data.py are clean.
  • Not clicked through in the window: the game was running on the test PC (RTX 4070 Laptop).

Touches the same file as #3056 (a different part of it). Whichever merges second may need a trivial rebase.

AI-assisted (oreofr-agent, Claude).

🤖 Generated with Claude Code

Claimed in the coordination issue as `LAUNCHER-UPDATE`: https://github.com/ProjectLeonida/mandy/issues/2570 ### What and why Players keep asking how to update. The launcher had no update path, and a zip install cannot `git pull` at all. - **Check at start.** A background thread runs `git fetch --quiet`, then `git rev-list --count HEAD..@{u}`. When the clone is behind, the Play page's bar shows "Update available: N new commits" and an **Update** button. A failed fetch, a missing git or a branch with no upstream is reported in one line, never raised. - **Update** (that button, or Tools > Update Leonida, after a confirmation) runs this file's own `--update` mode, so its output streams into the launcher like the other tools: - `git pull --ff-only`; with local changes or another branch in the way it stops and changes nothing; - then the runtime is rebuilt (`d3d12\scripts\build-nvidia.ps1`), only when `d3d12/` changed between the old and new HEAD; - after it ends, the check runs again. - **Zip install** (no `.git`): the launcher says that updating needs a `git clone`. - **Settings:** a "Check for updates at start" box, on by default, turns the fetch off. - `docs/launcher.md` describes it. It only talks to the repository's own remote (`git fetch`). No other service is contacted. ### Tested - `python -I tests/test_leonida_launcher.py`: 23 tests, 7 of them new. They use a fake git and cover: zip copy, N commits behind, failed fetch, no upstream, a rebuild only when `d3d12/` changed, a pull that cannot fast-forward (no build), the `--update` command line, and the setting. - End to end on Windows 11, with a real bare remote and a clone two commits behind: - the check returned `behind 2` with the expected note; - `--update` fast-forwarded the clone, saw `d3d12/` change and started the rebuild. The rebuild script was absent from that test repository, as expected. - `tests/test_text_write_line_endings.py` and `scripts/check_no_game_data.py` are clean. - Not clicked through in the window: the game was running on the test PC (RTX 4070 Laptop). Touches the same file as #3056 (a different part of it). Whichever merges second may need a trivial rebase. AI-assisted (oreofr-agent, Claude). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
OreoFR commented 2026-12-02 06:56:23 +00:00

Merging (oreofr-agent, with OreoFR's written OK as maintainer): head 094be1f323124d5607cd27a8b7ef945e5e832f8d, CI green, merges cleanly into main f37c4a87d. Launcher, its tests and doc only. 23/23 launcher tests pass. Window checked on a test clone two commits behind: "Update available: 2 new commits" and the Update button show beside PLAY. --update fast-forwarded a real clone and started the rebuild when d3d12/ changed. Queued after #3056, which touches another part of the same file.

Merging (oreofr-agent, with OreoFR's written OK as maintainer): head `094be1f323124d5607cd27a8b7ef945e5e832f8d`, CI green, merges cleanly into main `f37c4a87d`. Launcher, its tests and doc only. 23/23 launcher tests pass. Window checked on a test clone two commits behind: "Update available: 2 new commits" and the Update button show beside PLAY. `--update` fast-forwarded a real clone and started the rebuild when `d3d12/` changed. Queued after #3056, which touches another part of the same file.
OreoFR commented 2026-12-02 07:24:21 +00:00

Merging again (oreofr-agent, with OreoFR's written OK): head d9ac7f6f0c1797fd54430b9e00e39d6979e360a0. The queue had taken it out over a conflict with #3056, which had just merged and changed the same options list. Main is merged in, and the conflict is resolved by keeping both: #3056's label for "Precompile every pipeline" and this PR's "Check for updates at start" box. Launcher tests 23/23, CI green.

Merging again (oreofr-agent, with OreoFR's written OK): head `d9ac7f6f0c1797fd54430b9e00e39d6979e360a0`. The queue had taken it out over a conflict with #3056, which had just merged and changed the same options list. Main is merged in, and the conflict is resolved by keeping both: #3056's label for "Precompile every pipeline" and this PR's "Check for updates at start" box. Launcher tests 23/23, CI green.
Sign in to join this conversation.
No description provided.