-
-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
fcb42d6
feat(backend): add filter_bins option to github/gitlab backends
risu729 fdc5f15
feat(registry): Add github:pypa/hatch with filter_bins for Python iso…
risu729 e409fca
fix(backend): Use wrapper scripts for filter_bins on Unix to support …
risu729 2df024a
feat(test): Merge hatch filter_bins test into github filter_bins test
risu729 c69f197
fix(backend): Use batch wrappers for filter_bins on Windows
risu729 b208d20
docs: document Windows batch wrapper behavior for filter_bins
risu729 558b90a
fix(backend): Add fallback for non-Unix/non-Windows OS in filter_bins
risu729 30562b5
revert: Remove wrapper script logic from filter_bins and update docs
risu729 221f8a9
fix: Update filter_bins docs with pandoc example and revert wrappers
risu729 152530b
[autofix.ci] apply automated fixes
autofix-ci[bot] 0deb871
docs: Remove mentions of filtering documentation from filter_bins docs
risu729 0fc6522
refactor(backend): Move bin_path resolution to discover_bin_paths in …
risu729 f87fbc1
Update docs/dev-tools/backends/github.md
risu729 6d085fd
Update docs/dev-tools/backends/gitlab.md
risu729 7148d49
test: simplify test
risu729 abc4450
test: pass filter_bins option
risu729 b4a8328
docs: tweak
risu729 54ae448
feat(backend): Support platform-specific filter_bins option
risu729 4647df4
fix: fix style issues
risu729 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Test filter_bins option for github backend using pandoc. | ||
| # We use pandoc because it is a compiled binary and comes with multiple binaries to filter. | ||
|
|
||
| if [[ "$(uname -s)" != "Linux" ]]; then | ||
| echo "Skipping Linux-specific test on non-Linux OS" | ||
| exit 0 | ||
| fi | ||
|
|
||
| export MISE_EXPERIMENTAL=1 | ||
|
|
||
| mise install "github:jgm/pandoc[filter_bins=pandoc]@3.8.2" | ||
|
|
||
| bin_path="$(mise where github:jgm/[email protected])/.mise-bins" | ||
| assert_directory_exists "$bin_path" | ||
|
|
||
| bins=$(find "$bin_path" -maxdepth 1 \( -type l -o -type f \) -print0 | xargs -0 -n1 basename | sort | tr '\n' ' ') | ||
| assert_contains "echo '$bins'" "pandoc" | ||
| assert_not_contains "echo '$bins'" "pandoc-lua" | ||
| assert_not_contains "echo '$bins'" "pandoc-server" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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_binsfunction returnsSome(vec![])whenfilter_binsis set to an empty or whitespace-only value. Sincelist_bin_pathschecks.is_some()to decide whether to use the.mise-binsdirectory, an emptyfilter_binscauses the tool to be installed with no binaries exposed on PATH. Users who accidentally setfilter_bins=""would see the installation succeed but be unable to run any commands. The function could returnNonewhen the resulting vector is empty to treat this as "option not set."