Skip to content

fix(aqua): extract 7z archives#10224

Merged
jdx merged 2 commits into
jdx:mainfrom
risu729:fix/aqua-7z-extraction
Jun 5, 2026
Merged

fix(aqua): extract 7z archives#10224
jdx merged 2 commits into
jdx:mainfrom
risu729:fix/aqua-7z-extraction

Conversation

@risu729

@risu729 risu729 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • route aqua format: 7z archives through the existing archive extractor
  • detect .7z assets in the aqua registry mirror when format is omitted
  • add Windows e2e coverage using a small local aqua registry and the existing 7z fixture

References

Testing

  • cargo fmt --all -- --check
  • git diff --check
  • Attempted cargo test -p aqua-registry test_format_detects_7z_asset, but local execution was blocked for an extended period by the shared Cargo build-directory lock from other worktrees; CI should cover this path
  • Windows Pester e2e not run locally on Linux

Summary by CodeRabbit

  • New Features

    • Added support for 7z archive format detection to recognize and handle 7z compressed archives
    • Implemented Windows-optimized extraction handling for 7z packages ensuring proper decompression and installation
  • Tests

    • Added end-to-end test suite validating 7z package installation workflow on Windows
    • Test coverage includes local registry configuration, tool installation, and execution verification

@coderabbitai

coderabbitai Bot commented Jun 4, 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: aec6881c-8e7f-4d6a-95ee-ee860ec65e23

📥 Commits

Reviewing files that changed from the base of the PR and between ebf4795 and d788434.

📒 Files selected for processing (3)
  • crates/aqua-registry/src/types.rs
  • e2e-win/7z.Tests.ps1
  • src/backend/aqua.rs

📝 Walkthrough

Walkthrough

This PR adds 7z archive format support to the Aqua package manager backend. Format detection recognizes .7z extensions with a unit test validating the detection. The extraction logic on Windows routes 7z through the untar-based path, and an end-to-end test verifies the complete install and execution workflow with a bundled 7za.exe fixture.

Changes

7z Archive Format Support

Layer / File(s) Summary
7z format detection
crates/aqua-registry/src/types.rs
detect_format recognizes .7z extensions (reformatted across lines without functional change), and a unit test asserts that assets ending in .7z return format "7z".
Windows extraction routing
src/backend/aqua.rs
The AquaBackend::install extraction condition now includes format == "7z" on Windows to route 7z archives through the untar-based extraction path.
End-to-end test
e2e-win/7z.Tests.ps1
A Windows test suite sets up a local registry with a 7za.exe fixture, overrides Aqua environment variables, runs mise install, and validates mise x aqua:example/7zip -- 7za outputs the expected 7-Zip version.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A seven-zee archive hops on by,
Format detected, extraction's nigh,
Windows paths unfold with care,
Testing proves it's working there! 🎯

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly identifies the main change: adding support for extracting 7z archives in the aqua backend, which is confirmed by the PR objectives and all three modified files.
Docstring Coverage ✅ Passed Docstring coverage is 80.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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@greptile-apps

greptile-apps Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds 7z archive support to the aqua backend by routing format == "7z" through the existing file::untar / un7z path on Windows and detecting .7z extensions in detect_format when the format field is omitted from the registry entry.

  • crates/aqua-registry/src/types.rs: Inserts "7z" into the detect_format suffix array (between "zip" and "gz", where ordering doesn't conflict), and adds a unit test for the new detection path.
  • src/backend/aqua.rs: Extends the tar-branch condition to format.starts_with("tar") || (format == "7z" && cfg!(windows)); on non-Windows the compile-time guard evaluates to false, so a 7z format still hits bail!("unsupported format: {}") as expected.
  • e2e-win/7z.Tests.ps1: Adds a Windows Pester test that bootstraps a local aqua registry, installs example/7zip from the existing test fixture, and validates end-to-end extraction.

Confidence Score: 5/5

Safe to merge — the change is narrowly scoped to the aqua 7z path, the Windows-only guard is expressed at compile time, and non-Windows behaviour is unchanged.

All three changed files are small and self-contained. The cfg!(windows) guard correctly prevents the new code path from executing on non-Windows hosts, the format detection insertion doesn't conflict with any existing suffix, and the e2e test exercises the full install-and-execute flow against a real fixture.

No files require special attention.

Important Files Changed

Filename Overview
crates/aqua-registry/src/types.rs Adds "7z" to the detect_format suffix list so packages with .7z URLs/assets are correctly identified when format is omitted; adds a unit test covering the new detection path.
src/backend/aqua.rs Routes format=="7z" through file::untar on Windows via a cfg!(windows) compile-time guard; on non-Windows the condition is false and execution correctly falls through to the existing bail!("unsupported format") arm.
e2e-win/7z.Tests.ps1 Adds a Windows Pester e2e test that spins up a local aqua registry pointing at the existing 7z test fixture, installs via the aqua backend, and verifies 7za executes correctly; env vars are saved/restored cleanly in AfterAll.

Reviews (3): Last reviewed commit: "fix(aqua): guard 7z extraction by platfo..." | Re-trigger Greptile

Comment thread src/backend/aqua.rs Outdated
@risu729 risu729 force-pushed the fix/aqua-7z-extraction branch from 77c905e to d788434 Compare June 5, 2026 16:37
@risu729 risu729 marked this pull request as ready for review June 5, 2026 17:04
@jdx jdx merged commit 532826a into jdx:main Jun 5, 2026
33 checks passed
@risu729 risu729 deleted the fix/aqua-7z-extraction branch June 5, 2026 23:29
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.

2 participants