Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/backend/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ impl HttpBackend {
// Include extraction options in cache key to handle different extraction needs
let mut cache_key_parts = vec![checksum.clone()];

if let Some(strip_components) = opts.get("strip_components") {
let strip_components = lookup_platform_key(opts, "strip_components")
.or_else(|| opts.get("strip_components").cloned());
Comment on lines +55 to +56
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform-specific strip_components lookup in the cache key generation lacks test coverage. Since this affects cache key generation and could lead to incorrect cache hits/misses if not working correctly, consider adding tests to verify that:

  1. Platform-specific strip_components values are correctly included in the cache key
  2. Different strip_components values result in different cache keys
  3. The fallback to generic strip_components works correctly

Copilot uses AI. Check for mistakes.
if let Some(strip_components) = strip_components {
cache_key_parts.push(format!("strip_{strip_components}"));
}

Expand Down Expand Up @@ -152,7 +154,9 @@ impl HttpBackend {
opts: &ToolVersionOptions,
pr: Option<&dyn SingleReport>,
) -> Result<()> {
let mut strip_components = opts.get("strip_components").and_then(|s| s.parse().ok());
let mut strip_components = lookup_platform_key(opts, "strip_components")
.or_else(|| opts.get("strip_components").cloned())
.and_then(|s| s.parse().ok());
Comment on lines +157 to +159
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform-specific strip_components lookup in the extraction logic lacks test coverage. Consider adding tests to verify that platform-specific strip_components values are correctly used during extraction and that the auto-detection logic still works correctly when platform-specific values are not provided.

Copilot uses AI. Check for mistakes.

file::create_dir_all(cache_path)?;

Expand Down
4 changes: 3 additions & 1 deletion src/backend/static_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,9 @@ pub fn install_artifact(
pr: Option<&dyn SingleReport>,
) -> eyre::Result<()> {
let install_path = tv.install_path();
let mut strip_components = opts.get("strip_components").and_then(|s| s.parse().ok());
let mut strip_components = lookup_platform_key(opts, "strip_components")
.or_else(|| opts.get("strip_components").cloned())
.and_then(|s| s.parse().ok());
Comment on lines +196 to +198
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new platform-specific strip_components functionality lacks test coverage. Consider adding a test similar to test_lookup_platform_key_bin or test_lookup_platform_key_bin_path that verifies strip_components can be looked up using platform-specific keys (e.g., platforms.macos-x64.strip_components or platforms_linux_x64_strip_components) and falls back to the generic strip_components value when a platform-specific value is not available.

Copilot uses AI. Check for mistakes.

file::remove_all(&install_path)?;
file::create_dir_all(&install_path)?;
Expand Down
Loading