Repository navigation
feat(bootstrap): add flatpak package support - #10951
Conversation
Entire-Checkpoint: dfcbcbab4dc9
📝 WalkthroughWalkthroughAdds Flatpak as a Linux system package manager for bootstrap package status detection, installation, upgrades, CLI manager selection, examples, and documentation. ChangesFlatpak bootstrap support
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
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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.
Greptile SummaryAdds
Confidence Score: 5/5Safe 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
Reviews (2): Last reviewed commit: "fix(bootstrap): harden flatpak package s..." | Re-trigger Greptile |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
src/system/packages/flatpak.rs (3)
124-136: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winGuard
upgradeagainst emptypkgsto avoid updating all Flatpaks.
flatpak updatewith no refs updates every installed app/runtime. Ifupgradeis called with an empty slice, the current code runsflatpak update --system --noninteractivewhich would update everything — likely not the intended behavior. Theinstalledmethod already guards with an early return (line 85–87);upgradeshould 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 winAdd version-pin guard to
upgradefor consistency withinstall.
installdefensively bails on pinned packages (line 108–110), butupgradedoes not. While the driver filters pins upstream for managers withsupports_version_pins() == false, adding the same guard toupgradekeeps 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 valueAdd 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 packagesMissing, (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
📒 Files selected for processing (13)
docs/bootstrap.mddocs/bootstrap/packages/flatpak.mddocs/bootstrap/packages/index.mddocs/cli/bootstrap/packages/apply.mddocs/cli/bootstrap/packages/upgrade.mddocs/cli/bootstrap/packages/use.mddocs/tool-plugin-development.mdmise.usage.kdlsrc/cli/system/install.rssrc/cli/system/upgrade.rssrc/cli/system/use.rssrc/system/packages/flatpak.rssrc/system/packages/mod.rs
Hyperfine Performance
|
| 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 |
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

Summary
[bootstrap.packages]Closes the feature request raised in #10936.
Validation
mise run lintcargo test system::packages::flatpakmise run render:usageNote
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 likeflatpak:org.mozilla.firefoxwith"latest"only (no version pins).A new
FlatpakManagerplugs into the existing bootstrap packages driver: it lists system-wide installs viaflatpak list, applies missing IDs withflatpak install --system --noninteractive, and upgrades withflatpak update --system --noninteractive. Availability is Linux-only whenflatpakis onPATH; pinned versions are rejected on install/upgrade. Unit tests cover list parsing and pinned-request guards.CLI and docs add
flatpakto--manageronmise bootstrap packages apply/upgrade, refresh examples and generated usage/man pages, adddocs/bootstrap/packages/flatpak.md, and listflatpakin pluginsystemDependenciespackage 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
flatpak:<id>=<version>viaflatpak:<app-id>entries).apply,upgrade, andusebehaviors, includinglatest-only handling and skipping unsupported/unavailable cases.Documentation
Tests