-
-
Notifications
You must be signed in to change notification settings - Fork 769
fix(backend): allow platform-specific strip_components #7106
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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()); | ||
| if let Some(strip_components) = strip_components { | ||
| cache_key_parts.push(format!("strip_{strip_components}")); | ||
| } | ||
|
|
||
|
|
@@ -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
|
||
|
|
||
| file::create_dir_all(cache_path)?; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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
|
||
|
|
||
| file::remove_all(&install_path)?; | ||
| file::create_dir_all(&install_path)?; | ||
|
|
||
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.
The platform-specific
strip_componentslookup 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:strip_componentsvalues are correctly included in the cache keystrip_componentsvalues result in different cache keysstrip_componentsworks correctly