-
-
Notifications
You must be signed in to change notification settings - Fork 773
feat(registry): add tool options support for http backend #7061
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
9 commits
Select commit
Hold shift + click to select a range
54c3be9
feat(registry): add tool options support for http backend
jdx 043ef9b
chore(registry): remove npm backend for claude-code
jdx 7f04be7
refactor(registry): move options to per-backend instead of tool-level
jdx fea4da8
docs(http): add version_list_url, version_regex, version_json_path op…
jdx 1d362d8
fix(http): make JSON parsing fallback consistent
jdx ee83cd0
[autofix.ci] apply automated fixes
autofix-ci[bot] 1e9b80a
[autofix.ci] apply automated fixes (attempt 2/3)
autofix-ci[bot] 94743c9
fix(registry): prevent raw string literal injection in codegen
jdx 7cb7c3e
fix(jq): use strip_prefix instead of manual string slicing
jdx 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,10 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Test HTTP backend with version_list_url (using claude-code from registry) | ||
|
|
||
| # Test that ls-remote works with version_list_url | ||
| assert_contains "mise ls-remote claude" "2." | ||
|
|
||
| # Test installation of claude-code via http backend | ||
| mise install claude@latest | ||
| assert "mise x claude -- claude --version" |
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 | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,6 +4,7 @@ use crate::backend::static_helpers::{ | |||||||||||||||||||||||||||||||||||||||||||||
| clean_binary_name, get_filename_from_url, list_available_platforms_with_key, | ||||||||||||||||||||||||||||||||||||||||||||||
| lookup_platform_key, template_string, verify_artifact, | ||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||
| use crate::backend::version_list; | ||||||||||||||||||||||||||||||||||||||||||||||
| use crate::cli::args::BackendArg; | ||||||||||||||||||||||||||||||||||||||||||||||
| use crate::config::Config; | ||||||||||||||||||||||||||||||||||||||||||||||
| use crate::config::Settings; | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -378,6 +379,24 @@ impl HttpBackend { | |||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
| Ok(()) | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| /// Fetch and parse versions from a version list URL | ||||||||||||||||||||||||||||||||||||||||||||||
| async fn fetch_versions_from_url(&self) -> Result<Vec<String>> { | ||||||||||||||||||||||||||||||||||||||||||||||
| let opts = self.ba.opts(); | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| // Get version_list_url from options | ||||||||||||||||||||||||||||||||||||||||||||||
| let version_list_url = match opts.get("version_list_url") { | ||||||||||||||||||||||||||||||||||||||||||||||
| Some(url) => url.clone(), | ||||||||||||||||||||||||||||||||||||||||||||||
| None => return Ok(vec![]), | ||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| // Get optional version regex pattern or JSON path | ||||||||||||||||||||||||||||||||||||||||||||||
| let version_regex = opts.get("version_regex").map(|s| s.as_str()); | ||||||||||||||||||||||||||||||||||||||||||||||
| let version_json_path = opts.get("version_json_path").map(|s| s.as_str()); | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| // Use the version_list module to fetch and parse versions | ||||||||||||||||||||||||||||||||||||||||||||||
| version_list::fetch_versions(&version_list_url, version_regex, version_json_path).await | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+388
to
+398
|
||||||||||||||||||||||||||||||||||||||||||||||
| let version_list_url = match opts.get("version_list_url") { | |
| Some(url) => url.clone(), | |
| None => return Ok(vec![]), | |
| }; | |
| // Get optional version regex pattern or JSON path | |
| let version_regex = opts.get("version_regex").map(|s| s.as_str()); | |
| let version_json_path = opts.get("version_json_path").map(|s| s.as_str()); | |
| // Use the version_list module to fetch and parse versions | |
| version_list::fetch_versions(&version_list_url, version_regex, version_json_path).await | |
| let version_list_url = opts.get("version_list_url").map(|s| s.as_str()); | |
| if version_list_url.is_none() { | |
| return Ok(vec![]); | |
| } | |
| // Get optional version regex pattern or JSON path | |
| let version_regex = opts.get("version_regex").map(|s| s.as_str()); | |
| let version_json_path = opts.get("version_json_path").map(|s| s.as_str()); | |
| // Use the version_list module to fetch and parse versions | |
| version_list::fetch_versions(version_list_url.unwrap(), version_regex, version_json_path).await |
Oops, something went wrong.
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.
[nitpick] These two lines extract options that are already being extracted from
opts. Consider extracting all three options (version_list_url,version_regex,version_json_path) consistently at the same location for better code organization.