Skip to content

K2GO-592 fix(forgejo): bank the Forgejo seed on every install path - #819

Merged
luisguzman-adfa merged 2 commits into
mainfrom
fix/K2GO-592-forgejo-seed-module-management
Nov 22, 2026
Merged

luisguzman-adfa merged 2 commits into
mainfrom
fix/K2GO-592-forgejo-seed-module-management

Conversation

@luisguzman-adfa

@luisguzman-adfa luisguzman-adfa commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

  • ModuleProvisioner.startBatch banks the Forgejo seed when the module batch installs Forgejo. This is the one place that every install path goes through: Settings > Module management, the module action sheet, the module detail screen, and Retry.
  • The rule "a batch with Forgejo owes a seed" is in forgejo/domain/ForgejoSeedRule (pure JVM, unit test ForgejoSeedRuleTest).
  • ModuleActionSheet and ModuleDetailFragment no longer bank the seed. The detail screen only records its "include example repos" choice (ForgejoInstallPrefs.recordIncludeRepos), on the same key as before.
  • Second commit: the install stall watch (InstallService.moduleWriteDirSize) also adds the size of the Ansible temp dir (root/.ansible/tmp). Ansible get_url downloads there and moves the file to the module dir only at the end, so a slow Forgejo download (about 100 MB) was killed after 360 s with no growth seen.

Why

A Forgejo installed from Settings > Module management did not get its admin account k2goadmin, the org or the example repos, because only two screens banked the seed. No new state: the pending-seed marker keeps one setter (the batch start, plus the explicit re-seed actions) and one clearer (ForgejoSeedService).

Steps to QA

Baseline (main):

  1. On a box without Forgejo, open Settings > Module management, tick Forgejo, tap Install.
  2. When the install ends, GET /forgejo/api/v1/users/k2goadmin returns 404, and /k2go-api/forgejo/status shows adminExists:false.

Change (this branch):

  1. Do the same steps.
  2. The seed screen runs after the install. k2goadmin returns 200, and /k2go-api/forgejo/status shows adminExists:true and the repos KnowledgeToGo, CodeOnTheGo and addons.

Stall watch (second commit): remove the cached Forgejo binary on a box with a slow link to codeberg.org, then install Forgejo. On main the log shows [Stall] 'forgejo' made no progress for 360s and the install fails. On this branch the download runs to the end and the install succeeds.

Verifications

  • Evidence (before and after on the same phone and box, Samsung A16) is in the Jira ticket K2GO-592.
  • :app:testStandardDebugUnitTest passes. Two-pass code review done.
  • Coordination: the repo status descriptions after the seed come in a separate PR on the same ticket (box script only).

Notes

  • Stall watch check on the Samsung A16: the Forgejo download took about 10 minutes (23:38 to 23:48), with 0 [Stall] lines, and the install ended OK. On main the same download was killed two times at 360 s.

A Forgejo installed from Settings > Module management did not get its admin account,
because only two screens banked the seed. Now the module batch start banks it when the
batch installs Forgejo, so every install path (and Retry) seeds the forge.
…is not killed

Ansible get_url downloads into /root/.ansible/tmp and moves the file to the module dir
only at the end. The stall watch saw no growth there and killed a slow Forgejo download
after 360 s. It now adds the Ansible temp dir to the module dir size.
@luisguzman-adfa
luisguzman-adfa merged commit a505f68 into main Nov 22, 2026
4 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the fix/K2GO-592-forgejo-seed-module-management branch November 22, 2026 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant