Linux builder: an Actions build is not made to update to an older release before it builds (#902) #911
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!911
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/linux-ci-builder-no-forced-update"
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?
Fixes #902.
choose_modeinbuilder/linux/linux_update.pyreturnedupdate-builderwhenever the builder's version string differed from the latest release tag. A CI AppImage is stamped byscripts/linux/appimage.shwithgit describeoutput (v2.0.5-3-g1a2b3c4, or a bare commit, ordev), which never equalsv2.0.5. So every Actions build had to replace itself with the older release before it could build. The launcher made the same comparison: a game built by a CI builder showed "Update available: v2.0.5", which was really a downgrade.begin_updatedownloaded the release instead of rebuilding the folder with the builder that was running.Versions are now compared instead of string-matched:
release_key(tag)turns a version into an orderable key. A prerelease sorts before its release, andgit describe's-N-g<sha>/-dirtysort after their tag and before the next release. Anything that names no release (a bare commit, including an all-digit one,dev, empty) givesNone.update_target(latest, tools)returns the latest release only when both versions parse and the release is strictly newer. Otherwise it returns the builder's own version, as before when GitHub didn't answer.choose_mode,apply_mode,apply_launchandbegin_updateall use it.Results:
v2.0.4v2.0.5v2.1.0-rc.1v2.1.0v2.0.4-3-g1a2b3c4(Actions, after an older release)v2.0.5v2.0.5-3-g1a2b3c4(Actions)v2.0.51a2b3c4,devv2.0.5v2.0.10v2.0.9A game built by an Actions builder now shows Play rather than an "update" back to the release. An older game is rebuilt with the running builder, with nothing downloaded.
Tests:
tests/test_linux_update.pyhas a new case covering the rows above. With main'sbuilder/linuxit fails (AssertionError: 'update-builder' != 'build'); with this branch all 8 tests pass.test_hookshot_launch,test_linux_builder_jobs,test_desktop_execandtest_builder_statusalso pass. I haven't run the Tk window with a real CI AppImage.Not changed:
MainWindow.xaml.cs,builder != latestTag) uses the same rule and would need the same change. I couldn't build or test it here.A behaviour change worth knowing about, now covered by a test: if a game built by the v2.0.5 release is opened in a newer Actions builder (
v2.0.5-3-g…), the builder now offers Update. That rebuilds the game with the builder that's running, with nothing downloaded, the same as for any game older than the builder. Before this change it showed Play only because the builder was treated as v2.0.5. Thelatestthis compares against comes fromreleases/latest, which is never a prerelease.