Conversation
Summary of ChangesHello, 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 addresses an inconsistency in how Aqua's 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
|
Greptile SummaryThis PR fixes a gap in Key changes:
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["srcs(pkg, tv) called"] --> B{pkg.files.is_empty?}
B -- Yes --> C["Compute fallback_name\nfrom pkg.name or pkg.repo_name"]
C --> D["Build path = install_path / fallback_name"]
D --> E{Windows &&\ncomplete_windows_ext?}
E -- Yes --> F["path.with_extension('exe')"]
E -- No --> G["Return [(path, path)]"]
F --> G
B -- No --> H["Map pkg.files to (src, dst) pairs\nusing file.src(pkg, version, os, arch)"]
H --> I["flatten_ok + unique_by src"]
I --> J["Return Vec of (src, dst) pairs"]
G --> K["Caller: install()"]
J --> K
K --> L{src == dst?}
L -- Yes --> M["Skip renaming step"]
L -- No --> N["Create rename symlink src→dst"]
M --> O{symlink_bins enabled?}
N --> O
O -- Yes --> P["create_symlink_bin_dir\ninstall_path/.mise-bins/bin_name → dst"]
Last reviewed commit: cb2b66c |
There was a problem hiding this comment.
Code Review
This pull request correctly fixes an issue where symlink_bins = true did not work for Aqua packages missing a files field. However, the implementation of the inferred binary name fallback introduces a potential path traversal risk by trusting the repo_name from the registry without sanitization. This needs remediation to ensure only the filename component is used when constructing installation paths. Additionally, a small piece of duplicated code should be refactored to improve long-term maintainability.
| let fallback_name = pkg | ||
| .name | ||
| .as_deref() | ||
| .and_then(|n| n.split('/').next_back()) | ||
| .unwrap_or(&pkg.repo_name); |
There was a problem hiding this comment.
The fallback logic for fallback_name uses pkg.repo_name directly if pkg.name is missing or invalid. This introduces a potential path traversal vulnerability because pkg.repo_name is not sanitized, allowing malicious input to resolve to locations outside the intended installation directory. It is recommended to apply split('/').next_back() sanitization to ensure only the last component of the name is used. Furthermore, this logic for determining the fallback binary name is duplicated in the install function (around line 1565). This duplication could lead to inconsistencies and should be refactored, perhaps by extracting it into a private helper function within impl AquaBackend.
| let fallback_name = pkg | |
| .name | |
| .as_deref() | |
| .and_then(|n| n.split('/').next_back()) | |
| .unwrap_or(&pkg.repo_name); | |
| let fallback_name = pkg.name.as_deref().and_then(|n| n.split('/').next_back()).unwrap_or(&pkg.repo_name).split('/').next_back().unwrap(); |
There was a problem hiding this comment.
This does not need to be changed in this PR.
This PR fixes the symlink_bins regression for the empty-files case. The fallback logic was not introduced here; install() already uses the same fallback logic.
Any hardening or deduplication of that fallback should be handled separately, since it affects both install() and srcs().
ee55e91 to
cb2b66c
Compare
### 🚀 Features - **(github)** use release latest endpoint to get latest release by @roele in [#8516](#8516) - **(install)** add shared and system install directories by @jdx in [#8581](#8581) - **(vfox)** add provenance metadata to lockfile for tool plugins by @malept in [#8544](#8544) ### 🐛 Bug Fixes - **(aqua)** expose main binary when files field is empty and symlink_bins is enabled by @AlexanderTheGrey in [#8550](#8550) - **(env)** redact secrets in `mise set` listing and task-specific env by @jdx in [#8583](#8583) - **(prepare)** install config tools before running prepare steps by @jdx in [#8582](#8582) - **(task)** allow ctrl-c to interrupt tool downloads during `mise run` by @jdx in [#8571](#8571) - **(tasks)** add file task header parser support for spaces around = by @roele in [#8574](#8574) ### 📚 Documentation - **(task)** add property description for interactive by @roele in [#8562](#8562) - add missing `</bold>` closing tag by @muzimuzhi in [#8564](#8564) - rebrand site with new chef logo and warm culinary palette by @jdx in [#8587](#8587) ### 📦️ Dependency Updates - update ghcr.io/jdx/mise:alpine docker digest to de4657e by @renovate[bot] in [#8577](#8577) - update ghcr.io/jdx/mise:copr docker digest to eef29a2 by @renovate[bot] in [#8578](#8578) - update ghcr.io/jdx/mise:rpm docker digest to 5a96587 by @renovate[bot] in [#8580](#8580) - update ghcr.io/jdx/mise:deb docker digest to 464cf7c by @renovate[bot] in [#8579](#8579) ### 📦 Registry - fix flatc version test mismatch by @jdx in [#8588](#8588) ### Chore - **(registry)** skip spark test-tool by @jdx in [#8572](#8572) ### New Contributors - @AlexanderTheGrey made their first contribution in [#8550](#8550) ## 📦 Aqua Registry Updates #### New Packages (6) - [`bahdotsh/mdterm`](https://github.com/bahdotsh/mdterm) - [`callumalpass/mdbase-lsp`](https://github.com/callumalpass/mdbase-lsp) - [`facebook/ktfmt`](https://github.com/facebook/ktfmt) - [`gurgeous/tennis`](https://github.com/gurgeous/tennis) - [`tektoncd/pipelines-as-code`](https://github.com/tektoncd/pipelines-as-code) - [`weedonandscott/trolley`](https://github.com/weedonandscott/trolley) #### Updated Packages (2) - [`apple/container`](https://github.com/apple/container) - [`cocogitto/cocogitto`](https://github.com/cocogitto/cocogitto)
…ins is enabled (jdx#8550) ## Summary Fix Aqua `symlink_bins = true` for packages whose registry metadata does not define a `files` field. Previously, Aqua could still install the main binary via its existing fallback logic, but symlink generation only used `files`. For packages without a `files` entry, that could leave `.mise-bins` empty, so the installed tool was not exposed as a usable mise-managed command when `symlink_bins = true`. This change makes symlink generation use the same inferred main-binary fallback as install, so `symlink_bins` continues to filter extraneous executables without dropping the primary tool. ## Changes - Add the inferred main-binary fallback to Aqua symlink source generation - Add an e2e regression test for a package without an aqua `files` entry - Clarify the `symlink_bins` documentation for the no-`files` fallback case ## Result `symlink_bins = true` now behaves consistently for Aqua packages both with and without a registry `files` entry, and still avoids exposing bundled dependencies and other extra executables.
### 🚀 Features - **(github)** use release latest endpoint to get latest release by @roele in [jdx#8516](jdx#8516) - **(install)** add shared and system install directories by @jdx in [jdx#8581](jdx#8581) - **(vfox)** add provenance metadata to lockfile for tool plugins by @malept in [jdx#8544](jdx#8544) ### 🐛 Bug Fixes - **(aqua)** expose main binary when files field is empty and symlink_bins is enabled by @AlexanderTheGrey in [jdx#8550](jdx#8550) - **(env)** redact secrets in `mise set` listing and task-specific env by @jdx in [jdx#8583](jdx#8583) - **(prepare)** install config tools before running prepare steps by @jdx in [jdx#8582](jdx#8582) - **(task)** allow ctrl-c to interrupt tool downloads during `mise run` by @jdx in [jdx#8571](jdx#8571) - **(tasks)** add file task header parser support for spaces around = by @roele in [jdx#8574](jdx#8574) ### 📚 Documentation - **(task)** add property description for interactive by @roele in [jdx#8562](jdx#8562) - add missing `</bold>` closing tag by @muzimuzhi in [jdx#8564](jdx#8564) - rebrand site with new chef logo and warm culinary palette by @jdx in [jdx#8587](jdx#8587) ### 📦️ Dependency Updates - update ghcr.io/jdx/mise:alpine docker digest to de4657e by @renovate[bot] in [jdx#8577](jdx#8577) - update ghcr.io/jdx/mise:copr docker digest to eef29a2 by @renovate[bot] in [jdx#8578](jdx#8578) - update ghcr.io/jdx/mise:rpm docker digest to 5a96587 by @renovate[bot] in [jdx#8580](jdx#8580) - update ghcr.io/jdx/mise:deb docker digest to 464cf7c by @renovate[bot] in [jdx#8579](jdx#8579) ### 📦 Registry - fix flatc version test mismatch by @jdx in [jdx#8588](jdx#8588) ### Chore - **(registry)** skip spark test-tool by @jdx in [jdx#8572](jdx#8572) ### New Contributors - @AlexanderTheGrey made their first contribution in [jdx#8550](jdx#8550) ## 📦 Aqua Registry Updates #### New Packages (6) - [`bahdotsh/mdterm`](https://github.com/bahdotsh/mdterm) - [`callumalpass/mdbase-lsp`](https://github.com/callumalpass/mdbase-lsp) - [`facebook/ktfmt`](https://github.com/facebook/ktfmt) - [`gurgeous/tennis`](https://github.com/gurgeous/tennis) - [`tektoncd/pipelines-as-code`](https://github.com/tektoncd/pipelines-as-code) - [`weedonandscott/trolley`](https://github.com/weedonandscott/trolley) #### Updated Packages (2) - [`apple/container`](https://github.com/apple/container) - [`cocogitto/cocogitto`](https://github.com/cocogitto/cocogitto)
Summary
Fix Aqua
symlink_bins = truefor packages whose registry metadata does not define afilesfield.Previously, Aqua could still install the main binary via its existing fallback logic, but symlink generation only used
files. For packages without afilesentry, that could leave.mise-binsempty, so the installed tool was not exposed as a usable mise-managed command whensymlink_bins = true.This change makes symlink generation use the same inferred main-binary fallback as install, so
symlink_binscontinues to filter extraneous executables without dropping the primary tool.Changes
filesentrysymlink_binsdocumentation for the no-filesfallback caseResult
symlink_bins = truenow behaves consistently for Aqua packages both with and without a registryfilesentry, and still avoids exposing bundled dependencies and other extra executables.