Skip to content

feat(github): support additional release assets - #11272

Merged
jdx merged 8 commits into
mainfrom
codex/github-multiple-assets
Jul 24, 2026
Merged

jdx merged 8 commits into
mainfrom
codex/github-multiple-assets

Conversation

@jdx

@jdx jdx commented Jul 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add additional_asset_patterns to the GitHub/GitLab/Forgejo release backend
  • extract supplemental archives into the primary asset's install directory in declaration order
  • lock and verify each supplemental artifact independently, including checksums and provenance
  • document the Ollama ROCm use case and clarify that tool aliases create separate installations rather than overlays

Motivation

Discussion #11259 needs both Ollama's normal Linux archive and its optional ROCm archive in one installation. The aqua package model selects one release asset, while changing the existing registry entry would make the large ROCm payload unconditional. An explicit GitHub backend overlay keeps the accelerator choice user-controlled and models the upstream release layout directly.

Validation

  • cargo test additional_
  • mise run test:e2e e2e/backend/test_github_additional_assets
  • mise run lint-fix
  • mise run lint

This pull request was generated by an AI coding assistant.


Note

Medium Risk
Touches install satisfaction, lockfile merge semantics, and provenance skip paths for multi-artifact installs; mistakes could cause wrong overlays or overly strict/lenient locked installs.

Overview
Adds additional_asset_patterns on the GitHub/GitLab/Forgejo backend so one tool install can pull extra release archives from the same tag and overlay them into the primary asset’s install directory (later files win on path conflicts). Supplemental archives skip primary-only layout options (strip_components, bin, rename_exe).

Install and lock behavior: Each supplemental asset is resolved, downloaded, checksummed, and provenance-verified on its own. Lockfiles gain ordered additional_artifacts (ArtifactInfo per file) plus provenance_verified so “detected” vs cryptographically verified provenance is explicit. --locked requires the lock’s supplemental list to match config; changing patterns after install is tracked via .mise-additional-assets.toml so adding ROCm-style extras to an already-installed version is not skipped.

Docs distinguish one composed installation (this option, e.g. Ollama + ROCm) from separate tools (aliases / matching per binary). E2E covers overlay install, lock pinning, and locked-mode strictness.

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

Summary by CodeRabbit

  • New Features
    • GitHub-based tools can now install multiple supplemental archive assets per platform using additional_asset_patterns, overlaying them into the primary install directory.
    • Lockfiles now store and provenance/verify these supplemental artifacts, and --locked fails if the recorded additional set/provenance doesn’t fully match.
    • When an explicit asset_pattern is provided, it takes precedence over overlay pattern resolution.
  • Documentation
    • Expanded GitHub backend “Tool Options” for additional_asset_patterns, including overlay behavior and --locked expectations.
  • Tests
    • Added coverage for overlay installation, lockfile recording, and --locked strictness.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds additional_asset_patterns support for GitHub-family backends, including platform-aware parsing, lockfile artifact persistence, explicit asset resolution, provenance verification, overlay installation, end-to-end coverage, and updated documentation.

Changes

Additional GitHub asset overlays

Layer / File(s) Summary
Platform option parsing
src/backend/options.rs, src/backend/static_helpers.rs, src/backend/github.rs
Platform-specific lookup parses supplemental asset patterns and includes them in install-time options and operation counts.
Lockfile artifact persistence
src/lockfile.rs
PlatformInfo stores, serializes, parses, and merges additional_artifacts metadata and provenance verification state.
Asset resolution and lock generation
src/backend/github.rs
Explicit patterns resolve supplemental assets across GitHub, GitLab, and Forgejo, while lock generation records URLs, checksums, sizes, and provenance.
Overlay installation and verification
src/backend/github.rs, e2e/backend/test_github_additional_assets, docs/dev-tools/backends/github.md
Installation downloads and overlays supplemental archives, enforces locked artifact data, verifies provenance with overlay context, and tests and documents the behavior.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Config
  participant GitHubBackend
  participant Lockfile
  participant InstallDirectory
  Config->>GitHubBackend: provide primary and additional_asset_patterns
  GitHubBackend->>Lockfile: resolve and record additional_artifacts
  GitHubBackend->>GitHubBackend: download and verify supplemental archives
  GitHubBackend->>InstallDirectory: overlay supplemental contents
  Lockfile-->>GitHubBackend: provide recorded artifacts for --locked install
Loading

Possibly related PRs

  • jdx/mise#11230: Related lockfile provenance and verification handling.

Poem

I’m a rabbit with archives tucked under my paws,
Primary and overlays now follow new laws.
Locks hold their checksums, neat in a row,
Binaries bloom where the install paths grow.
Hop, verify, overlay—off we go!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 is concise and accurately reflects the main feature: support for additional release assets, with GitHub as a key backend in the change.

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.

@greptile-apps

greptile-apps Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds supplemental release-asset overlays for GitHub, GitLab, and Forgejo backends.

  • Records supplemental artifact URLs, checksums, sizes, and provenance in per-platform lockfile entries.
  • Tracks configured overlay patterns to determine whether an existing installation remains satisfied.
  • Documents overlay behavior and adds unit and end-to-end coverage for installation and locked-mode validation.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failures eligible for this follow-up review remain.

No blocking failure remains.

Important Files Changed

Filename Overview
src/backend/github.rs Implements supplemental asset resolution, verification, extraction, installation-state tracking, and locked-mode validation.
src/lockfile.rs Adds supplemental artifact metadata and verified-provenance state to lockfile merge and serialization behavior.
src/backend/options.rs Extends backend option handling for supplemental release-asset patterns.
src/backend/static_helpers.rs Updates shared artifact-verification helpers to distinguish verified provenance.
e2e/backend/test_github_additional_assets Covers overlay extraction, lockfile metadata, locked-mode strictness, and supplemental-pattern removal.
docs/dev-tools/backends/github.md Documents supplemental archive overlays and distinguishes them from alias-based separate installations.

Reviews (8): Last reviewed commit: "fix(github): count overridden supplement..." | Re-trigger Greptile

@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.

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/lockfile.rs (1)

236-236: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

deny_unknown_fields on a lockfile-persisted struct is a forward-compat trap.

The rest of the lockfile (PlatformInfo::try_from) parses leniently and ignores unknown keys (e.g. legacy provenance_url). ArtifactInfo with #[serde(deny_unknown_fields)] will instead hard-fail the whole lockfile read if a newer mise version adds any field to an additional_artifacts entry. Consider dropping deny_unknown_fields to keep older clients able to read newer lockfiles.

🤖 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/lockfile.rs` at line 236, Remove the #[serde(deny_unknown_fields)]
attribute from the lockfile-persisted ArtifactInfo struct so deserialization
ignores fields added by newer mise versions, matching the lenient behavior of
PlatformInfo::try_from and preserving older-client compatibility.
🤖 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.

Inline comments:
In `@docs/dev-tools/backends/github.md`:
- Around line 84-86: Update the lockfile documentation around supplemental
artifacts to qualify provenance: state that verification and recorded provenance
apply only to the current platform, while cross-platform entries are
detection-only and failed verification records no provenance. Remove the
unconditional claim that every supplemental artifact has verified provenance,
and retain the existing --locked behavior description.

In `@e2e/backend/test_github_additional_assets`:
- Around line 26-30: Extend the locked-install test around mise install --locked
with a temporary incomplete supplemental artifact entry, then assert that the
locked installation fails rather than resolving the missing artifact. Restore
the original configuration afterward and retain the existing successful install
assertion to verify complete lockfile entries still work.

---

Nitpick comments:
In `@src/lockfile.rs`:
- Line 236: Remove the #[serde(deny_unknown_fields)] attribute from the
lockfile-persisted ArtifactInfo struct so deserialization ignores fields added
by newer mise versions, matching the lenient behavior of PlatformInfo::try_from
and preserving older-client compatibility.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: a6e86b1a-570d-4e36-b80b-3dd2b5b65710

📥 Commits

Reviewing files that changed from the base of the PR and between 2ce0198 and cc5208c.

📒 Files selected for processing (6)
  • docs/dev-tools/backends/github.md
  • e2e/backend/test_github_additional_assets
  • src/backend/github.rs
  • src/backend/options.rs
  • src/backend/static_helpers.rs
  • src/lockfile.rs

Comment thread docs/dev-tools/backends/github.md Resolved
@github-actions

github-actions Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.7.13 x -- echo 19.5 ± 1.0 17.8 27.3 1.00
mise x -- echo 20.9 ± 1.0 19.2 25.1 1.07 ± 0.08

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.7.13 env 18.3 ± 0.9 16.6 21.4 1.00
mise env 19.7 ± 0.9 18.0 24.5 1.08 ± 0.07

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.7.13 hook-env 19.1 ± 0.8 17.5 22.1 1.00
mise hook-env 20.6 ± 1.0 18.8 25.0 1.08 ± 0.07

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.7.13 ls 16.3 ± 0.9 14.7 21.4 1.00
mise ls 17.6 ± 1.0 16.1 23.2 1.08 ± 0.08

xtasks/test/perf

Command mise-2026.7.13 mise Variance
install (cached) 154ms 166ms -7%
ls (cached) 58ms 60ms -3%
bin-paths (cached) 65ms 68ms -4%
task-ls (cached) 135ms 138ms -2%

Comment thread src/lockfile.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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/lockfile.rs (1)

250-252: 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

Do not treat detected provenance as verified provenance.

src/backend/github.rs:808-860 stores detected provenance for every target but verifies it only when the target is current. A foreign-target entry therefore has a checksum and Some(provenance), making this predicate true; src/backend/github.rs:1374-1457 then skips provenance verification on the target host unless forced. Persist an explicit verified state (defaulting to false) and gate the skip on that state; add a cross-platform lock/install regression test.

🤖 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/lockfile.rs` around lines 250 - 252, Update Lockfile’s
has_checksum_and_verified_provenance predicate to require an explicit persisted
verified state, defaulting that state to false for existing or newly detected
provenance; ensure GitHub lock/install handling only skips provenance
verification when this state is true, while detected provenance alone remains
unverified. Add a cross-platform regression test covering a foreign-target entry
through lock/install and confirming verification is performed.
🤖 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.

Outside diff comments:
In `@src/lockfile.rs`:
- Around line 250-252: Update Lockfile’s has_checksum_and_verified_provenance
predicate to require an explicit persisted verified state, defaulting that state
to false for existing or newly detected provenance; ensure GitHub lock/install
handling only skips provenance verification when this state is true, while
detected provenance alone remains unverified. Add a cross-platform regression
test covering a foreign-target entry through lock/install and confirming
verification is performed.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: e60ad4bd-eaec-4ef5-8d20-e42784b01961

📥 Commits

Reviewing files that changed from the base of the PR and between 2981bd9 and a20b34d.

📒 Files selected for processing (1)
  • src/lockfile.rs

Comment thread src/backend/github.rs Resolved
Comment thread src/backend/github.rs Resolved
@jdx

jdx commented Jul 24, 2026

Copy link
Copy Markdown
Owner Author

Addressed the outside-diff provenance feedback in 0240d8a. Lock entries now persist an explicit provenance_verified state for primary and supplemental artifacts. Detection-only cross-platform entries default to unverified and therefore cannot bypass install-time verification; only successful current-platform verification sets the flag. Merge logic preserves verified provenance without promoting detection-only metadata, and lockfile/backend regression tests cover persistence and skip-gating behavior.

Validation: all 66 lockfile tests, all 33 GitHub backend tests, the supplemental-assets e2e, and full project lint pass.

This comment was generated by an AI coding assistant.

Comment thread src/backend/github.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 (1)
src/lockfile.rs (1)

236-257: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a direct test for merge_provenance_state's verified-over-unverified precedence.

The new merge tests (test_additional_artifacts_merge_integrity_for_same_urls, test_provenance_merge_preserves_existing, test_detected_cross_platform_provenance_is_not_verified) all use provenance_verified: false (default) on both sides of a merge, so the actual precedence rules in merge_provenance_state (verified wins over unverified regardless of which side is "current"/"other") are never exercised through a mismatched-flags merge. This is exactly the guarantee the PR's follow-up fix targets ("Lockfile merge behavior preserves verified provenance without promoting detection-only metadata"), so a focused unit test would lock in the regression protection at the source of truth rather than only at the higher-level consumers.

♻️ Suggested test
#[test]
fn test_merge_provenance_state_prefers_verified() {
    let verified = Some(ProvenanceType::GithubAttestations);
    let unverified = verified.clone();

    // Verified current beats unverified other.
    assert_eq!(
        merge_provenance_state(verified.clone(), true, unverified.clone(), false),
        (verified.clone(), true)
    );
    // Verified other beats unverified current.
    assert_eq!(
        merge_provenance_state(unverified, false, verified.clone(), true),
        (verified, true)
    );
}
🤖 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/lockfile.rs` around lines 236 - 257, Add a focused unit test for
merge_provenance_state that covers both argument orders: verified current with
unverified other, and unverified current with verified other. Assert each merge
preserves the verified ProvenanceType and returns true for the verification
flag.
🤖 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/lockfile.rs`:
- Around line 236-257: Add a focused unit test for merge_provenance_state that
covers both argument orders: verified current with unverified other, and
unverified current with verified other. Assert each merge preserves the verified
ProvenanceType and returns true for the verification flag.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 099c86e7-2bb5-4f5a-ba2a-99acaef06000

📥 Commits

Reviewing files that changed from the base of the PR and between a20b34d and 0240d8a.

📒 Files selected for processing (3)
  • e2e/backend/test_github_additional_assets
  • src/backend/github.rs
  • src/lockfile.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/backend/github.rs

Comment thread src/backend/github.rs Resolved
@jdx

jdx commented Jul 24, 2026

Copy link
Copy Markdown
Owner Author

Also addressed the CodeRabbit test-coverage nit in 3c5b315: test_merge_provenance_state_prefers_verified now exercises both argument orders with different provenance types and confirms verified metadata wins over detection-only metadata.

This comment was generated by an AI coding assistant.

Comment thread src/backend/github.rs Resolved

@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 d00be26. Configure here.

Comment thread src/backend/github.rs Resolved
@jdx
jdx enabled auto-merge (squash) July 24, 2026 23:49
@jdx
jdx merged commit b06e9b0 into main Jul 24, 2026
35 checks passed
@jdx
jdx deleted the codex/github-multiple-assets branch July 24, 2026 23:56
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