Skip to content

feat(bootstrap): add flatpak package support - #10951

Merged
jdx merged 2 commits into
mainfrom
codex/flatpak-bootstrap-packages
Jul 13, 2026
Merged

jdx merged 2 commits into
mainfrom
codex/flatpak-bootstrap-packages

Conversation

@jdx

@jdx jdx commented Jul 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add a Linux Flatpak manager for [bootstrap.packages]
  • detect system-wide applications and runtimes and support noninteractive install/update
  • document configuration, remote prerequisites, CLI usage, and version-pin limitations
  • update generated CLI reference documentation

Closes the feature request raised in #10936.

Validation

  • mise run lint
  • cargo test system::packages::flatpak
  • mise run render:usage

Note

Low Risk
Additive bootstrap backend and documentation; behavior is gated to Linux with the flatpak CLI present and follows the same driver patterns as other package managers.

Overview
Adds Flatpak as a Linux bootstrap package manager for [bootstrap.packages], using entries like flatpak:org.mozilla.firefox with "latest" only (no version pins).

A new FlatpakManager plugs into the existing bootstrap packages driver: it lists system-wide installs via flatpak list, applies missing IDs with flatpak install --system --noninteractive, and upgrades with flatpak update --system --noninteractive. Availability is Linux-only when flatpak is on PATH; pinned versions are rejected on install/upgrade. Unit tests cover list parsing and pinned-request guards.

CLI and docs add flatpak to --manager on mise bootstrap packages apply / upgrade, refresh examples and generated usage/man pages, add docs/bootstrap/packages/flatpak.md, and list flatpak in plugin systemDependencies package maps.

Reviewed by Cursor Bugbot for commit f01f0b7. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • New Features

    • Added Flatpak as a supported package manager for system package bootstrapping on Linux (e.g., flatpak:<id>=<version> via flatpak:<app-id> entries).
    • Added Flatpak-aware apply, upgrade, and use behaviors, including latest-only handling and skipping unsupported/unavailable cases.
  • Documentation

    • Updated all relevant CLI, man page, and bootstrap docs with Flatpak examples, supported-manager options, and upgrade behavior notes.
  • Tests

    • Added unit tests covering Flatpak package listing/parsing and version-mismatch handling.

Entire-Checkpoint: dfcbcbab4dc9
@coderabbitai

coderabbitai Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds Flatpak as a Linux system package manager for bootstrap package status detection, installation, upgrades, CLI manager selection, examples, and documentation.

Changes

Flatpak bootstrap support

Layer / File(s) Summary
Flatpak manager implementation
src/system/packages/flatpak.rs
Adds Flatpak availability checks, package listing and status parsing, system-wide install and upgrade commands, dry-run handling, unsupported pin detection, error propagation, and unit coverage.
Manager registration and CLI wiring
src/system/packages/mod.rs, src/cli/system/*.rs, mise.usage.kdl, man/man1/mise.1
Registers FlatpakManager and adds flatpak to bootstrap package manager choices, help text, and command examples.
Flatpak bootstrap documentation
docs/bootstrap*.md, docs/bootstrap/packages/*, docs/cli/bootstrap/packages/*.md, docs/tool-plugin-development.md
Documents Flatpak configuration, prerequisites, Linux availability, commands, upgrade behavior, examples, and package dependency mappings.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant BootstrapPackages
  participant FlatpakManager
  participant FlatpakCLI
  BootstrapPackages->>FlatpakManager: Request package status, install, or upgrade
  FlatpakManager->>FlatpakCLI: Run flatpak list, install, or update
  FlatpakCLI-->>FlatpakManager: Return package data or command error
  FlatpakManager-->>BootstrapPackages: Return statuses or error
Loading

Possibly related PRs

  • jdx/mise#10397: Adds another package manager through the same bootstrap CLI manager-selection paths.
  • jdx/mise#10476: Adds another system package manager through the shared registry and CLI wiring.

Suggested reviewers: daandemeyer, thomask33, risu729, jsoref, fru1tworld

Poem

I’m a bunny with Flatpak in tow,
Installing apps where system winds blow.
latest hops in, pins stay away,
Linux commands guide the way.
Docs bloom brightly—what a treat! 🐇

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding Flatpak support for bootstrap packages.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e69959c. Configure here.

Comment thread src/system/packages/flatpak.rs Resolved
@greptile-apps

greptile-apps Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds flatpak as a new bootstrap package manager so [bootstrap.packages] can declare Linux system-wide Flatpak apps and runtimes (e.g. "flatpak:org.mozilla.firefox" = "latest"). The implementation follows the existing SystemPackageManager pattern, wires --manager flatpak into the apply/upgrade/use CLI, and ships matching documentation.

  • FlatpakManager uses flatpak list --system --columns=application,version for status, flatpak install --system --noninteractive for installs, and flatpak update --system --noninteractive for upgrades; version pins are explicitly unsupported.
  • The parser accumulates multiple installed branches for the same application ID into a deduplicated, sorted display string, and upgrade() has a defensive empty-slice early-return.
  • install() is missing the same empty-slice guard that upgrade() and installed() both carry, leading to a misleading dry-run output or a noisy error when called with no packages.

Confidence Score: 5/5

Safe to merge; the new Flatpak manager is Linux-only and opt-in, and the only inconsistency found is a cosmetic dry-run output gap in install().

The implementation is self-contained, well-tested, and follows the established manager pattern. The upgrade() and installed() empty-slice guards are in place. The one gap in install() produces a misleading dry-run print or a flatpak CLI error rather than any destructive behaviour.

src/system/packages/flatpak.rs — the install() method's missing empty-slice guard.

Important Files Changed

Filename Overview
src/system/packages/flatpak.rs New FlatpakManager: installs/upgrades system-wide Flatpak apps; handles multi-branch dedup and empty-upgrade guard; install() lacks a symmetric empty-slice guard.
src/system/packages/mod.rs Registers FlatpakManager in all_managers(); is_available() handles the Linux-only check at runtime.
src/cli/system/install.rs Adds flatpak to the --manager value-parser list and updates help text and examples.
src/cli/system/upgrade.rs Adds flatpak to the --manager value-parser list and updates doc strings.
docs/bootstrap/packages/flatpak.md New Flatpak-specific docs: config syntax, remote setup, CLI examples, version-pin limitation notice.
docs/bootstrap/packages/index.md Adds flatpak to the supported-managers table, OS-filtering notes, and command examples.

Reviews (2): Last reviewed commit: "fix(bootstrap): harden flatpak package s..." | Re-trigger Greptile

Comment thread src/system/packages/flatpak.rs Resolved
Comment thread src/system/packages/flatpak.rs Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (3)
src/system/packages/flatpak.rs (3)

124-136: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Guard upgrade against empty pkgs to avoid updating all Flatpaks.

flatpak update with no refs updates every installed app/runtime. If upgrade is called with an empty slice, the current code runs flatpak update --system --noninteractive which would update everything — likely not the intended behavior. The installed method already guards with an early return (line 85–87); upgrade should do the same.

🛡️ Proposed fix
 async fn upgrade(&self, pkgs: &[PackageRequest], opts: &InstallOpts) -> Result<()> {
+    if pkgs.is_empty() {
+        return Ok(());
+    }
     let mut args = vec![
         "update".to_string(),
         "--system".to_string(),
         "--noninteractive".to_string(),
     ];
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/system/packages/flatpak.rs` around lines 124 - 136, Update the upgrade
method to return early with Ok(()) when pkgs is empty, before constructing or
executing the flatpak update command. Preserve the existing behavior for
non-empty package requests and mirror the guard used by installed.

107-136: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add version-pin guard to upgrade for consistency with install.

install defensively bails on pinned packages (line 108–110), but upgrade does not. While the driver filters pins upstream for managers with supports_version_pins() == false, adding the same guard to upgrade keeps the two methods symmetric and protects against direct calls bypassing the driver.

♻️ Proposed refactor
 async fn upgrade(&self, pkgs: &[PackageRequest], opts: &InstallOpts) -> Result<()> {
+    if let Some(pkg) = pkgs.iter().find(|pkg| pkg.version.is_some()) {
+        bail!("flatpak cannot upgrade a pinned version ('{pkg}')");
+    }
     let mut args = vec![
         "update".to_string(),
         "system".to_string(),
         "--noninteractive".to_string(),
     ];
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/system/packages/flatpak.rs` around lines 107 - 136, Add the same
pinned-version validation used by install to the upgrade method: detect any
PackageRequest with version.is_some() and bail with the existing flatpak
pinned-version error before constructing upgrade arguments. Keep the remaining
upgrade behavior unchanged.

151-164: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add edge-case tests for parse_flatpak_list.

The test covers the happy path and a missing package. Consider adding cases for: (1) empty version string → should yield "unknown", (2) empty input → all packages Missing, (3) duplicate app IDs in output (HashMap keeps last).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/system/packages/flatpak.rs` around lines 151 - 164, Add edge-case
coverage to test_parse_flatpak_list for an installed package with an empty
version, asserting the version becomes "unknown"; empty Flatpak output,
asserting every requested package is Missing; and duplicate app IDs, asserting
the final occurrence’s version is retained.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/system/packages/flatpak.rs`:
- Around line 124-136: Update the upgrade method to return early with Ok(())
when pkgs is empty, before constructing or executing the flatpak update command.
Preserve the existing behavior for non-empty package requests and mirror the
guard used by installed.
- Around line 107-136: Add the same pinned-version validation used by install to
the upgrade method: detect any PackageRequest with version.is_some() and bail
with the existing flatpak pinned-version error before constructing upgrade
arguments. Keep the remaining upgrade behavior unchanged.
- Around line 151-164: Add edge-case coverage to test_parse_flatpak_list for an
installed package with an empty version, asserting the version becomes
"unknown"; empty Flatpak output, asserting every requested package is Missing;
and duplicate app IDs, asserting the final occurrence’s version is retained.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 4a4148bf-6379-473b-840b-48da0433c8d4

📥 Commits

Reviewing files that changed from the base of the PR and between b574e15 and e69959c.

📒 Files selected for processing (13)
  • docs/bootstrap.md
  • docs/bootstrap/packages/flatpak.md
  • docs/bootstrap/packages/index.md
  • docs/cli/bootstrap/packages/apply.md
  • docs/cli/bootstrap/packages/upgrade.md
  • docs/cli/bootstrap/packages/use.md
  • docs/tool-plugin-development.md
  • mise.usage.kdl
  • src/cli/system/install.rs
  • src/cli/system/upgrade.rs
  • src/cli/system/use.rs
  • src/system/packages/flatpak.rs
  • src/system/packages/mod.rs

@github-actions

github-actions Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.7.5 x -- echo 21.5 ± 1.3 19.3 27.9 1.00
mise x -- echo 23.0 ± 2.6 20.3 58.9 1.07 ± 0.14

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.7.5 env 21.4 ± 0.9 19.4 25.3 1.00
mise env 21.8 ± 0.9 19.5 25.3 1.02 ± 0.06

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.7.5 hook-env 28.8 ± 6.6 20.4 40.1 1.15 ± 0.33
mise hook-env 25.1 ± 4.4 21.3 39.8 1.00
✅ Performance improvement for hook-env is 15%

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.7.5 ls 18.8 ± 0.8 17.3 22.5 1.00
mise ls 21.8 ± 1.4 18.8 27.9 1.16 ± 0.09
⚠️ Inconclusive: ls measured 16% slower, but the relative uncertainty overlaps the 10% threshold.

xtasks/test/perf

Command mise-2026.7.5 mise Variance
install (cached) 181ms 179ms +1%
ls (cached) 72ms 75ms -4%
bin-paths (cached) 76ms 80ms -5%
task-ls (cached) 146ms 145ms +0%

Entire-Checkpoint: 944b03bfe6d6
@jdx
jdx merged commit 8305a51 into main Jul 13, 2026
35 checks passed
@jdx
jdx deleted the codex/flatpak-bootstrap-packages branch July 13, 2026 19:00
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