Skip to content

K2GO-593 feat(install): Forgejo binary download before the install - #823

Merged
luisguzman-adfa merged 14 commits into
mainfrom
feat/K2GO-593-module-install-progress
Nov 23, 2026
Merged

luisguzman-adfa merged 14 commits into
mainfrom
feat/K2GO-593-module-install-progress

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

This PR brings the work of #822 to main. #822 was stacked on the K2GO-593 module install progress branch (#821). #821 merged into main first, and #822 then merged into its base branch, not into main. This branch now holds the merged #822 (6fff974). It merges into main with no conflicts. The code is the same as the reviewed #822, plus two commits after that review: one progress panel for proot module installs (3882426) and the design map in CLAUDE.md (00858c4). Both were reviewed.

What changes

  • Forgejo task table (assets/runrole/forgejo.txt): the Forgejo install shows a percent and the time left for the Ansible steps, like the other modules.
  • dash-node 1.6.5, new job forgejo-bin: the box resolves the latest Forgejo release (the codeberg API, as the role) and downloads the binary with aria2 to /library/forgejo/bin/forgejo-<ver>. Percent, speed, time left, pause, resume, "Reconnecting n/5". Cancel removes the partial. The file is checked against the release sha-256; a wrong file is downloaded again. The app sends no URL.
  • App: the Forgejo binary downloads through that job BEFORE pdsm stop (the stop also stops dash-node). The runrole then pins forgejo_version for that run only, so the role's get_url skips the download and its GPG check verifies the file. Forgejo goes first in the batch, and its row runs during the download (tap opens the card, Cancel works). A failed download fails only Forgejo (Retry is offered). An owner pin of forgejo_version in local_vars skips the download.
  • One download card for every module download (maps base maps and the Forgejo binary): percent, speed, time left, Pause/Resume, "Reconnecting n of 5". MapsDownloadProgress becomes ModuleDownloadProgress.
  • Hold on mobile data: when Wi-Fi drops, the box download would continue on mobile data with no question. The app now holds the job on mobile data with no consent, and with Keep offline. It continues on Wi-Fi, or after the user taps the card button. A user pause is never continued by a network event.
  • Forgejo needs dash-node 1.6.5 (DashNodeRequirement); an older box asks for the dashboard update first.

Why

The Forgejo install showed only a spinner for about 10 minutes while Ansible downloaded ~100 MB with no percent, no pause and no resume. A cancel or a stall restarted the download from 0.

Steps to QA

Baseline (main): Settings > Module management > Code hosting > Install. The screen shows "Installing..." and a spinner during the binary download, with no bar.

Change (rebuild dash-node from this branch on the box first):

  1. Install Code hosting on Wi-Fi. The card "Downloading the program" shows percent, speed and time left, then the Ansible bar with percent and time left. The install ends with the seed done.
  2. During the download: Pause, then Resume. The download continues from the same percent.
  3. During the download: Cancel > Stop install. Nothing stays in /library/forgejo/bin/ (no .part). Retry downloads again.
  4. With mobile data on and no consent: turn Wi-Fi off during the download. The card shows "Waiting for Wi-Fi" and no data moves. Turn Wi-Fi on: the download continues. "Continue on data" also continues it.
  5. With the binary already in /library/forgejo/bin/: the download step ends at once.
  6. Maps from the setup wizard: the base map card works as before.

Verifications

UI changes

New strings (all 33 locales, machine translation for a later human review):

  • k2go_dl_program_title: "Downloading the program"
  • k2go_dl_speed: "%1$s/s"
  • k2go_dl_speed_eta: "%1$s/s, %2$s"
  • k2go_dl_held_metered: "Waiting for Wi-Fi. The download does not use mobile data until you allow it."
  • k2go_dl_held_offline: "Waiting. The app is kept offline, so the download does not connect until you allow it."
  • k2go_mod_phase_downloading: "Downloading..."

The maps download card now also shows the time left. Light and dark: checked on the device before merge (K2GO-593).

Notes

  • Out of scope: a faster mirror; pausing the Ansible steps.

The module -> OnlineAllowance kind rule lives in ModuleDownload.allowanceKind.
aria2 ignores out= with -Z (the canonical flags), so the file kept the
URL's name and the job ended 'did not complete' (seen on the A16).
The runner now downloads into bin/.k2go-download, checks the sha-256,
then moves the file to forgejo-<ver>.
The card showed the last poll before the pause (2% for a job paused at
23%, seen on the A16). onPaused now posts the box's percent again.
Maps and Forgejo now show the same panel: the install bar over the
download card (view_k2go_module_progress + ModuleProgressPanel). The two
copies of the install bar are gone. Each bar has one source
(ModuleQueueRepository, ModuleDownloadRepository) and the screens keep
no download flag. InstallService.postModuleStart is the one rule: a role
with a task table starts at 0% before its download, so Forgejo shows
both bars during the download, as maps does.
…flow

The progress panel, the two repositories, the start rule and the
dash-node download before pdsm stop, as the pattern for new modules.
The table has the role task names in run order, from a full run on the
OnePlus 7T (forgejo 17.0.2). Names that contain the version or the
architecture are not in it, because they change on each release.
A new durable job type. The box resolves the latest release (the codeberg
API, as the forgejo role) and downloads the binary with the canonical aria2
flags and the withRetry loop to /library/forgejo/bin/forgejo-<ver>. aria2
writes forgejo-<ver>.part, and the runner renames it at the end, so the
final name exists only for a complete file. Pause keeps the partial,
Cancel removes it. The job result gives the version, so the app can pin
forgejo_version and the role skips its own download. dash-node 1.6.5.
When the binary is already there, a partial of the same version from an
earlier error is removed too, so it does not stay on disk.
The Forgejo install downloads its ~100 MB binary through the dash-node
job forgejo-bin while the server is still up, before pdsm stop. The
runrole then pins forgejo_version for that run, so the role's get_url
skips the download and its GPG check verifies the file. A failed download
fails only Forgejo, and Retry is offered.

One download type and one card for every module download (maps base
maps and the Forgejo binary): percent, speed, time left, Pause/Resume,
"Reconnecting n of 5". MapsDownloadProgress and MapsDownloadRepository
become ModuleDownloadProgress and ModuleDownloadRepository.

The box downloads on the phone's default network, and aria2 continues
on mobile data after a Wi-Fi drop. DownloadHold (the start gate's
NetworkPolicy rule) holds the job on mobile data with no consent and with
Keep offline, and continues it on Wi-Fi or after the user allows it on
the card. A user pause is never continued by a network event.

Forgejo needs dash-node 1.6.5 (DashNodeRequirement).
Machine translation of the six new strings into the 33 locales, for a
later human review. Each locale uses its own words for mobile data, Wi-Fi
and the per-second unit.
…he sha-256

Forgejo goes first in the batch and its row runs during the download, so
the row opens the card and the install can be canceled. The box checks
the file against the release sha-256: a wrong file is downloaded again,
not kept for the GPG check to fail on every Retry. An owner pin of
forgejo_version in local_vars skips the download. The job detail is
logged only when it changes.
java.nio.file is API 26, and minSdk is 24: on Android 7 the read threw
NoSuchMethodError and the install service stopped.
…l-download

K2GO-593 feat(install): Forgejo binary download before the install
@luisguzman-adfa luisguzman-adfa added the ui change or edit to UI label Nov 23, 2026
@luisguzman-adfa
luisguzman-adfa merged commit eafc832 into main Nov 23, 2026
5 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the feat/K2GO-593-module-install-progress branch November 23, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui change or edit to UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant