Point in-app updater at Forgejo releases and Wolfskin assets #17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fm/wolfskin-5-updater"
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?
Closes justinzeus/wolfskin#5
The in-app updater now checks this repo's Forgejo releases instead of the upstream GitHub releases.
Changes
preferences/AppPreference.kt: defaultupdateUrlishttps://git.justinvisser.org/api/v1/repos/justinzeus/wolfskin/releases/latest.services/UpdateChecker.kt:ASSET_NAMEisWolfskin, so ABI assets are matched asWolfskin-<abi>.apk.services/UpdateChecker.kt:getRelease(version)listsreleases?limit=50and returns the release whosenameparses viaVersion.fromStringto the installed version, or null. Wolfskin releases are named bygit describe(for examplev1.0.9-2-g3094fc8c) rather thanvX.Y.Z, so the tag lookup used upstream would never match.forgejo_release_latest.jsonandforgejo_releases.json(fields per the Release and Attachment schemas in the Forgejo swagger) underapp/src/test/resources/.TestUpdateCheckercovers latest-release parsing, ABI asset selection withWolfskin-*names, and version-match lookup (match and no match). GitHub fixtures kept.Validation (head
0f7a23faa8)make test: BUILD SUCCESSFUL in 3m 14s (testDefaultDebugUnitTest).make apk-debug: BUILD SUCCESSFUL in 1m 16s. Output:Wholphin-default-debug-1.0.9-6-g0f7a23fa-53{,-arm64-v8a,-armeabi-v7a,-x86_64}.apk.Notes for reviewer
Wholphin-because that comes from the upstream build output naming. The updater now expects release assets namedWolfskin-*, so the release pipeline must rename assets toWolfskin-*when publishing. This PR does not change that naming.make apk(release signing) was not run, per spec.Code review: request changes
Reviewed SHA:
0f7a23faa8c52d53759170e2aed1f7e9adb4da5e.Two blocking findings:
Installed release matching differs from updater ordering —
services/UpdateChecker.kt:74-81uses data-classVersion ==, including the hash and null-vs-zero commit count.util/Version.kt:41-70ordering ignores hash and treats absent count as zero. An executed probe confirms that1.0.9does not match releasev1.0.9-0-gabcdef0, and1.0.9-2-g3094fc8does not matchv1.0.9-2-g3094fc8c, although neither side orders greater than the other. Use ordering-equivalent matching and retain regression coverage. The installed no-leading-v case with identical count/hash already works.Lost positive asset-selection coverage —
test/TestUpdateChecker.kt:50-87changes formerly positive release/debug assertions to null checks. The Forgejo fixture restores unsuffixed ABI/universal positives, but contains noWolfskin-debug*.apkorWolfskin-release*.apkassets. Debug is now tested only negatively (:111-114); returning null for all debug builds would pass. Restore positive debug ABI/universal and release-suffixed priority/fallback coverage using Wolfskin-named assets.Verification: ran
flock /tmp/wolfskin-gradle.lock make testonce: BUILD SUCCESSFUL in 2m 23s, 389 tests, zero failures/errors/skips (388 committed tests plus one temporary smoke probe, now removed). All 12 committed updater tests pass. The actual updater smoke reproduced both version-equivalence misses, parsed the old GitHub fixture, positively selected debug ABI/universal assets, returned null on HTTP 200[]and HTTP 503, and observed IOException propagation on transport failure. Settings catches Exception (PreferencesViewModel.kt:148-161); no settings crash found. No TV/emulator was available; installation/signing continuity remains unverified.Notes, not blockers:
assets[].browser_download_url. They are schema-shaped synthetic fixtures, not demonstrated captures; live Wolfskin releases currently return[].Wolfskin.apkandWolfskin-arm64-v8a.apk(orWolfskin-release[-<abi>].apk).make apkstill emitsWholphin-default-release-<versionName>-<versionCode>[-<abi>].apk(app/build.gradle.kts:214-225). Merely swapping the prefix leaves unmatched flavor/version/code segments. No release build, push, or merge performed.Closing unmerged after review (version matching used exact equality instead of the updater's ordering equivalence; positive debug/release asset coverage was lost). A takeover PR continues from this head (
0f7a23fa) and will saySupersedesthis one.Pull request closed