feat(vsix): added vsix archives to http backend#8306
Conversation
Summary of ChangesHello @sosumappu, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the HTTP backend's ability to handle Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly adds support for .vsix archives by mapping the extension to the Zip format in TarFormat::from_ext. This allows the HTTP backend to recognize and extract Visual Studio Extension files as ZIP archives. While the change is correct for the primary installation path, the implementation is currently incomplete as several other locations in the codebase that rely on hardcoded extension lists for archive detection and scoring have not been updated. Specifically, is_archive_format in src/cli/generate/tool_stub.rs and the asset scoring penalties in src/backend/asset_matcher.rs should be updated to ensure a consistent experience across all mise features.
| "bz2" | "tbz2" => TarFormat::TarBz2, | ||
| "zst" | "tzst" => TarFormat::TarZst, | ||
| "zip" => TarFormat::Zip, | ||
| "vsix" => TarFormat::Zip, |
There was a problem hiding this comment.
While adding .vsix to from_ext correctly enables extraction for the HTTP backend, this change appears to be incomplete as other parts of the codebase still use hardcoded extension lists for archive handling:
is_archive_format(line 553 insrc/cli/generate/tool_stub.rs): This function needs to include.vsixso thatmise generate tool-stubcan correctly identify these files as archives and attempt to auto-detect the binary path within them.AssetPicker::score_build_penalties(line 356 insrc/backend/asset_matcher.rs): There is a -100 penalty explicitly for.vsixfiles. Now that they are supported as valid archives, this penalty should likely be removed or reduced so that.vsixassets can be correctly auto-detected when they are the primary distribution format for a tool.open_tar(line 898 insrc/file.rs): TheAutomatch arm should be updated to handlevsix(similar tozip) to avoid falling through to the defaultTarGzcase, which would lead to confusing errors if content inspection is attempted on a VSIX file.
There was a problem hiding this comment.
I think we need to handle 1 and 3 here
There was a problem hiding this comment.
on it, my bad i oversaw that
There was a problem hiding this comment.
Pull request overview
This PR updates the HTTP backend’s archive format detection so that .vsix files (which are ZIP archives) are extracted instead of being treated as raw/unextractable blobs.
Changes:
- Map the
vsixextension toTarFormat::Zipin archive format detection.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "bz2" | "tbz2" => TarFormat::TarBz2, | ||
| "zst" | "tzst" => TarFormat::TarZst, | ||
| "zip" => TarFormat::Zip, | ||
| "vsix" => TarFormat::Zip, |
There was a problem hiding this comment.
This adds a new extension→format mapping; please add a small unit test to lock in the behavior (e.g., asserting TarFormat::from_ext("vsix") resolves to TarFormat::Zip). This file already has a #[cfg(test)] module, so it should be straightforward to extend and will prevent regressions in future refactors of from_ext.
|
bugbot run |
…rmat for tool_stub
|
Added the necessary changes to 1 and 3
|
### 🚀 Features - **(conda)** replace custom backend with rattler crates by @jdx in [#8325](#8325) - **(task)** enforce per-task timeout configuration by @tvararu in [#8250](#8250) - **(vsix)** added vsix archives to http backend by @sosumappu in [#8306](#8306) - add core dotnet plugin for .NET SDK management by @jdx in [#8326](#8326) ### 🐛 Bug Fixes - **(conda)** preserve conda_packages on locked install and fix temp file race by @jdx in [#8335](#8335) - **(conda)** deduplicate repodata records to fix solver error on Linux by @jdx in [#8337](#8337) - **(env)** include watch_files in fast-path early exit check by @jdx in [#8317](#8317) - **(env)** clear fish completions when setting/unsetting shell aliases by @jdx in [#8324](#8324) - **(lockfile)** prevent lockfile writes when --locked is set by @jdx in [#8308](#8308) - **(lockfile)** prune orphan tool entries on mise lock by @mackwic in [#8265](#8265) - **(lockfile)** error on contradictory locked=true + lockfile=false config by @jdx in [#8329](#8329) - **(regal)** Update package location by @charlieegan3 in [#8315](#8315) - **(release)** strip markdown heading prefix from communique release title by @jdx in [#8303](#8303) - **(schema)** enforce additionalProperties constraint for env by @adamliang0 in [#8328](#8328) ### 📚 Documentation - Remove incorrect oh-my-zsh plugin ordering comment by @bvosk in [#8323](#8323) - require AI disclosure on GitHub comments by @jdx in [#8330](#8330) ### 📦 Registry - add `oxfmt` by @taoufik07 in [#8316](#8316) ### New Contributors - @adamliang0 made their first contribution in [#8328](#8328) - @tvararu made their first contribution in [#8250](#8250) - @bvosk made their first contribution in [#8323](#8323) - @taoufik07 made their first contribution in [#8316](#8316) - @charlieegan3 made their first contribution in [#8315](#8315) - @sosumappu made their first contribution in [#8306](#8306) ## 📦 Aqua Registry Updates #### New Packages (3) - [`Tyrrrz/FFmpegBin`](https://github.com/Tyrrrz/FFmpegBin) - [`elixir-lang/expert`](https://github.com/elixir-lang/expert) - [`erikjuhani/basalt`](https://github.com/erikjuhani/basalt) #### Updated Packages (5) - [`caarlos0/fork-cleaner`](https://github.com/caarlos0/fork-cleaner) - [`firecow/gitlab-ci-local`](https://github.com/firecow/gitlab-ci-local) - [`jackchuka/mdschema`](https://github.com/jackchuka/mdschema) - [`kunobi-ninja/kunobi-releases`](https://github.com/kunobi-ninja/kunobi-releases) - [`peco/peco`](https://github.com/peco/peco)
Mapped `.vsix` extension to `TarFormat::Zip`. `vsix` archives are zip archives, without this mapping `.vsix`archives are treated as `raw` and therefore not extracted. tests : - `cargo test` - `Manual testing with actual `.vsix` file: ```toml [tools] 'http:java-debug'.version = "latest" 'http:java-debug'.url = "https://open-vsx.org/api/vscjava/vscode-java-pack/0.30.5/file/vscjava.vscode-java-pack-0.30.5.vsix" ```
### 🚀 Features - **(conda)** replace custom backend with rattler crates by @jdx in [jdx#8325](jdx#8325) - **(task)** enforce per-task timeout configuration by @tvararu in [jdx#8250](jdx#8250) - **(vsix)** added vsix archives to http backend by @sosumappu in [jdx#8306](jdx#8306) - add core dotnet plugin for .NET SDK management by @jdx in [jdx#8326](jdx#8326) ### 🐛 Bug Fixes - **(conda)** preserve conda_packages on locked install and fix temp file race by @jdx in [jdx#8335](jdx#8335) - **(conda)** deduplicate repodata records to fix solver error on Linux by @jdx in [jdx#8337](jdx#8337) - **(env)** include watch_files in fast-path early exit check by @jdx in [jdx#8317](jdx#8317) - **(env)** clear fish completions when setting/unsetting shell aliases by @jdx in [jdx#8324](jdx#8324) - **(lockfile)** prevent lockfile writes when --locked is set by @jdx in [jdx#8308](jdx#8308) - **(lockfile)** prune orphan tool entries on mise lock by @mackwic in [jdx#8265](jdx#8265) - **(lockfile)** error on contradictory locked=true + lockfile=false config by @jdx in [jdx#8329](jdx#8329) - **(regal)** Update package location by @charlieegan3 in [jdx#8315](jdx#8315) - **(release)** strip markdown heading prefix from communique release title by @jdx in [jdx#8303](jdx#8303) - **(schema)** enforce additionalProperties constraint for env by @adamliang0 in [jdx#8328](jdx#8328) ### 📚 Documentation - Remove incorrect oh-my-zsh plugin ordering comment by @bvosk in [jdx#8323](jdx#8323) - require AI disclosure on GitHub comments by @jdx in [jdx#8330](jdx#8330) ### 📦 Registry - add `oxfmt` by @taoufik07 in [jdx#8316](jdx#8316) ### New Contributors - @adamliang0 made their first contribution in [jdx#8328](jdx#8328) - @tvararu made their first contribution in [jdx#8250](jdx#8250) - @bvosk made their first contribution in [jdx#8323](jdx#8323) - @taoufik07 made their first contribution in [jdx#8316](jdx#8316) - @charlieegan3 made their first contribution in [jdx#8315](jdx#8315) - @sosumappu made their first contribution in [jdx#8306](jdx#8306) ## 📦 Aqua Registry Updates #### New Packages (3) - [`Tyrrrz/FFmpegBin`](https://github.com/Tyrrrz/FFmpegBin) - [`elixir-lang/expert`](https://github.com/elixir-lang/expert) - [`erikjuhani/basalt`](https://github.com/erikjuhani/basalt) #### Updated Packages (5) - [`caarlos0/fork-cleaner`](https://github.com/caarlos0/fork-cleaner) - [`firecow/gitlab-ci-local`](https://github.com/firecow/gitlab-ci-local) - [`jackchuka/mdschema`](https://github.com/jackchuka/mdschema) - [`kunobi-ninja/kunobi-releases`](https://github.com/kunobi-ninja/kunobi-releases) - [`peco/peco`](https://github.com/peco/peco)
Mapped
.vsixextension toTarFormat::Zip.vsixarchives are zip archives, without this mapping.vsixarchives are treated asrawand therefore not extracted.tests :
cargo testManual testing with actual.vsix` file: