kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Migrate kolibri-installer-gnome into the Python monorepo

Open rtibbles opened this issue 5 months ago • 1 comments

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

Migrate kolibri-installer-gnome from its standalone repo into platforms/ as a co-located non-member. It's a meson-built GNOME app packaged as a Flatpak. The revival (gnome#115, gnome#116) has landed via gnome#118 and gnome#121; this migrates the result.

Complexity: Medium · Target branch: develop

Context

kolibri-installer-gnome holds:

  • meson.build, src/ (Python apps, the C search provider and daemon D-Bus library, the vendored channel-launcher plugin), data/, po/, VERSION, .bumpversion.toml, flathub.json;
  • build-aux/flatpak/ — dev manifest (org.learningequality.Kolibri.Devel.json) and production manifest (org.learningequality.Kolibri.json, builds kolibri-gnome from a git tag), sharing modules/;
  • build-aux/flatpak/ scripts: prepare-kolibri-module.py, sync-flathub.py, smoke_test.py, tools/kolibri-listcontent.py, and their tests/.

Its CI:

  • build_flatpak.yml (reusable) — builds the Flatpak on GNOME 49 from a Kolibri wheel by URL or artifact (whl-url/whl-file-name).
  • build.yml (on: pull_request) — resolves the latest Kolibri release whl, then runs:
    • flatpak — calls build_flatpak.yml;
    • smoke_test — two-phase smoke_test.py on GNOME 49;
    • release_script_tests — pytest build-aux/flatpak/tests;
    • validate_production_manifest — renders the pinned Kolibri module, runs flatpak-builder --show-manifest.
  • pre-commit.yml — black, reorder-python-imports, flake8 (.flake8), mypy, yamlfmt, actionlint.
  • release-flathub.yml (reusable) — opens a Flathub PR (full release → master, pre-release → beta). Checks out kolibri-installer-gnome at ref; sync-flathub.py pins the kolibri-gnome module's tag/commit. Needs LEQ_BOT_CLASSIC_PAT.

pr_build_kolibri.yml has no Flatpak job.

The app version is independent of Kolibri's: VERSION feeds meson; the metainfo <releases> list is hand-written. 3.8 is live on Flathub.

The Change

  • Move the repo into platforms/flatpak-app/, preserving history via git filter-repo --to-subdirectory-filter + merge --allow-unrelated-histories.
  • Migrate build_flatpak.yml and release-flathub.yml as platform-gnome-*.yml; build.yml's build, test and validation jobs move into pr_build_kolibri.yml, and pre-commit.yml into the monorepo's pre-commit (ruff replaces black/reorder-python-imports/flake8; drop .flake8).
  • Production manifest kolibri-gnome source: Kolibri repo URL, Kolibri release tag + commit, subdir: platforms/flatpak-app; sync-flathub.py rewrites URL and subdir as well as tag/commit.
  • App version is (major + 3).minor.patch of Kolibri's (0.19.5 → 3.19.5, 1.0.0 → 4.0.0), pre-release suffix after ~ (0.19.5b1 → 3.19.5~b1); the release generates the metainfo <release> entry; drop VERSION and .bumpversion.toml.
  • release_kolibri.yml calls release-flathub.yml; add LEQ_BOT_CLASSIC_PAT to the Kolibri repo.

Out of Scope

  • Migrating other installers — separate per-repo tasks under #13720.
  • Archiving the source repo and transferring its open issues.
  • Flathub write-access credentials / LE maintainership — gated separately (gnome#116).
  • Behavioural changes to the app.
  • Making the Flatpak jobs blocking — smoke_tests in pr_build_kolibri.yml remains the sole blocking gate.

Acceptance Criteria

Code migration

  • [ ] All migrated source present (manifests, modules, vendored plugin, meson build, scripts and tests, po/, data/).
  • [ ] No pyproject.toml / workspace link.
  • [ ] git blame on migrated files traces to the original commits.
  • [ ] Passes monorepo pre-commit.

CI / publish

  • [ ] On a Kolibri PR, pr_build_kolibri.yml builds the Flatpak from the PR's own whl, and the bundle installs and passes smoke_test.py on GNOME 49.
  • [ ] pr_build_kolibri.yml runs build-aux/flatpak/tests and the production-manifest --show-manifest check.
  • [ ] A Kolibri release opens a Flathub PR whose manifest builds kolibri-gnome from that release's tag in the Kolibri repo.

Versioning

  • [ ] A build from Kolibri 0.19.x reports a version that sorts above 3.8 under AppStream version comparison.
  • [ ] A pre-release build's version sorts below the matching final release.
  • [ ] Metainfo <releases> includes an entry for the built version.

References

  • Source repository: https://github.com/learningequality/kolibri-installer-gnome
  • Flathub repository: https://github.com/flathub/org.learningequality.Kolibri
  • Flatpak GitHub Actions: https://github.com/flatpak/flatpak-github-actions

AI usage

I chose the scope and the (major + 3).minor.patch versioning scheme. Claude Code read the source repo's CI, manifests and release scripts, and drafted the sections.

rtibbles avatar Jul 05 '26 01:07 rtibbles

Plan: Move the GNOME Flatpak app into platforms/flatpak-app/ with its history. Build and smoke-test it on every Kolibri PR, version it from Kolibri, and open a Flathub PR from each Kolibri release.

  • [ ] Graft the source history into platforms/flatpak-app/
  • [ ] Adopt the monorepo workspace and lint config
  • [ ] Version the app from the bundled Kolibri
  • [ ] Build, smoke-test and validate the Flatpak on every Kolibri PR
  • [ ] Open a Flathub PR from each Kolibri release
  • [ ] Self-review the produced code

Assumptions — the issue did not settle these; say so if one is wrong.

  • The committed production manifest carries the URL and subdir but no tag/commit, which sync-flathub.py adds. A committed pin could only name a tag without this dir, so it would not build.
  • Stable releases open the master PR after block_release_step; pre-releases open a beta PR unapproved. If pre-releases should skip Flathub, gate on !prerelease.
  • The generated <release> has no description, so the About dialog's "What's New" is empty. Release notes would need a translatable template.
  • The release date is the build date. A Flathub rebuild of the same release moves it; pinning it needs a date passed in.
  • The Flatpak cache is keyed on the manifests and modules, not github.sha. Per-commit keys save a new entry every push against the repo's 10 GB cache.
  • mypy stays, scoped to this dir: ruff replaces only black, reorder-python-imports and flake8. If mypy should go, delete one hook block.
  • po/ stays out of crowdin.yml. desktop-app and android got theirs in follow-ups (#15073, #15074); adding it here is one entry.
  • A repo admin adds LEQ_BOT_CLASSIC_PAT. Until then, the first release's Flathub job fails at the flathub checkout.
  • Flathub gets releases from the first tag that contains this dir, likely a v0.20.0 pre-release to beta. 0.19.x patch releases need a backport to release-v0.19.x.
  • This migrates source main at 132b861. Commits that land there afterwards need a second merge.

@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly

How was this generated?
  • Implemented code following the pre-approved plan using test-driven development (red-green-refactor)
  • Ran the project's full test suite and linter before committing
  • For UI changes: captured live screenshots to verify rendering
  • For backend changes: verified with example API/CLI output

rtibblesbot avatar Sep 22 '26 21:09 rtibblesbot