feat(builder): Proper versioning and policies #2201
Open
Fanatrick wants to merge 1 commit from
Fanatrick/proper-launcher-versioning-rebased into main
pull from: Fanatrick/proper-launcher-versioning-rebased
merge into: MagicBeanDev:main
MagicBeanDev:main
MagicBeanDev:github/pr/2893
MagicBeanDev:github/pr/2890
MagicBeanDev:github/pr/2887
MagicBeanDev:github/pr/2878
MagicBeanDev:github/pr/2875
MagicBeanDev:github/pr/2874
MagicBeanDev:github/pr/2873
MagicBeanDev:github/pr/2871
MagicBeanDev:github/pr/2756
MagicBeanDev:github/pr/2897
MagicBeanDev:github/pr/2896
MagicBeanDev:github/pr/2718
MagicBeanDev:github/pr/2842
MagicBeanDev:github/pr/2691
MagicBeanDev:github/pr/2895
MagicBeanDev:github/pr/2743
MagicBeanDev:github/pr/2765
MagicBeanDev:github/pr/2708
MagicBeanDev:github/pr/2732
MagicBeanDev:github/pr/2755
MagicBeanDev:github/pr/2817
MagicBeanDev:github/pr/2876
MagicBeanDev:release-please--branches--main
MagicBeanDev:release-please--branches--main--release-notes
MagicBeanDev:github/pr/2778
MagicBeanDev:github/pr/2888
MagicBeanDev:github/pr/2866
MagicBeanDev:github/pr/2877
MagicBeanDev:github/pr/2800
MagicBeanDev:github/pr/2829
MagicBeanDev:github/pr/2850
MagicBeanDev:github/pr/2889
MagicBeanDev:github/pr/2882
MagicBeanDev:github/pr/2860
MagicBeanDev:github/pr/2849
MagicBeanDev:github/pr/2886
MagicBeanDev:github/pr/2794
MagicBeanDev:github/pr/2840
MagicBeanDev:github/pr/2830
MagicBeanDev:github/pr/2834
MagicBeanDev:github/pr/2719
MagicBeanDev:github/pr/2742
MagicBeanDev:github/pr/2741
MagicBeanDev:github/pr/2820
MagicBeanDev:github/pr/2771
MagicBeanDev:github/pr/2859
MagicBeanDev:github/pr/2858
MagicBeanDev:github/pr/2823
MagicBeanDev:github/pr/2757
MagicBeanDev:github/pr/2769
MagicBeanDev:github/pr/2844
MagicBeanDev:github/pr/2843
MagicBeanDev:github/pr/2673
MagicBeanDev:github/pr/2855
MagicBeanDev:github/pr/2739
MagicBeanDev:github/pr/2807
MagicBeanDev:github/pr/2851
MagicBeanDev:github/pr/2789
MagicBeanDev:github/pr/2814
MagicBeanDev:github/pr/2818
MagicBeanDev:github/pr/2774
MagicBeanDev:github/pr/2772
MagicBeanDev:github/pr/2750
MagicBeanDev:github/pr/2786
MagicBeanDev:github/pr/2785
MagicBeanDev:github/pr/2782
MagicBeanDev:github/pr/2779
MagicBeanDev:github/pr/2775
MagicBeanDev:github/pr/2706
MagicBeanDev:github/pr/2766
MagicBeanDev:github/pr/2747
MagicBeanDev:github/pr/2759
MagicBeanDev:github/pr/2745
MagicBeanDev:github/pr/2740
MagicBeanDev:github/pr/2733
MagicBeanDev:github/pr/2725
MagicBeanDev:github/pr/2727
MagicBeanDev:github/pr/2728
MagicBeanDev:github/pr/2729
MagicBeanDev:github/pr/2721
MagicBeanDev:github/pr/2722
MagicBeanDev:github/pr/2715
MagicBeanDev:github/pr/2714
MagicBeanDev:github/pr/2707
MagicBeanDev:github/pr/2703
MagicBeanDev:github/pr/2705
MagicBeanDev:github/pr/2697
MagicBeanDev:github/pr/2679
MagicBeanDev:github/pr/2676
MagicBeanDev:github/pr/2669
MagicBeanDev:docs/what-hookshot-connects-to
MagicBeanDev:fix/hdr-encode-test
MagicBeanDev:fix/main-tests
MagicBeanDev:fix/play-cache-files
MagicBeanDev:perf/game-barrier-order
MagicBeanDev:feat/heap-lazy
MagicBeanDev:feat/texture-detail
MagicBeanDev:perf/astc-opaque-bc1
MagicBeanDev:fix/fs-dir-lock
MagicBeanDev:fix/framegen-native-kept
MagicBeanDev:fix/update-no-downgrade
MagicBeanDev:port/k10-gcn-f16-mirrors
MagicBeanDev:fix/framegen-mult-cap
MagicBeanDev:chore/release-as-2.1.1
MagicBeanDev:perf/pcache-load-switch
MagicBeanDev:fix/prepare-progress-log
MagicBeanDev:fix/update-closes-stale-game
MagicBeanDev:fix/hdr-scaled-sampled
MagicBeanDev:perf/first-start-preset
MagicBeanDev:perf/zero-upload
MagicBeanDev:fix/vcore-escape-2s
MagicBeanDev:test/fake-gh-atomic
MagicBeanDev:perf/batch-idle-flush
MagicBeanDev:test/finish-stub-a
MagicBeanDev:chore/record-2.1.0
MagicBeanDev:fix/main-red-tests
MagicBeanDev:fix/test-display-startup-driver-cache
MagicBeanDev:feat/mesh-shader-mode
MagicBeanDev:fix/menu-probes-at-startup
MagicBeanDev:fix/fps-counter-classic
MagicBeanDev:fix/test-log-batch-flake
MagicBeanDev:fix/narrow-screen-hud
MagicBeanDev:ci/prereleases
MagicBeanDev:release/v2.0.15
MagicBeanDev:hotfix/v2.0.15
MagicBeanDev:fix/present-ahead-replay
MagicBeanDev:release/v2.0.13
MagicBeanDev:fix/bracket-paths-2013
MagicBeanDev:fix/hdr-overlays-2013
MagicBeanDev:fix/fps-counter-scale-2013
MagicBeanDev:fix/stick-seen-at-rest
MagicBeanDev:hotfix/menu-fits-screen
MagicBeanDev:fix/f1-always-opens-menu
MagicBeanDev:fix/ini-keep-lines
MagicBeanDev:claude/cranky-pike-7cf247
MagicBeanDev:perf/texture-answer-flat
MagicBeanDev:fix/stamp-test-modules
MagicBeanDev:fix/appimage-fonts
MagicBeanDev:fix/display-awake
MagicBeanDev:release/v2.0.12
MagicBeanDev:fix/discord-windows
MagicBeanDev:rc/v2.0.12-tests
MagicBeanDev:fix/dlss-keep-feature
MagicBeanDev:rc/v2.0.12
MagicBeanDev:button-icons
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
autorelease: pending
autorelease: tagged
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
github_actions
Pull requests that update GitHub Actions code
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
question
Further information is requested
testing wanted
wontfix
This will not be worked on
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
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/Hookshot!2201
Loading…
Reference in a new issue
No description provided.
Delete branch "Fanatrick/proper-launcher-versioning-rebased"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds version management to the Hookshot launcher, allowing users to select and install specific releases instead of always being limited to the latest available version.
Users can now upgrade, downgrade, or stay on their preferred version directly through the launcher.
Changes
Implementation
The changes extend the existing WPF launcher and updater without replacing the game's compilation pipeline.
Version preferences are stored within the installation's
userdirectory, allowing them to persist across rebuilds. The game's update-check logic also respects pinned versions.Notes
Testing
Thanks for this. Picking a version is a reasonable thing to want, and the tag validation before building API URLs and the "GitHub returned X, not the requested Y" check are good. But by the description's own account this hasn't been compiled or run on Windows yet, and CI has only run the title check (the builder package job hasn't run). Reading the code, I also see a few design problems that need sorting out before it can merge. I covered all five files; I couldn't build the WPF project here, so everything below comes from reading the source.
blocking: Untested. "Windows compilation and end-to-end launcher testing remain to be completed." CONTRIBUTING.md asks for the relevant checks and CI to pass before review, and a launcher change has to be run at least once: open the launcher with an update available, switch to an older release, and switch back. Please also add screenshots of the new launcher panel; it shows on screen, so CONTRIBUTING.md (Commits and pull requests, item 5) requires them.
blocking
builder/HookshotBuilder/MainWindow.xaml.cs:224,:241-247,:288-307: this replaces the ordinary update flow for every player, not just those who want a specific version. With no pin, the combo selectsupdateTarget, so whenever an update exists the launcher shows "Switch vX to vY: the game will be rebuilt" with a Switch version button. The old highlighted "Update available: X" status is gone, every routine update now goes through a warning dialog, writes a backup, and touches the pin file, andOlderOk's confirmation for an older release on a track switch is dropped. The "X is out: build this folder again…" message for folders without game sources is replaced by a vaguer one. I'd keep the existing Update path unchanged when the selection is the update target, and use the switch dialog and backup only when the player picks some other version.should fix (design): pinning and downgrading can't work for any release that exists today.
host/hos_update.c:190-194only honours the pin in games built from this code, and the launcher that reads it is this builder. Switching to any release in the dropdown (all of them predate this PR) installs that release's builder and builds that release's game. From then on, neither the old launcher nor the old game's update offer knows abouthookshot_update_policy.txt: the player is offered the latest version again on every launch, and the picker is gone (as the description notes). So the "Stay on the selected version" checkbox appears to work but has no effect after a downgrade. At a minimum, filter the dropdown to releases that carry this feature, or say plainly in the UI that a pin only holds on versions from X onward.question: downgrading runs an older
make_game.py --updateon a folder last built by a newer one (newer compiled objects, caches,hookshot_version.txtcontents). Has anyone checked that an older builder handles a newer folder rather than reusing something incompatible? If that isn't known, a downgrade might be safer as a fresh build into a new folder.should fix
builder/HookshotBuilder/VersionPolicy.cs:23-45: the backup goes to%LOCALAPPDATA%\HookshotBuilder\version-backups\<timestamp>with nothing pruning it and nothing telling the player where it is. Every switch adds a full copy of the saves. Show the path after the backup (or in the dialog), and keep the last few. It also skipslanguage.txt, which CONTRIBUTING.md lists with the settings.minor
builder/HookshotBuilder/MainWindow.xaml.cs:252-260: changes to the pin checkbox are only saved when the selection is the installed version. If a player picks another release, toggles the checkbox, then picks the installed version again, the checkbox no longer matches the file. ResyncLaunchPinVersion.IsCheckedfromVersionPolicy.PinnedTaginRefreshLaunchSelection.minor
builder/HookshotBuilder/Updater.cs:24-44:ReleaseTagsreads one page of 100 releases and filters prereleases afterwards, so once the repository has more than 100 releases (RCs included), older stable ones drop out of the list. It's also a second unauthenticated GitHub API call on every launcher open, on top ofLatestTag(the anonymous limit is 60 an hour). Fetching the list only when the player opens the dropdown would avoid that.minor
builder/HookshotBuilder/Updater.cs:61:FromCommandLinenow passesnamed: tag != null, which also changes the game's own update offer (hos_update.cstarts the builder with--update <folder> --tag <release>) from thelatestendpoint to the exact tag. That's probably fine, maybe better, but it changes existing behaviour outside the launcher and should be in the description.The PR also needs a "why" opening line in player terms, and a note in CONTRIBUTING.md's Hookshot Builder section about the new panel.
Still open from the earlier review, and not yet built or run on Windows by its own description:
OlderOkconfirmation is dropped (MainWindow.xaml.cs~224-307).hos_update.c:190), so the old launcher and game ignore it.language.txt.ReleaseTagsonly reads one page of 100 releases.Thanks for this, a way to pick a release is a good thing to want. I read all five files and the discussion; I did not build it. I agree with Joey-Magnus's two reviews (untested on Windows and no screenshots, the normal Update flow replaced for everyone, pin not holding after a downgrade, unpruned backups, the one-page release list) and won't repeat them. I'd treat the first two as the blockers. A few more points, and how this fits with the other open update PRs.
Further findings
MainWindow.xaml.csLaunchUpdateClick: the pin is written beforeUpdateFolderruns. If the download or build fails, or is cancelled, the folder is still on the old version but the pin file names the new one. The game ignores it (it only honours a pin equal to the installed version), but the launcher then preselectspinned ?? updateTargetand shows a switch to a version that never got installed. Write the pin after a successful switch, or clear it on failure.ShowLauncher: ifReleaseTags()throws (rate limit, bad JSON) the dropdown is reduced to the installed version, so the Update button disappears even whenLatestTagworked and an update is known. KeepupdateTargetin the list on that path, so a releases-list failure doesn't hide a routine update.hos_update.c: the pin check is only in the Windowshos_update_check. Fine for a Windows-only feature, but the Linux function reads the sameuser/folder and will ignore a pin file; a line in the description saves a bug report later.Updater.ValidTag/VersionPolicyrepeat the same tag rule twice, and it rejects+while the shared one in #2430 (TagOk) allows it. Once #2430 is in, use that instead of a third copy.tests/test_update_tracks.py-style (pin line honoured only when equal to the installed version) would be cheap and would run in CI.Overlap with #2519 and #2430
hos_update_checkso a folder newer than the latest release is not offered the older one. Different hunk from the pin check here, so I don't expect a textual conflict, and the two agree: the pin suppresses the offer on the pinned version, #2519 suppresses it for a build newer than the latest. After a downgrade neither applies, which is the problem Joey raised.Updater.cs(tag validation inUpdateFolder,LatestTag, regexes with\z) andhos_update.c(builder path checks, env handling around the builder start). GitHub says this PR merges cleanly now, but whichever lands second needs a rebase aroundUpdateFolderand the end ofhos_update_check. #2430 already rejects a bad tag at the top ofUpdateFolder, so theValidTagcheck added here becomes redundant.CI only ran the title check, so nothing builds the launcher yet. I'm leaving this as a comment; whether and when it merges is for the maintainer to decide.