fix(release): the setup, the Builder and the game update from the repository they were built in #1414
Open
notquiteog wants to merge 1 commit from
notquiteog/pr/release-repository into main
pull from: notquiteog/pr/release-repository
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!1414
Loading…
Reference in a new issue
No description provided.
Delete branch "notquiteog/pr/release-repository"
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?
What
The setup, the Builder's updater, the Builder's "releases" link, the game's update check and the Linux updater now take the GitHub repository they install and update from from one setting,
HOOKSHOT_REPOSITORY(owner/name), instead of namingNotRexed/Hookshotin six places. The default isNotRexed/Hookshot, so nothing changes for this repository's builds.builder/setup/setup.c: a compile-time define;windows-builder.ymlpasses$GITHUB_REPOSITORY(the setup's compile line keeps--dependent-load-flag=0x800).tools/repository.txt, read by a newRepositoryclass (Updater.cs,MainWindow.xaml.cs);scripts/release_parts.py package --repositorywrites it, and the workflow passes$GITHUB_REPOSITORY.host/hos_update.c: a define fromnx2/version.py repository()(HOOKSHOT_REPOSITORY, elserepository.txtbeside the tools, else the default), given bynx2/build.pyto that one file.builder/linux/linux_update.py:repository.txtin the AppImage's tools, written byscripts/linux/appimage.shfrom$GITHUB_REPOSITORY.Why
A fork's release installed and offered this repository's builds, never its own: its
HookshotBuilder.exefetchedhookshot-setup.txtfrom NotRexed/Hookshot's release, and its update checks asked NotRexed/Hookshot's API. Same kind of fix as #1312 (the AppImage's parts list), for the rest of the update path. Found on notquiteog/Hookshot, where it is in use since v2.0.12.Testing
builder/setup/setup.candhost/hos_update.ccompile for Windows (MinGW) andhost/hos_update.cfor Linux, with and without the define.setup.cwithout the define nameshttps://github.com/NotRexed/Hookshot/releases/...in its URLs, as before; with-DHOOKSHOT_REPOSITORY="notquiteog/Hookshot"all three URLs name the fork.nx2/version.pyandlinux_update.pyfall back toNotRexed/Hookshotwithout the file.HookshotBuilder.execontains the fork's setup-list URLs, and the app part carriestools/repository.txt=notquiteog/Hookshot; the Builder's C# compiled in that CI run.tests/run_all.pyon this branch: 203 passed, 0 failed, 5 skipped.Not covered
🤖 Generated with Claude Code
Nice, small change, and the default keeps upstream builds identical. I read the Windows (setup, Builder, game) and Linux paths; the compile-time define, the C# and the
L##widening all look right to me, and the define is part of the object cache key innx2/build.pyso a fork build won't reuse an upstreamhos_update.o. CI is green.One real gap on Linux, which is half of what this PR is for:
scripts/linux/appimage.shstill callspython3 scripts/linux/make_parts.py "$APPDIR" "$VERSION" "$B/parts"without--base, andmake_parts.pydefaults--basetohttps://github.com/NotRexed/Hookshot/releases/download/linux-parts.publish_parts.shuploads the parts to$GITHUB_REPOSITORY'slinux-parts, but thehookshot-linux.txta fork publishes names upstream'slinux-partsURLs. So with this PR a fork's AppImage reads the fork's list (good), but then downloads the parts from NotRexed (the Windows side already passes--base "https://github.com/$GITHUB_REPOSITORY/..."). Passing--base "https://github.com/${GITHUB_REPOSITORY:-NotRexed/Hookshot}/releases/download/linux-parts"inappimage.shcloses it. Worth fixing here, since otherwise the Linux update still pulls upstream binaries on a fork.Smaller points:
nx2/version.py repository()/repository_define()andlinux_update._repository()(file present, file missing, bad value falling back to the default) are cheap to unit test, e.g. intests/test_linux_update.py(already registered intests/run_all.py), so no new registration is needed.[A-Za-z0-9._-]+for the name part also accepts.and... Harmless since the value comes from CI or a file you ship, butowner/..would build a path-traversing URL;(?!\.+$)or similar would rule it out.linux_update._repository()ignoresHOOKSHOT_REPOSITORYwhilenx2/version.pyhonors it, though the comment says it is the same rule. Fine either way, just make the comment say so.import reinside the function inlinux_update.py; could go at the top.Trust/redirects: the repository only comes from the CI env at packaging time (or a build-time env var for source builds), is regex-checked before use, and ends up in fixed
github.com/api.github.comURL templates, so I don't see a way to point updates at another host. GitHub follows renames/transfers, so a renamed fork keeps working. Note a fork's players trust the fork's releases, which is the intent here.Overlaps: none with #1201 or #1452 (release.yml / package.json only). #1059 and #1062 both edit
windows-builder.yml(setup compile / package steps, version step),linux-appimage.ymlandscripts/linux/appimage.sh, so expect small textual conflicts in whichever lands second; no semantic conflict, sinceGITHUB_REPOSITORYis the same inside theworkflow_callthey add. The package--repositoryand the compile-Dlines are one-line additions, so rebasing should be easy.Option ids aren't touched.
Heads-up: this conflicts with main now (a lot landed today). Could you merge main into the branch (or rebase) and resolve the conflicts? Thanks!
Half of the earlier review is resolved: main fixed the Linux parts gap on its own. In
2228816, scripts/linux/appimage.sh now passes--base "https://github.com/${GITHUB_REPOSITORY:-NotRexed/Hookshot}/releases/download/linux-parts"and buildsUPDATE_REPOthe same way.The branch conflicts in windows-builder.yml, linux_update.py, setup.c, hos_update.c, nx2/build.py and release_parts.py, though. Since this branch was cut, #2061 (update tracks) added new hard-coded NotRexed/Hookshot URLs that this PR doesn't cover yet:
hookshot-setup.txtandhookshot-linux.txtURLs in setup.c:636, hos_update.c:166/331 and Updater.cs:96releases?per_page=20lists in hos_update.c:170/334, Updater.cs:41 and linux_update.py:28release_of()in linux_update.py:133Without those, a fork on the Release candidate or Nightly track still updates from upstream.
builder/py/hookshot_builder/__init__.pyalso hard-codesREPO. The earlier nits are still open: no unit test forrepository(), and the regex acceptsowner/...