Skip to content

Improve automatic and manual asset selection#90

Open
gdevenyi wants to merge 3 commits intomarwanhawari:mainfrom
gdevenyi:filter-manual
Open

Improve automatic and manual asset selection#90
gdevenyi wants to merge 3 commits intomarwanhawari:mainfrom
gdevenyi:filter-manual

Conversation

@gdevenyi
Copy link
Copy Markdown

Improvements to manual selection

  • if manual selection is because of too many results after filtering, only show filtered list
  • add --show-all-assets to override (including when automatic would've chosen a single entry)
  • add preference for gnu before musl (override with --show-all-assets)

Built using oh-my-pi using GLM-4.7

When automatic asset detection fails, the manual selection prompt now shows a smart filtered list based on what matched:
- Multiple OS+arch matches: show only those assets
- OS match but no arch match: show OS-matched assets
- No matches: show checksum-filtered list

This reduces cognitive load by presenting only relevant options to users.
Add a new --show-all-assets flag to install, search, and upgrade commands
that allows users to manually select from all available release assets
instead of relying on automatic OS/architecture detection.

Changes:
- Add --show-all-assets CLI flag to install, search, and upgrade commands
- Modify DetectAsset() to accept bypassDetection bool parameter
- When bypassDetection is true, show all assets (excluding checksums) via
  manual selection prompt
- Thread showAllAssets parameter through command handlers and core logic
- Update TestDetectAsset to use new function signature

The flag is useful when automatic detection fails or when users need to
select a specific asset variant (e.g., different build, musl vs glibc).

Bulk operations (upgrade --all, lockfile/Stewfile installs) continue to
use auto-detection to avoid excessive prompts.
Add automatic asset selection preference for Linux binaries to reduce
manual selection prompts when projects release multiple Linux variants.

Preference order:
1. GNU (explicitly tagged with "gnu")
2. Unspecified (no gnu/musl tag, assumed to be gnu, preferred over musl)
3. MUSL (explicitly tagged with "musl")

Changes:
- Add RegexLinuxGnu and RegexLinuxMusl patterns to constants/constants.go
- Implement linuxGnuMuslPreference() function in lib/github.go
- Integrate preference logic into DetectAsset() function for Linux assets
- Add comprehensive tests (4 test cases for DetectAsset, 7 for linuxGnuMuslPreference)

The implementation only applies to Linux assets and is fully backward
compatible. Non-Linux platforms (darwin, windows) are unaffected.
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.

1 participant