Skip to content

K2GO-422 feat(forgejo): non-destructive live repo refresh + "Update repos" action - #595

Merged
luisguzman-adfa merged 4 commits into
mainfrom
feat/K2GO-422-forgejo-repos-post-install
Sep 26, 2026
Merged

luisguzman-adfa merged 4 commits into
mainfrom
feat/K2GO-422-forgejo-repos-post-install

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

Section A of K2GO-422: keep the seeded Forgejo example repos fresh, non-destructively, from the app.

What this changes

  • Box: refresh_forgejo in the shared orchestration. Per repo: fast-forward when pristine, a clean
    3-way merge (git merge-tree, no worktree) when the owner committed on the served branch, skip on
    conflict; deepen-on-demand avoids a false "blocked" when a repo fell past the shallow depth. Every
    advance is a fast-forward push through Forgejo, so a refresh never drops a commit. Each repo
    description is rewritten as a status board (Last Update / Last Attempt / Status). New
    POST /forgejo/refresh, GET /forgejo/refresh/status, POST /forgejo/refresh/cancel via
    tools/forgejo-refresh.sh. Seed clone depth 1 -> 20. dash-node 1.3.6 -> 1.3.7.
  • App: one shared flow (ForgejoRepoRefresh) drives "Update repos" from the module detail button and
    the module action sheet row, shown only when the forge is manageable and the repos are present.
    Gated like the dashboard update (internet + metered). Inline progress + Cancel; outcome snackbar
    covers every state.
  • l10n: the nine new strings translated to all 33 locales.

Verification

  • Device-validated fast-forward on 64-bit and 32-bit (Samsung: 3 repos ff).
  • Two-pass review done; shallow-depth and cancel-pid findings fixed. The diverged clean-merge path is
    reviewed but not device-exercised (no divergent repo to stage without a proot session). Minor deferred:
    counts parsed from the box log; offline writes "updatable"; bounded Activity-retention on a hung
    fetch; no guard vs a concurrent dashboard rebuild.

Follow-up: K2GO-430 (require a minimum dash-node version per module).

…ash-node 1.3.7)

Add refresh_forgejo to the shared orchestration: per repo fast-forward when pristine, a clean 3-way merge (git merge-tree, no worktree) when the owner committed on the served branch, skip on conflict. The served branch only moves forward (every advance is a fast-forward push THROUGH forgejo so its hooks fire), so a refresh never drops a commit. Deepen-on-demand avoids a false 'blocked' when a repo fell more than the shallow depth behind. Each repo's description is rewritten as a human status board (Last Update / Last Attempt / Status), derived from git state. New POST /forgejo/refresh, GET /forgejo/refresh/status (with changed/problems/total), POST /forgejo/refresh/cancel (SIGKILL the wrapper process group), via tools/forgejo-refresh.sh. Seed clone depth 1 -> 20. dash-node 1.3.6 -> 1.3.7.
…tion sheet

One shared flow (ForgejoRepoRefresh) drives the box refresh from two entry points: the module detail button and the module action sheet row (Material ic_refresh). Shown only when the forge is manageable and the example repos are present (ForgejoStatusClient.canUpdateRepos()); a forge with an admin K2Go cannot authenticate stays blocked. Gates like the dashboard update (internet + metered consent). Minimal inline progress (description + live output tail + indeterminate bar + Cancel); the trigger stays in place (disabled) as an anchor. Result snackbar covers every state: updated / already up to date / some could not be updated / could not update any / cancelled. No persistent app-side state (the box job is detached). ForgejoSeedClient gains refresh()/cancelRefresh() and the outcome counts, reusing the seed poll.
Migrate the nine k2go_forgejo_update_* strings out of the WIP tracker into strings.xml with values for all 33 locales (machine-generated, flagged for human review).
The hero ImageView used android:tint, which lint flags as an error (UseAppTint, not in the baseline) and fails lintStandardDebug on main. Switch to app:tint (AppCompat auto-inflates ImageView to AppCompatImageView) and declare xmlns:app. Visually identical.
@luisguzman-adfa
luisguzman-adfa merged commit 8f5860b into main Sep 26, 2026
4 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the feat/K2GO-422-forgejo-repos-post-install branch September 26, 2026 00:32
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