-
-
Notifications
You must be signed in to change notification settings - Fork 769
feat(backend): add filter_bins option to github/gitlab backends #7105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f24649c to
221f8a9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds a filter_bins option to the GitHub and GitLab backends, allowing users to selectively expose only specific binaries from a tool installation on PATH. This is useful for tools that bundle extra binaries or dependencies that users don't want exposed.
Key changes:
- Implements
filter_binsoption that accepts a comma-separated list of binary names to expose - Creates a
.mise-binsdirectory with symlinks only to specified binaries - Refactors
discover_bin_pathsto be reused by the filtering logic - Adds comprehensive documentation and e2e test for the new functionality
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/backend/github.rs |
Implements filter_bins functionality including get_filter_bins() and create_symlink_bin_dir() methods; refactors bin path discovery logic |
e2e/backend/test_github_filter_bins |
Adds e2e test using pandoc to verify that filtered binaries are correctly symlinked while others are excluded |
docs/dev-tools/backends/github.md |
Documents the new filter_bins option with usage examples and behavior description |
docs/dev-tools/backends/gitlab.md |
Documents the new filter_bins option with usage examples and behavior description |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
bugbot run |
| .filter(|s| !s.is_empty()) | ||
| .collect(), | ||
| ) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Empty filter_bins value hides all binaries unexpectedly
The get_filter_bins function returns Some(vec![]) when filter_bins is set to an empty or whitespace-only value. Since list_bin_paths checks .is_some() to decide whether to use the .mise-bins directory, an empty filter_bins causes the tool to be installed with no binaries exposed on PATH. Users who accidentally set filter_bins="" would see the installation succeed but be unable to run any commands. The function could return None when the resulting vector is empty to treat this as "option not set."
### 🚀 Features - **(backend)** add filter_bins option to github/gitlab backends by @risu729 in [#7105](#7105) - **(ci)** auto-close PRs from non-maintainers by @jdx in [#7108](#7108) - **(conda)** add conda backend for installing packages from conda-forge by @jdx in [#7139](#7139) - **(github)** add rename_exe option and switch elm, opam, yt-dlp from ubi by @jdx in [#7140](#7140) - **(install)** add --locked flag for strict lockfile mode by @jdx in [#7098](#7098) - **(lock)** implement cross-platform lockfile generation by @jdx in [#7091](#7091) - **(lockfile)** add options field for tool artifact identity by @jdx in [#7092](#7092) - **(lockfile)** add env field and local lockfile support by @jdx in [#7099](#7099) - **(lockfile)** add URL support for deno, go, and zig backends by @jdx in [#7112](#7112) - **(lockfile)** add URL support for vfox backend by @jdx in [#7114](#7114) - **(lockfile)** add multi-platform checksums without downloading tarballs by @jdx in [#7113](#7113) ### 🐛 Bug Fixes - **(backend)** allow platform-specific strip_components by @risu729 in [#7106](#7106) - **(backend)** prefer path root for bin path if it contains an executable by @risu729 in [#7151](#7151) - **(bash)** avoid deactivate error on (no)unset PROMPT_COMMAND by @scop in [#7096](#7096) - **(ci)** use updatedAt instead of createdAt for stale PR detection by @jdx in [#7109](#7109) - **(github)** search subdirectories for executables in discover_bin_paths by @jdx in [#7138](#7138) - **(lockfile)** combine api_url with asset_pattern for GitHub release URLs by @jdx in [#7111](#7111) ### 🚜 Refactor - **(lock)** simplify lockfile to always use array format by @jdx in [#7093](#7093) - **(lockfile)** use compact inline table format by @jdx in [#7141](#7141) ### 📚 Documentation - **(gitlab)** document rename_exe option also for gitlab backend by @risu729 in [#7149](#7149) - **(lockfile)** update documentation for recent lockfile changes by @jdx in [#7107](#7107) - **(node)** use config_root in _.path for pnpm example by @risu729 in [#7146](#7146) - **(registry)** add github/gitlab backends to the preferred backends list by @risu729 in [#7148](#7148) - **(registry)** add url mappings for all backends by @risu729 in [#7147](#7147) ### 📦️ Dependency Updates - update docker/metadata-action digest to c299e40 by @renovate[bot] in [#7101](#7101) - update ghcr.io/jdx/mise:alpine docker digest to 693c5f6 by @renovate[bot] in [#7102](#7102) - update ghcr.io/jdx/mise:deb docker digest to 9985cab by @renovate[bot] in [#7104](#7104) - update ghcr.io/jdx/mise:copr docker digest to 564d8e1 by @renovate[bot] in [#7103](#7103) - update rust crate ubi to 0.8.4 by @risu729 in [#7154](#7154) ### 📦 Registry - add aqua backend as primary for e1s by @jdx in [#7115](#7115) - add gem backend for bashly by @jdx in [6af6607](6af6607) - switch 1password from asdf to vfox backend by @jdx in [#7116](#7116) - add vfox backend for bfs by @jdx in [#7126](#7126) - add github backend for btrace by @jdx in [#7129](#7129) - add github backend for cf by @jdx in [#7131](#7131) - add vfox backend for bpkg by @jdx in [#7130](#7130) - switch apollo-ios from asdf to github backend by @jdx in [#7118](#7118) - add vfox backend for chromedriver by @jdx in [#7134](#7134) - switch superhtml, vespa-cli, xcsift from ubi to github backend by @jdx in [#7137](#7137) - add vfox backend for clickhouse by @jdx in [#7136](#7136) - switch chicken to vfox plugin by @jdx in [#7135](#7135) - switch chezscheme from asdf to vfox backend by @jdx in [#7132](#7132) - add vfox backend for carthage by @jdx in [#7133](#7133) - switch azure-functions-core-tools from asdf to vfox backend by @jdx in [#7128](#7128) - switch aapt2 to vfox backend by @jdx in [#7117](#7117) - switch ant to vfox backend by @jdx in [#7119](#7119) - switch asciidoctorj from asdf to vfox backend by @jdx in [#7121](#7121) - switch awscli-local to pipx backend by @jdx in [#7120](#7120) - add omnictl by @risu729 in [#7145](#7145) - remove pnpm asdf plugin from fallback by @risu729 in [#7143](#7143) - switch tanzu to github backend by @jdx in [#7124](#7124) - switch android-sdk to vfox plugin by @jdx in [#7127](#7127) - add vfox backend for ag (The Silver Searcher) by @jdx in [#7122](#7122) ### Chore - **(registry)** ignore deleted tools in test-tool workflow by @risu729 in [#7081](#7081) - **(release)** show registry section last in changelog by @jdx in [#7156](#7156) - update mise.lock with checksums by @jdx in [71e9123](71e9123) - disable cancel-in-progress for test workflow on main branch by @risu729 in [#7152](#7152) ## 📦 Aqua Registry Updates #### Updated Packages (1) - [`orf/gping`](https://github.com/orf/gping)
Adds
filter_binsoption togithub/gitlabbackends to exclude unwanted binaries.ref: #5788 (comment)
(
pypa/hatchis not compatible with GitHub backend, so this doesn't directly solve that problem.)This is basically the same as Aqua backend's
symlink_bins, but binaries listedfilter_binsare found from the bin paths, respectingbin_pathoption too.https://mise.jdx.dev/dev-tools/backends/github.html#bin-path
Gemini pointed out that we need wrapper scripts to change
$0, but I reverted it as it seemed redundant.Aqua has
linkoption for tools that depend on$0, but it seems such tools are not common.https://aquaproj.github.io/docs/reference/registry-config/files/#link
Note
Adds
filter_binsto GitHub/GitLab backends to expose only specified binaries via a.mise-binsdirectory; updates docs and adds an e2e test.filter_binsinsrc/backend/github.rs:.mise-binswith symlinks only to specified binaries (create_symlink_bin_dir,get_filter_bins).list_bin_pathsreturns/.mise-binswhenfilter_binsis set.bin_pathbefore fallback search.filter_binsoption todocs/dev-tools/backends/github.mdanddocs/dev-tools/backends/gitlab.mdwith examples and behavior notes.e2e/backend/test_github_filter_binsvalidating.mise-binscontains onlypandocforgithub:jgm/pandoc.Written by Cursor Bugbot for commit 4647df4. This will update automatically on new commits. Configure here.