Skip to content

feat(bootstrap): add apk package support - #10476

Merged
jdx merged 1 commit into
mainfrom
codex/add-apk-bootstrap-packages
Jun 16, 2026
Merged

jdx merged 1 commit into
mainfrom
codex/add-apk-bootstrap-packages

Conversation

@jdx

@jdx jdx commented Jun 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Add Alpine apk as a bootstrap package manager for [bootstrap.packages]
  • Support status, install, upgrade, explicit --manager apk, and use version pins
  • Document apk bootstrap packages and regenerate CLI usage docs

Closes #10449

Testing

  • cargo fmt --check
  • cargo test system::packages::apk
  • cargo test system::tests::test_parse_use_spec
  • mise run render:usage
  • mise run test:e2e e2e/cli/test_system_status e2e/cli/test_system_use e2e/cli/test_system_install_apk

This PR description was generated by an AI coding assistant.


Note

Low Risk
Follows the existing bootstrap package-manager pattern; changes apply only on Linux when apk is present and may run elevated apk commands during explicit bootstrap installs.

Overview
Adds Alpine Linux apk as a bootstrap package manager for [bootstrap.packages], using the apk:package key form alongside apt, dnf, pacman, and brew.

A new ApkManager implements status (apk info -e -v), install (apk add, with optional --update-cache), and upgrade (apk upgrade --available --update-cache), including version pins via name=version. CLI --manager choices, mise bootstrap --update help, and packages use parsing for apk:…@version are wired through the same paths as other Linux managers.

Docs gain a dedicated apk page and cross-links; usage/man/fig completions are regenerated. E2E coverage includes Alpine-only install/upgrade/use tests plus shared status/use checks when apk is absent.

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

Summary by CodeRabbit

  • New Features
    • Added Alpine Linux (apk) package manager support for bootstrap packages
    • Allow specifying Alpine packages via apk:package-name (including @version pinning)
    • Expanded --manager and related upgrade/install behavior to cover apk
  • Documentation
    • Updated CLI help, manuals, and guides with apk examples and metadata-refresh details
  • Tests
    • Added/extended Linux e2e coverage for apk install, status, upgrade, and use/pinning behavior

@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 2 potential issues.

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 d54b1b2. Configure here.

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

greptile-apps Bot commented Jun 16, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds Alpine Linux apk as a bootstrap package manager alongside the existing apt, dnf, pacman, and brew backends. The new ApkManager wires into the shared status/install/upgrade/use flow with no changes to the shared driver logic.

  • ApkManager implementation (src/system/packages/apk.rs): queries installed state with apk info -e -v, installs with apk add (optional --update-cache when --update is set), upgrades with apk upgrade --available --update-cache. Version pins use apk's native name=version syntax. The parse_apk_info helper uses a prefix-strip with a digit guard (starts_with(|c: char| c.is_ascii_digit())) to avoid false-positive matches between similarly-named packages (e.g. zlib vs zlib-dev).
  • CLI and docs updated consistently across --manager value parsers, man page, .kdl usage file, Fig completions, and all relevant documentation pages to include apk as a first-class manager.
  • E2e coverage in test_system_install_apk (Alpine-only, root-guarded) exercises the full lifecycle; test_system_status and test_system_use gain apk dry-run assertions that run on any platform.

Confidence Score: 5/5

Safe to merge — the new ApkManager is additive, follows the established pattern exactly, and is only invoked when apk is explicitly requested or configured.

The implementation is self-contained and well-tested. The one correctness risk (prefix matching zlib against zlib-dev output) was addressed with the ASCII-digit guard, and the unit tests explicitly verify that case. The shared driver and cross-platform config loading are untouched.

No files require special attention.

Important Files Changed

Filename Overview
src/system/packages/apk.rs New ApkManager implementation: status via apk info -e -v, install via apk add, upgrade via apk upgrade --available --update-cache. Version pin parsing uses name- prefix with a digit guard that correctly prevents false-positive matches. Stderr filter handles expected WARNING lines from apk's non-zero exit on missing packages.
src/system/packages/mod.rs Adds apk module and registers ApkManager in all_managers(). Comment on InstallOpts.update generalized from apt-specific to manager-agnostic.
e2e/cli/test_system_install_apk New e2e test for Alpine-only path: guards with uname, command -v apk, and root check; exercises install, status, upgrade dry-run, and use on the bc package.
e2e/cli/test_system_status Adds apk:bc to the multi-manager status fixture and a non-Alpine guard that verifies --manager apk fails with 'apk is not available' when apk is absent.
src/cli/system/install.rs Added apk to the --manager value_parser choices; updated doc strings and example to include apk:zlib-dev.
src/cli/system/upgrade.rs Added apk to the --manager value_parser choices and updated doc strings.
docs/bootstrap/packages/apk.md New documentation page for the apk package manager covering behavior, sudo, update-cache, and version pins.
src/system/mod.rs Added unit test for parse_use_spec("apk:zlib-dev@1.3.1-r2") to cover the apk version-pin round-trip through the use spec parser.

Reviews (3): Last reviewed commit: "feat(bootstrap): add apk package support" | Re-trigger Greptile

Comment thread src/system/packages/apk.rs Resolved
@jdx
jdx force-pushed the codex/add-apk-bootstrap-packages branch from d54b1b2 to a59885e Compare June 16, 2026 01:45
@coderabbitai

coderabbitai Bot commented Jun 16, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: e80d741b-37c9-415a-ba80-2429c45d64e1

📥 Commits

Reviewing files that changed from the base of the PR and between a59885e and 043fe80.

📒 Files selected for processing (22)
  • docs/.vitepress/config.ts
  • docs/bootstrap.md
  • docs/bootstrap/packages/apk.md
  • docs/bootstrap/packages/index.md
  • docs/cli/bootstrap.md
  • docs/cli/bootstrap/packages/install.md
  • docs/cli/bootstrap/packages/upgrade.md
  • docs/cli/bootstrap/packages/use.md
  • docs/tips-and-tricks.md
  • e2e/cli/test_system_install_apk
  • e2e/cli/test_system_status
  • e2e/cli/test_system_use
  • man/man1/mise.1
  • mise.usage.kdl
  • src/cli/bootstrap.rs
  • src/cli/system/install.rs
  • src/cli/system/upgrade.rs
  • src/cli/system/use.rs
  • src/system/mod.rs
  • src/system/packages/apk.rs
  • src/system/packages/mod.rs
  • xtasks/fig/src/mise.ts
✅ Files skipped from review due to trivial changes (9)
  • docs/cli/bootstrap.md
  • docs/tips-and-tricks.md
  • src/cli/bootstrap.rs
  • src/cli/system/use.rs
  • xtasks/fig/src/mise.ts
  • docs/cli/bootstrap/packages/use.md
  • docs/cli/bootstrap/packages/upgrade.md
  • docs/bootstrap/packages/index.md
  • man/man1/mise.1
🚧 Files skipped from review as they are similar to previous changes (11)
  • docs/.vitepress/config.ts
  • docs/bootstrap/packages/apk.md
  • e2e/cli/test_system_status
  • src/system/mod.rs
  • e2e/cli/test_system_use
  • src/cli/system/upgrade.rs
  • src/system/packages/mod.rs
  • e2e/cli/test_system_install_apk
  • src/system/packages/apk.rs
  • src/cli/system/install.rs
  • mise.usage.kdl

📝 Walkthrough

Walkthrough

Adds Alpine Linux apk as a new bootstrap package manager. Implements ApkManager with SystemPackageManager trait methods (installed, install, upgrade), registers it in the manager registry, expands CLI --manager allowed values across install/upgrade commands, updates the KDL usage spec, adds e2e tests, and updates all related documentation.

Changes

Alpine apk Bootstrap Package Manager

Layer / File(s) Summary
ApkManager core implementation
src/system/packages/apk.rs, src/system/packages/mod.rs, src/system/mod.rs
New ApkManager struct implementing SystemPackageManager with parse_apk_info for status detection, installed/install/upgrade async methods using sudo::run, registered in all_managers(), with unit tests for parsing and spec parsing.
CLI argument expansion and usage spec
src/cli/system/install.rs, src/cli/system/upgrade.rs, src/cli/system/use.rs, src/cli/bootstrap.rs, mise.usage.kdl
apk added to value_parser allowed values for --manager in install and upgrade commands; --update help text updated to include apk --update-cache; mise.usage.kdl gains a new --update flag for install and expanded manager/help text throughout.
E2E tests for apk
e2e/cli/test_system_install_apk, e2e/cli/test_system_status, e2e/cli/test_system_use
New test_system_install_apk covering status transitions, dry-run, idempotent install, upgrade, and use --yes on Linux/root/apk. Existing tests updated to include apk:bc fixture, assert "apk" key in JSON output, and test unavailability error.
Documentation
docs/bootstrap/packages/apk.md, docs/bootstrap/packages/index.md, docs/bootstrap.md, docs/tips-and-tricks.md, docs/cli/bootstrap/..., man/man1/mise.1, xtasks/fig/src/mise.ts, docs/.vitepress/config.ts
New apk.md reference page; apk added to supported manager tables, config examples, and command examples across bootstrap docs; man page and fig completion spec updated with apk references; VitePress sidebar entry added.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • jdx/mise#10346: Introduced the parse_use_spec infrastructure in src/system/mod.rs that this PR extends with apk:..@<version> parsing assertions.

Poem

🐇 Hop, hop — Alpine peaks are calling,
A new apk manager installed without stalling!
apk add bc with a sudo so neat,
Version pins and dry-runs — what a feat!
The rabbit grins, the bootstrap's complete. 🏔️

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 15.38% 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(bootstrap): add apk package support' clearly and concisely summarizes the main change: adding Alpine Linux apk as a new bootstrap package manager, which aligns with all file modifications focused on apk integration.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

@jdx
jdx force-pushed the codex/add-apk-bootstrap-packages branch from a59885e to 043fe80 Compare June 16, 2026 01:56
@github-actions

Copy link
Copy Markdown
Contributor

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.10 x -- echo 19.0 ± 2.6 16.9 33.9 1.00
mise x -- echo 19.3 ± 1.4 17.3 42.6 1.02 ± 0.16

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.10 env 18.4 ± 0.8 16.9 21.9 1.00
mise env 19.2 ± 1.0 17.4 24.1 1.04 ± 0.07

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.10 hook-env 19.0 ± 0.8 17.4 22.2 1.00
mise hook-env 19.6 ± 0.9 17.8 25.0 1.03 ± 0.06

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.10 ls 15.9 ± 0.7 14.5 18.7 1.00
mise ls 16.5 ± 0.8 14.9 21.8 1.04 ± 0.07

xtasks/test/perf

Command mise-2026.6.10 mise Variance
install (cached) 134ms 134ms +0%
ls (cached) 59ms 59ms +0%
bin-paths (cached) 63ms 64ms -1%
task-ls (cached) 126ms 125ms +0%

@jdx
jdx merged commit d7683fd into main Jun 16, 2026
35 checks passed
@jdx
jdx deleted the codex/add-apk-bootstrap-packages branch June 16, 2026 02:23
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