Skip to content

feat(flatpak): build the desktop app as a Flatpak in CI - #97

Merged
bketelsen merged 11 commits into
mainfrom
packaging/flatpak
Oct 26, 2026
Merged

bketelsen merged 11 commits into
mainfrom
packaging/flatpak

Conversation

@frostyard-machines

@frostyard-machines frostyard-machines commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Core Plan 0010 Phase 5, first step, frostnotes only: the desktop app as a Flatpak built in CI from offline sources (ADR-0031, core ADR-0058).

What it adds

  • packaging/flatpak/org.frostyard.Frostnotes.json: org.gnome.Platform//51, with Go, Node 24 and Rust from the SDK extensions. Offline sources: cargo-sources.json (flatpak-cargo-generator), node-sources.json (an offline pnpm store, flatpak-node-generator), go-sources.json (tools/flatpakgo, a file:// GOPROXY).
  • make flatpak-sources (scripts/flatpak-sources.sh) regenerates the 3 files from the lockfiles, with flatpak-builder-tools at a pinned commit, its Python dependencies from generator-requirements.txt (pip --require-hashes), and a local patch (patches/pnpm-git-path.patch) that stores only the #path: subdirectory of the 2 git-hosted lodge packages.
  • A launcher (/app/bin/frostnotes). When no notesd answers, it starts frostnotes --background (notesd only) in a new sandbox of the app through the Flatpak portal (flatpak-spawn, no --watch-bus), so notesd lives on after the window closes, until logout. Without the portal it starts no notesd of its own and says so; the app shows that notesd is not running. It then execs the app.
  • A PyGObject helper asks the Background portal to run frostnotes --background at login. It stays on the bus until the portal answers (a one-shot gdbus call would cancel the request).
  • notesd takes an exclusive lock on its data directory: a second notesd on it exits at once.
  • notesd's socket in the Flatpak is $XDG_RUNTIME_DIR/app/org.frostyard.Frostnotes/frostnotes/notesd.sock, the one directory all the app's sandboxes share (internal/config and paths.rs, with tests). So flatpak run --command=notesctl org.frostyard.Frostnotes works.
  • Permissions: Wayland/X11, IPC, DRI, network (sync), org.freedesktop.secrets (device tokens) and --filesystem=home for the vault folders (the document portal gives no inotify events and no stable path for a daemon; ADR-0031 has the reasons).
  • AppStream metainfo, desktop file, icons (scalable, 128, 512).
  • .github/workflows/flatpak.yml: a sources check (regenerate, then git diff --exit-code) and the build with run-tests (Rust tests, desktop-file-validate, appstreamcli validate, and a smoke test: launcher → notesd → notesctl vault add/write/cat).

Not in this PR: the publish

A later PR adds the v* tag publish, as igloo's workflow does: export the OCI image, push it to ghcr.io/frostyard/frostnotes (vX.Y.Z, sha-<commit>, then latest), and attest the digest. Brian must then:

  1. Make the GHCR package frostyard/frostnotes public after its first push.
  2. Optional: store FLATPAK_INDEX_DISPATCH_TOKEN in this repository, so the remote refreshes at once.
  3. Add frostnotes to apps.json in frostyard/flatpak-index.

Notes for Brian

  • The new jobs are not in the "required checks" ruleset. Add Flatpak (build and test) and Flatpak sources (make flatpak-sources) there if they must gate merges.
  • A dependency bump in go.mod, Cargo.lock or pnpm-lock.yaml now needs make flatpak-sources, else the sources job fails.
  • The portal paths (flatpak-spawn, the Background request) have no automated test: the build sandbox has no portal. Check them on Snow (Plan 0010's "Done when").
  • Follow-up (low, not blocking): add dist to the root dir source's skip list in the manifest, so a local make deb output is not copied into the Flatpak build.

Review

Cross-review: coder github-copilot/claude-sonnet-5.5, reviewer openai/gpt-6.1-sol. Initial review (2 batches) plus 3 re-reviews; 6 blocking findings, all resolved. Final: Ready at 7f1f23b (base f232d56), Blocking: none. CI green at that head, with the Flatpak tests (Rust tests, desktop-file-validate, appstreamcli validate, the smoke test).

@frostyard-machines
frostyard-machines marked this pull request as ready for review October 26, 2026 19:58
@frostyard-machines frostyard-machines added the ready-for-human Reviewed, CI green: ready for Brian to review and merge label Oct 26, 2026
@bketelsen
bketelsen merged commit 95089b8 into main Oct 26, 2026
8 checks passed
@bketelsen
bketelsen deleted the packaging/flatpak branch October 26, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Reviewed, CI green: ready for Brian to review and merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants